View Full Version : easy: variables from query string
thankyou
09-10-2002, 05:15 PM
It's my understanding that if I pass variables in a query string, I can just start using them at the root.
I got this in the html file that contains my swf:
<PARAM NAME=movie VALUE="main.swf?vary=bob">
<EMBED src="main.swf?vary=bob" swliveconnect = "true" NAME="sean_dungan_2"></EMBED>
And then on the first frame of my movie I say:
_root.testText.text = vary;
But it doesn't work.
There IS a dynamic textfield on the root with an instance name of testText.
I am being really thick about something.
Also if you know of a well written thread or tutorial for a concise, flexible, tested method for opening, centering, sizing a pop up and then passing it a variable telling it where to start, without resorting to php or asp, then I would love to know about it.
Thanks a million,
Charlie
JerryScript
09-10-2002, 11:58 PM
So long as your textfield is in the main movie (_root), just use this syntax:
testText=vary;
Jerry
thankyou
09-11-2002, 01:41 AM
Thank you but I am obviously still getting something wrong.
Besides the <param> tag and the <embed> tag, is there anything else involved?
I know it's some stupid little thing. Where else might I me going wrong?
charlie
JerryScript
09-12-2002, 12:29 AM
You are you using the object tag around the param and embed tags?
thankyou
09-12-2002, 12:57 AM
Yes. I'm leaving everything in that is the default html that flash generates.
I've been trying to use FlashVars now. But it's still not working.
The FlashVars way is simply to add:
<PARAM NAME=FlashVars VALUE="foo=bob">
after the opening <object> tag and
FlashVars="foo=bob" inside the embed tag.
Then I'm opening the html file in IE or ColdFusion studio. It doesn't pass.
I posted a tiny, example if you are willing to download and straighten me out.
http://www.CharlieCampbell.com/testText/test.fla
http://www.CharlieCampbell.com/testText/test.html
This has hung me up since yesterday.
Thanks a million!
JerryScript
09-13-2002, 12:30 AM
I couldn't open your fla in flash 5, or convert it to php with a compiler I have (said bad file). What are you using to author?
thankyou
09-13-2002, 09:56 AM
Thanks a million. I'm using mx. Sorry I didn't say so. I've got it about half-way straightend out in just the last couple hours. My problem was chiefly that I didn't know about the little input box in the text panel labeled "var:" the variable can be filled in there and it works. I think I can also just go: testText.text = vary; but by the time I posted this thing I was in a mindset of proving to myself that it wasn't working. Instead of trying to solve the problem.
My new problem is that it doesn't download the variable quick enough to tell Flash which frame to start on. So I've switched to using FlashVars and writing the html dynamically. Which has led me to an even newer problem that if I jump to a specific frame in the movie, my xml doesn't download, because it's downloaded in the first frame. So, you know, I've got problems.
Thank you so much for your time.
Charlie
JerryScript
09-14-2002, 12:36 AM
To make flash wait for the values to load, use three frames:
1) load the variables
2) do nothing
3) AS=if frame 1 loaded goto frame whatever else previous frame
Jerry
thankyou
09-14-2002, 03:51 AM
That sounds logical. I've worked it out this way, which seems to be working so far.
I set up a variable:
allReady = 0;
Then as both my xml objects are loaded I added 1 to allReady
And then on the first frame I already had an "on(enterFrame)" event that was doing several things for me. So to that I just added:
if(allReady>1 && _root.foo != undefined ){//if both xml objects are populated
_root.gotoAndStop(_root.foo);//then goto the page number that is in foo.
if(_root.foo == this._currentframe){
_root.foo = undefined;
}
}
If it this fails on further testing I'll switch to your way. But for now it's in place so out of laziness I'm going to leave it unles it causes trouble.
Thank you very much for you help. I really appreciate it.
Cheers,
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.