Jump to content


Photo

Weird Problem With Swfobject.js Script


  • Please log in to reply
15 replies to this topic

#1 Krissi

Krissi

    New To The Neighborhood

  • Members
  • Pip
  • 7 posts

Posted 10 March 2009 - 12:32 AM

On my main site (http://snuppa.krissi.net) I'm using the script swfobject.js in order to show the flash in the header. The version of the swfobject.js file is v1.5.

Then the creator of the flash upgraded and included the new version of swfobject.js (http://code.google.com/p/swfobject/) which is v2.1.

I tested this on my test site: http://test.krissi.net - but whatever I do - I'm not able to get the script declared and working, so that the flash would work. I've discussed this with several others using the same script/flash and they made it work with the new code, but one of them had to contact the host provider in order to change some security settings on the script. I made a ticket into the help desk ( HKY-165224 ), but they claim there is no such issues with the script.
So - is there anyone out there who have any knowledge of this that can help me out? Why will not the script be declared and "loaded" at all? I'm calling the script in the header section along with the other scripts the site is using (on the test site: http://test.krissi.net).

Any help will be highly appreciated!

Thanks!

Krissi

Edited by Krissi, 10 March 2009 - 12:34 AM.


#2 TCH-Ellis

TCH-Ellis

    New To The Neighborhood

  • Members
  • Pip
  • 13 posts

Posted 10 March 2009 - 02:01 AM

Krissi,
I will look in to the ticket HKY-165224 and will respond to the ticket as soon as possible.
Regards,
Ellis Hadley
Technical Support, TotalChoiceHosting, LLC.

#3 OJB

OJB

    Immediate Family

  • Members
  • PipPipPipPip
  • 364 posts

Posted 10 March 2009 - 03:46 AM

I thought swfObject 2.1 didn't use the same syntax as before.

you are using:

var so = new SWFObject("http://test.krissi.net/wp-content/themes/arthemia-premium/deploy/preview.swf?xmlPath=http://test.krissi.net/wp-content/themes/arthemia-premium/deploy/accordion.xml&KeepSelected=t&selectedWindow=0&imageWidth=420&imageHeight=325&sWidth=600&sHeight=325", "sotester", "600", "325", "8", "#ffffff");
						so.addParam("allowFullScreen", "true");
						so.addParam("wmode", "transparent");
						so.write("flashcontent");


I thought the new version made use of this syntax to embed a swf:


swfobject.embedSWF(swfUrl, id, width, height, version, expressInstallSwfurl, flashvars, params, attributes);

where 'id' is the id of the DOM element you are trying to embed the swf into.


But then again I am no javascript expert so I might be wrong.

Edited by OJB, 10 March 2009 - 03:47 AM.


#4 TCH-Bruce

TCH-Bruce

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 20,149 posts

Posted 10 March 2009 - 07:04 AM

Welcome to the forums Krissi :)

Bruce Richards
Forum Moderator
TotalChoice Hosting, Inc.
Webhosting by Total Choice Web Hosting - General Support Forum

I am a Forum Moderator. While I can assist in answering most of your hosting related questions, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.


#5 TCH-Thomas

TCH-Thomas

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 15,188 posts

Posted 10 March 2009 - 11:11 AM

Welcome to the forum, Krissi. :)
Thomas Jikrantz
Forum Moderator
TotalChoice Hosting, Inc.

Any links or suggestions for third party software/sites should be used at your own risk. My opinions and recommendations are not necessary those of TCH and TCH is not responsible.

As a Forum Moderator I can assist in answering many of your hosting related questions. However, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.
Web Hosting by Total Choice Web Hosting - 24/7 Help Desk

#6 Krissi

Krissi

    New To The Neighborhood

  • Members
  • Pip
  • 7 posts

Posted 10 March 2009 - 01:00 PM

Thanks for the nice welcome! :)
And to TCH-Ellis for looking into the error messages.

OJB; I'm a total novise when it comes to this, all I've done is using a code and implementation that others have used. And they have the same wordpress version and theme. The sample html file that came with the accordian flash is in fact working fine on my site: http://test.krissi.n...premium/deploy/ - but this is how it is called in a html-file. I'm (of course) using php-files in Wordpress. It might be that I need to declare the script in another manner because of the new version, but I'm lost on how. I can read your line of code, OJB, but I do not know enough to find out how to implement it.

Now comes the really weird stuff. Another Wordpress installation, with the same theme has implemented the script in the new version and the got the flash to work, with the exact same code that I have used: http://tatianamoses.com/blog/ She's the one who made it work after contacting the site host provider and they made some changes (white listed the script, I think).

So the script in the new version is possible to implement in a php page (in wordpress) using the code I have done.

Krissi

#7 OJB

OJB

    Immediate Family

  • Members
  • PipPipPipPip
  • 364 posts

Posted 10 March 2009 - 01:53 PM

you need to create a div with a unique id where the SWF is going to be embedded.

then somewhere OUTSIDE of that div you need to put the following:

<script type="text/javascript">
		
			var stageW = 650;
			var stageH = 300; 
			var cacheBuster = Date.parse(new Date());
			
			var flashvars = {};
			var params = {};
			
			params.bgcolor = "#efefef";
			params.allowfullscreen = "true";
			
			
			flashvars.stageW = stageW;
			flashvars.stageH = stageH;
			
			flashvars.xmlPath = "accordion.xml";

			flashvars.keepSelected = "t";
			flashvars.selectedWindow = "4";
			flashvars.slideshow = "t";
			
			flashvars.imageWidth = "315";
			flashvars.imageHeight = "300";
			
			swfobject.embedSWF("preview.swf?t="+cacheBuster, "YOURDIVID", stageW, stageH, "9.0.124", "js/expressInstall.swf", flashvars, params);
			
		</script>

Note where it says "YOURDIVID", you replace that with the id you have given the div you want to embed the swf into.

so for a very basic example

<html>
<head>
<title>Page Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
		
			var stageW = 650;
			var stageH = 300; 
			var cacheBuster = Date.parse(new Date());
			
			var flashvars = {};
			var params = {};
			
			params.bgcolor = "#efefef";
			params.allowfullscreen = "true";
			
			
			flashvars.stageW = stageW;
			flashvars.stageH = stageH;
			
			flashvars.xmlPath = "accordion.xml";

			flashvars.keepSelected = "t";
			flashvars.selectedWindow = "4";
			flashvars.slideshow = "t";
			
			flashvars.imageWidth = "315";
			flashvars.imageHeight = "300";
			
			swfobject.embedSWF("preview.swf?t="+cacheBuster, "flashAccordion", stageW, stageH, "9.0.124", "js/expressInstall.swf", flashvars, params);
			
		</script>

</head>
<body>
<div id="flashAccordion">
</div>
</body>
</html>


#8 Krissi

Krissi

    New To The Neighborhood

  • Members
  • Pip
  • 7 posts

Posted 10 March 2009 - 02:38 PM

OMG! :P

OJB, you made it! You actually managed to help me out on this! I had to include the full path to the files (accordian.xml, preview.swf etc), but then the flash finally showed up!!!!

I need to do some tweaking on the size etc, but that's just minor stuff.

You can't image how many hours I've been struggling with this, and here you came like Superman (or Superwoman?) and just saved my day! I'm so grateful!!

Thanks, thanks and thanks!! :) :)

#9 OJB

OJB

    Immediate Family

  • Members
  • PipPipPipPip
  • 364 posts

Posted 10 March 2009 - 03:27 PM

^ No problemo.

And its superman, not woman hahah.

Glad you got it working!!

Let me know if you have any other issues.

#10 Krissi

Krissi

    New To The Neighborhood

  • Members
  • Pip
  • 7 posts

Posted 10 March 2009 - 03:47 PM

My Superman! :)

I do have one more issue, but I guess it's a long shot. Do you know anything about national characters in Flash scripts like these?
I'm Norwegian, and we do have some odd characters. I tried to get help from the creator of the Flash and all he said was:

Guys, in order to add support for these characters, you need to embed all chars of the fonts used in Flash. Simply select the font and choose embed all. I didnít do that because it would make the file much larger and most of the buyers donít need all the 54k+ chars embedded into the swf.


Can this be done in the code?

#11 OJB

OJB

    Immediate Family

  • Members
  • PipPipPipPip
  • 364 posts

Posted 10 March 2009 - 04:02 PM

That has to be done when you convert the FLA to a SWF.

#12 Krissi

Krissi

    New To The Neighborhood

  • Members
  • Pip
  • 7 posts

Posted 10 March 2009 - 04:11 PM

That has to be done when you convert the FLA to a SWF.


Ah! I do have the FLA file. I need to find a Flash program, I guess. Any hints on a cheap (and a good) one? ;-)

#13 OJB

OJB

    Immediate Family

  • Members
  • PipPipPipPip
  • 364 posts

Posted 10 March 2009 - 05:05 PM

I think you need Adobe Flash which isn't cheap at £562 from Adobe.

#14 Krissi

Krissi

    New To The Neighborhood

  • Members
  • Pip
  • 7 posts

Posted 11 March 2009 - 12:11 AM

That's too much money to spend for changing the Flash, it's not like I'm a Flash developer. :)
Maybe I can get the developer to do the embedding in the code for me, for a smaller amount.

Thanks again, OJB. I've come far with your help! :D

#15 Krissi

Krissi

    New To The Neighborhood

  • Members
  • Pip
  • 7 posts

Posted 14 March 2009 - 02:35 AM

I just wanted to conclude the issue on national characters, in case any other have the same issue. In my case, I had an xml-file that provide the text into the Flash. By saving the xml-file with the utf-16 encoding, I was able to use national characters in the Flash.

Krissi

#16 TCH-Thomas

TCH-Thomas

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 15,188 posts

Posted 14 March 2009 - 03:46 AM

Thanks for the update, Krissi.
I am sure others will find this info useful. :)
Thomas Jikrantz
Forum Moderator
TotalChoice Hosting, Inc.

Any links or suggestions for third party software/sites should be used at your own risk. My opinions and recommendations are not necessary those of TCH and TCH is not responsible.

As a Forum Moderator I can assist in answering many of your hosting related questions. However, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.
Web Hosting by Total Choice Web Hosting - 24/7 Help Desk




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users