-
Sending a variable to embedded flash file
I'm trying to do something that seems like it would be a pretty simple thing to do, but I've been searching for days, and can't find a good solution.
What I need to do is pass a variable into flash.
I've had success doing this by just adding the variable to the end of the embedded SWF URL (.../mymovie.swf?variable=value), but what I need is the ability to send the swf variables when certain links are clicked, without the page refreshing.
I'm guessing this has to be done somehow with a javascript onClick function.
I've looked into using externalInterface, but it seems overly complicated for this application.
If anyone could help, or point me in the right direction, I would really appreciate it. Thanks!
-
Prid - Outing
Where do you want to send the variables?
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
Just to the root of the swf file, to the variable "target"
So in the html page, a button pressed would send "whatever information" to variable "target" in embedded swf file.
Hopefully I'm making sense.
-
.
Hi
You should look into this command.
Actionscript Code:
<a href='asfunction:sendvariable,myVariable'>"link"</a>
so in flash have a function called "sendvariable" or whatever you want to call it
which does alll the fancy things you wish it to.
"myVariable" will be pulled from your html page using a text box or whatever you wish to use.
Good luck
-
Thanks for the reply fruit beard,
That solution looks like it would work awesome if I were placing the link within an html rendered text box within flash, but I need the link outside of flash completely.
Unless there's another way to make asfunction work outside of flash?
Thanks for the help!
-
Prid - Outing
You'll have to learn ExternalInterface
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
Tags for this Thread
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
|