| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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="clsid 27CDB6E-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(); } |
|
#2
| |||
| |||
| 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="clsid 27CDB6E-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(); } |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.