Variables in JS/HTML not getting passed to SWF on 1struntime.

This is a discussion on Variables in JS/HTML not getting passed to SWF on 1struntime. within the Macromedia Flash forums in Adobe Tools category; I'm having an issue with getting variables to pass from a query string, to JS/HTML, to Flash on 1st runtime; 2nd, 3rd, ..., Nth runtimes work fine. Here's a the step-by-step explanation of how I am doing this: [bullet]Starting out on the http://www.deforestarchitects.com/pages/clients.htm page, if you click on one of the "See their project" links, it should take you to a project page that hosts a SWF file that will then display the correct, corresponding project for that client.[/bullet] [bullet]When the "See their project" link is clicked, it will then direct you to a page, but appending a variable in ...

Go Back   Application Development Forum > Adobe Tools > Macromedia Flash

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-10-2008, 01:00 PM
JeremySeda
Guest
 
Default Variables in JS/HTML not getting passed to SWF on 1struntime.

I'm having an issue with getting variables to pass from a query string, to
JS/HTML, to Flash on 1st runtime; 2nd, 3rd, ..., Nth runtimes work fine.
Here's a the step-by-step explanation of how I am doing this:

[bullet]Starting out on the
http://www.deforestarchitects.com/pages/clients.htm page, if you click on one
of the "See their project" links, it should take you to a project page that
hosts a SWF file that will then display the correct, corresponding project for
that client.[/bullet]
[bullet]When the "See their project" link is clicked, it will then direct you
to a page, but appending a variable in a query string (i.e.,
http://www.deforestarchitects.com/pa...ject=fairhaven). [/bullet]
[bullet]This variable is then passed to the object, param and embed tags by
appending document location search after the *.swf in the param value and embed
src properties (see attached code).[/bullet]
[bullet]When Flash acquires this variable, it will then use it in a
conditional statement on Frame 10 of the timeline to display the appropriate
section of the Flash movie (see 2nd attached Code).[/bullet]
[bullet]So, upon entering this projects page, the Fairhaven project should be
displayed (using the URL/example from the 2nd bullet). However, it only works
if you go back to the previous page and click on the same link. What
gives?[/bullet]

If anyone has run into similar problems, I'd love to hear what you did to
solve you issue. I appreciate any advice or help on this issue. Many thanks!

[hr]

<object>, <param> and <embed> tags:

document.write('<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
rsion=7,0,19,0" width="803" height="457">');
document.write('<param name="movie"
value="flash/remodels.swf'+document.location.search+'">');
document.write('<param name="quality" value="high">');
document.write('<embed src="flash/remodels.swf'+document.location.search+'"
quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="803" height="457">');
document.write('</embed>');
document.write('</object>');

Conditional Statement in Flash:

if(_root.project=="zipperhouse"){
gotoAndStop("zipperhouse");
trace("zipperhouse variable received");
} else if (_root.project=="fairhaven"){
gotoAndStop("fairhaven");
trace("fairhaven variable received");
} else if (_root.project=="tangletown"){
gotoAndStop("tangletown");
trace("tangletown variable received");
} else if (_root.project=="thenest"){
gotoAndStop("thenest");
trace("thenest variable received");
} else {
play();
}

Reply With Quote
  #2  
Old 09-10-2008, 01:06 PM
JeremySeda
Guest
 
Default Re: Variables in JS/HTML not getting passed to SWF on1st runtime.

Bullets in this forum are useless!!! Here's my original post again without
bullets:
[hr]
I'm having an issue with getting variables to pass from a query string, to
JS/HTML, to Flash on 1st runtime; 2nd, 3rd, ..., Nth runtimes work fine. Here's
a the step-by-step explanation of how I am doing this:

- Starting out on the http://www.deforestarchitects.com/pages/clients.htm
page, if you click on one of the "See their project" links, it should take you
to a project page that hosts a SWF file that will then display the correct,
corresponding project for that client.

- When the "See their project" link is clicked, it will then direct you to a
page, but appending a variable in a query string (i.e.,
http://www.deforestarchitects.com/pa...ject=fairhaven).

- This variable is then passed to the object, param and embed tags by
appending document location search after the *.swf in the param value and embed
src properties (see attached code).

- When Flash acquires this variable, it will then use it in a conditional
statement on Frame 10 of the timeline to display the appropriate section of the
Flash movie (see 2nd attached Code).

- So, upon entering this projects page, the Fairhaven project should be
displayed (using the URL/example from the 2nd bullet). However, it only works
if you go back to the previous page and click on the same link. What gives?

If anyone has run into similar problems, I'd love to hear what you did to
solve you issue. I appreciate any advice or help on this issue. Many thanks!

[hr]


<object>, <param> and <embed> tags:

document.write('<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
rsion=7,0,19,0" width="803" height="457">');
document.write('<param name="movie"
value="flash/remodels.swf'+document.location.search+'">');
document.write('<param name="quality" value="high">');
document.write('<embed src="flash/remodels.swf'+document.location.search+'"
quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="803" height="457">');
document.write('</embed>');
document.write('</object>');

Conditional Statement in Flash:

if(_root.project=="zipperhouse"){
gotoAndStop("zipperhouse");
trace("zipperhouse variable received");
} else if (_root.project=="fairhaven"){
gotoAndStop("fairhaven");
trace("fairhaven variable received");
} else if (_root.project=="tangletown"){
gotoAndStop("tangletown");
trace("tangletown variable received");
} else if (_root.project=="thenest"){
gotoAndStop("thenest");
trace("thenest variable received");
} else {
play();
}

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 12:40 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.