Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-25-2007, 03:25 PM   PM User | #1
tomyknoker
Regular Coder

 
Join Date: Mar 2006
Posts: 459
Thanks: 3
Thanked 0 Times in 0 Posts
tomyknoker is an unknown quantity at this point
Flash Vars not working...

Hi all,

I am trying to use Flash Vars to pass images, I have this code on the first frame of my timeline

Code:
var a = myVar.slice(0,myVar.indexAt("#")); //the string before the # character
var b = myVar.slice(myVar.indexAt("#")+1,myVar.length); //the string after the # character
randomImageURL =  a+(random(6)+1)+b;//random image 1-6
target_mc.loadMovie(randomImageURL);
debugger = FlashVars.indexOf("#")+"/"+FlashVars.length+"="+FlashVars;
The idea is that it should load 1 of 6 random images, the developer wants to just be able to add say 'images/whatevername'5'.jpg' so that they can use the file anywhere. But the Flash Vars aren't working correctly I have been able to get it to work with myURL, but not with the images. This is the code on my HTML file, if anyone could help would be greatly appreciated

Code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="745" height="110" id="variable_url" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="heardit_header.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="myURL=http://www.apple.com&myVar=images/#.jpg" />
<embed src="heardit_header.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="variable_url" FlashVars="myURL=http://www.apple.com&myVar=images/#.jpg" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
When I run the file, and look in my activity viewer of my browser I can see the error which is it can't find an image which it is looking for but the directory is all screwed up it is looking for /images/#.jpg4mages/#.jpg really it should be something like images/image4.jpg Any ideas anyone?
tomyknoker is offline   Reply With Quote
Old 03-29-2007, 01:55 PM   PM User | #2
StupidRalph
Senior Coder

 
Join Date: Mar 2003
Location: Atlanta
Posts: 1,037
Thanks: 14
Thanked 30 Times in 28 Posts
StupidRalph is on a distinguished road
Seems to me that you are over complicating this too much.

Are you against using SWFObject? I'd recommend it against using the FlashVars parameter as its a lot cleaner and a better way to embed flash movies in my opinion.
__________________
Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.
StupidRalph is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:06 AM.


Advertisement
Log in to turn off these ads.