-
please help me pass a variable
I have an .swf with a few buttons. each button pops open a new html page with another .swf embeded in it. depending on which button is pushed, i need to pass a variable from the original flash file to the one that opens in the new html window.
I was trying the "myFile.swf?myNumber=26" thing to get the variable from html to the second SWF, but how do I use the first flash file to set that variable? Thanks
-
-
so, from within popup1.swf would I retrieve the variable in mainMovie.swf by using something like:
var myNumber = movie.GetVariable("/mainMovie.swf:myNumber");
i'm not sure I understand
-
I checked out the link, but I don't understand what to do with the information. Could someone explain in english what to do here. Do I need to somehow refference the original html window, or the original .swf?
-
Senior Member
To send a variable to another swf that is not embdded in html just add the variable to the end of the url string
getURL("myFile.swf?myNumber=26");
The variable will automatically ne accessible in the receiving swf file.
To send a variable to a swf embedded in html , the embed code has to be made with some javasvript for it to pass the variable to the swf.
PHP Code:
<script language="JavaScript">
document.write ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
+'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" '
+'WIDTH=750 HEIGHT=500> <PARAM NAME=movie VALUE="knock.swf'+document.location.search+'">'
+'<PARAM NAME=quality VALUE=high>'
+'<EMBED src="knock.swf' +document.location.search+'" '
+'quality=high WIDTH=750 HEIGHT=500 '
+'TYPE="application/x-shockwave-flash"></EMBED></OBJECT>')
</script>
Last edited by pellepiano; 10-12-2003 at 06:34 PM.
-
getURL("myFile.swf?myNumber=26");
since the file is an swf instead of html, is there no longer a way to control the size of the new window, scrollbars etc...?
-
for instance, the following _doesn't_ work:
getURL ("javascript:newwin('file2.swf?mynumber=26',width= 320,height=240)");
-
ok, figured it out. Thanks for all your help.
-
Senior Member
Tis forum changed my code. I changed it back in the previous post.
-
thanks Pellepiano. does that code go in the first html file, or the one that pops up?
-
Senior Member
In the html that should recieve the variables.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|