A newbie flash question..

bamme

Senior Member
Hi people - first post in this section :) I have experience of javascript/ jquery/html/css but no flash, so excuse the newbie-ness.

Ive been trying to include an swf with buttons, that plays .flv videos, into this html page:

www.ameliealden.com/vnm/samsmith/video.html

(feel free to view source)

I am using swfobject (deconcept You’ve got your good thing, and I’ve got mine SWFObject: Javascript Flash Player detection and embed script)
my code is below:

<div id="flashcontent">
<strong>You need to upgrade your Flash Player</strong>
This is replaced by the Flash content.
Place your alternate content here and users without the Flash plugin or with
Javascript turned off will see this. Content here allows you to leave out <code>noscript</code>
tags. Include a link to <a href="swfobject.html?detectflash=false">bypass the detection</a> if you wish.
</div>

<script type="text/javascript">
// <![CDATA[

var so = new SWFObject("http://www.iamsamsmith.com/htmlvideo/video.swf", "video", "300", "300", "9", "#FF6600");
so.addParam("quality", "high");
so.addParam("wmode", "transparent");
so.write("flashcontent");

// ]]>
</script>

Im having trouble because the swf needs other swf and flv files, and neither are in the same directory as the html page, nor is the main swf - the swf is just not showing up.

i dont want to duplicate the swf and its corresponding flash files if theyre already hosted once by this client - the swf i want to include is at www.iamsamsmith.com/htmlvideo/video.swf - but this relies on lots of other swfs and flvs to function. does anyone have a solution, or is the problem actually something else?

A copy the swf files and all associated files can be downloaded at:

www.ameliealden.com/vnm/samsmith/flash.zip

Would be very very grateful of some help here
smile.gif


Emma
 
Hi Emma,

Looks like you're using an older version of SWF Object, head over to swfobject - Project Hosting on Google Code and you can do this with 2.2:

HTML:
<script type="text/javascript">

var flashvars = {
	other_swf: "http://www. mysite.com/other.swf",
	other_flv: "http://www.mysite.com/other.flv" 
};
var params = { quality: "high", wmode: "transparent" };
var attributes = {};

swfobject.embedSWF("http://www.iamsamsmith.com/htmlvideo/video.swf", "video", "300", "300", "9.0.0", null, flashvars, params, attributes);

</script>

Then in Flash you can load the flashvars dynamically. In ActionScript 3 you do (AS2 will be slightly different):

HTML:
var other_swf:String = loaderInfo.parameters.other_swf;

With this technique you can use the same SWF to load different content. Hope that solves the problem!
 
wow thanks very much for the help but im afraid im a bit confused about it.. im pretty sure i did download version 2 as i checked the download history and saw swfobject_2_2.zip - i wasnt sure how to check for sure, so i downloaded it again and just pasted swfobject.js into my js directory.

the code i currently have is:


<script type="text/javascript">
// <![CDATA[

var so = new SWFObject("http://www.iamsamsmith.com/htmlvideo/video.swf", "video", "300", "300", "9", "#FF6600");
so.addParam("quality", "high");
so.addParam("wmode", "transparent");
so.write("flashcontent");

// ]]>
</script>

and simply the inclusion of the external js file in my head section - it doesnt really match any part you wrote above so im not sure where to paste the snippet in, exactly what other flvs and swfs within this swf are linked to/needed, and i definitely dont know how to add the actionscript ..is it poss you show me? the flash files are above in the zip i attached to my orginal post.

sorry i am a complete newbie with flash..:(

Emma
 
Back
Top