Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

In serious need of instructions for passing variables from HTML

Status
Not open for further replies.

fedtrain

Instructor
Jun 23, 2004
142
US
Hello,
I have a movie that the requirements changed on. They want the movie to open up based on what link is pressed. So I need to pass a variable into the movie that can then be evaluated.

There are about three different articles on the internet that have NOT helped...even the Adobe site. There isn't much here except for Bill saying it was possible but not going into the issue.

Can anyone point me to links that have code that work and are updated to the new <noscript> stuff? That seems to mess it all up.


"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Ok, that was next to useless. So far I have NOT been happy with Adobe's documentation.

What the heck is "Foo" supposed to stand for? Do I need the text field name? Do I use the dot syntax? Do I use the movie name?

Here is what I have...
Code:
toolWindow.document.write('<object classid="clsid:D27CDB6E-
    AE6D-11cf-96B8-444553540000" ')
toolWindow.document.write ('codebase="[URL unfurl="true"]http://download.[/URL]
    macromedia.com/pub/shockwave/cabs/flash/swflash.cab#
    version=7,0,19,0" width="400" height="250" title="testmovie">')
toolWindow.document.write('<param name="movie" value="passVar.swf" />')
toolWindow.document.write('<param name="quality" value="high" />')
toolWindow.document.write('<param name="FlashVars value = "passVar.swf = Hello"> ')
toolWindow.document.write('<embed src="passVar.swf" quality="high" pluginspage="[URL unfurl="true"]http://www.macromedia.com/go/getflashplayer"[/URL] 
    type="application/x-shockwave-flash" width="400" 
    height="250"')
toolWindow.document.write(' FlashVars = "passVar.swf = Hello">')
toolWindow.document.write ('swLiveConnect = "true">')
toolWindow.document.write ('</embed>')

This didn't work.

"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Here is the page that loads it....but it seems that once out there the swf blows up. It loads here from local folder, not sure why it is dying out there.


Ultimately each of the links would pass a different variable. (this is all test as not to mess up the real file)

The fla is there too....at


"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Sorry, I cannot get to your example from work...infact I cannot even get to my example...this stinks. Info security firewall has blocked your site.

I probably won't get to look at it till tonight.

But, I am actually needing to open the flash in a second popup window. The page that will house the link has no room for the file...so it has to be presented in a new window...which is why I am using the document.write in my code of the link

So...if you have time...two things I am stuck on...how to I target the text feild with the flashvar...and how to I tell flash to use that variable.

(If your sample has all the code, then I will try to get there tonight from home.)

"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Hello oldnewbie....do you have the code for what is in the flash file?

I have the source for the webpage and will look at it later when I get to work.

Thanks


"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
But that's not Flashvars, it's Flash methods...

And I guess it would be different, if the Flash movie was embedded in another browser window. Would it be a normal browser window (getURL) or would it be a popup?

Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
popup with a set size and none of the extras (toolbar, status, address, etc.)

The problem is there is no room in the current page's layout for the movie. It has to pop up.

(Thanks for you patience on this.)

If we get this worked out, I would be willing to write up an FAQ or something 'cause the current stuff on the web is seriously lacking.

"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Yep....that looks like what I am aiming at.

Thanks for the help so far.

"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Hey oldnewbie,
Got the file, but I cannot see anywhere in FLASH where you are calling the variable. I do not understand how it is ending up in the text box.

This is the only code I can find, and doesn't make sense to me.
Code:
//myText.text = flashvar;
flashvar = again;
stop();

Sorry to be a pain but I have to fully understand what I am implementing since I will be the one who will support changes, and I have to teach two other users that know no AS.


"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Ok oldnewbie,
I got around the files thing...i am hazarding a guess that you send an earlier version of the FLA than of the swf...because every time i tried to look at the fla it would kill the passing of variables.

I realized you were setting the text box to the variable in the grey screen down below the stage, not in actionscript.

So I have figured out what you were planning...but I still have the issue of avoiding the black box/activate issue. The sample just used the old object/embed tags.

I am going to start another thread since I think I can fine tune the question at this point...

"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Oooops! Sorry about that! I probably did send you an uncleaned version of the .fla.

But anyways, I am passing the variable through AS but using the Var box variable within the textfield's properties, and you should correct it to...

flashvar = htmlvar;

But you can eliminate that line and clear the Var box variable in the textfield, and use what you had before...

myText.text = htmlvar;

Works just as well.

Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top