Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-08-2006, 03:50 PM   #1
mattress
actionscript defies me
 
mattress's Avatar
 
Join Date: Feb 2006
Location: Milwaukee, WI
Posts: 28
Send a message via AIM to mattress
Default getting embed parameters

is it possible to retrieve with actionscript url parameters that are passed in the HTML object or embed tags?

for example:
Code:
...
<param name="movie" value="flash.swf?clickTag=http://www.google.com">
  <embed src="flash.swf?clickTag=http://www.google.com" quality=high ...
is it possible to get the url parameters that are coming along with the swf filename?

What if you don't know the names of the parameters that might be passed? Is there a way to get all parameters and sort through them?
mattress is offline   Reply With Quote
Old 09-08-2006, 03:57 PM   #2
Kraken
Flash beneath the fathoms
 
Join Date: Apr 2001
Location: Kansas City
Posts: 678
Default

yes. Those variables are available to flash as soon as the flash piece finishes loading. But, they are not flagged as coming from the URL, so you would have to loop through all the variables on your main timeline to see what you've got.

Also, please look up FlashVars (search here or google). It's a little more tidy way of including variables into flash.
__________________
The coolest website ever!
Visit my friend Ray's site.
Kraken is offline   Reply With Quote
Old 09-08-2006, 04:22 PM   #3
mattress
actionscript defies me
 
mattress's Avatar
 
Join Date: Feb 2006
Location: Milwaukee, WI
Posts: 28
Send a message via AIM to mattress
Default

Quote:
Originally Posted by Kraken
yes. Those variables are available to flash as soon as the flash piece finishes loading. But, they are not flagged as coming from the URL, so you would have to loop through all the variables on your main timeline to see what you've got.

Also, please look up FlashVars (search here or google). It's a little more tidy way of including variables into flash.
Okay great!
so how do I loop through the variables in my main timeline?

FlashVars sounds nice, unfortunately I'm not the one writing the HTML for the flash and we work with lots of different vendors so that doesn't work for me.
mattress is offline   Reply With Quote
Old 09-08-2006, 04:29 PM   #4
Kraken
Flash beneath the fathoms
 
Join Date: Apr 2001
Location: Kansas City
Posts: 678
Default

try a for...in loop. Look it up in the dictionary.

If you can't specify they use FlashVars, can you not specify a variable name(s)? Or even a sequence of variables you need to check for.
__________________
The coolest website ever!
Visit my friend Ray's site.
Kraken is offline   Reply With Quote
Old 09-08-2006, 04:57 PM   #5
mattress
actionscript defies me
 
mattress's Avatar
 
Join Date: Feb 2006
Location: Milwaukee, WI
Posts: 28
Send a message via AIM to mattress
Default

yeah the main problem I have is the variable being called "clickTag" or "clickTAG" (notice CAPS difference) depending on the vendor. So my actionscript code needs to have an action with the correct variable, so I was thinking instead of having to make two versions of the same file and then make sure the right version gets sent to the right vendor, just figure out some bit of AS so it will work no matter which variable name they use.
mattress is offline   Reply With Quote
Old 09-08-2006, 05:21 PM   #6
deadbeat
Registered User
 
Join Date: Feb 2001
Location: vancouver
Posts: 2,219
Default

If you know that the variable is going to be one of those two names, you could just check which one is undefined:
ActionScript Code:
if(clickTag != undefined){ var tag=clickTag; } else if(clickTag==undefined && clickTAG !=undefined){ var tag=clickTAG; } else if(clickTag==undefined && clickTAG==undefined){ trace("no click tag variable was passed in"); }
K.
deadbeat is offline   Reply With Quote
Old 09-08-2006, 05:24 PM   #7
Kraken
Flash beneath the fathoms
 
Join Date: Apr 2001
Location: Kansas City
Posts: 678
Default

Oh! Well, that's easy:
ActionScript Code:
var realClick:String; if (clickTag) {   realClick = clickTag; } else if (clickTAG) {   realClick = clickTAG; } if (realClick != undefined) {   //do something. }

edit: or what deadbeat said!
__________________
The coolest website ever!
Visit my friend Ray's site.
Kraken is offline   Reply With Quote
Old 09-08-2006, 05:44 PM   #8
mattress
actionscript defies me
 
mattress's Avatar
 
Join Date: Feb 2006
Location: Milwaukee, WI
Posts: 28
Send a message via AIM to mattress
Default

Wonderful!

Thank you both so much for all your help! You've saved me from many future headaches!
mattress is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
using html tags with embed fonts lpx Flash 8 General Questions 12 11-10-2008 02:20 AM
How to load flash EMBED tags and movies with external script cybered HTML and JavaScript 1 09-23-2005 10:52 AM
Embed Fonts with textField formatting orangetree ActionScript 2.0 4 02-10-2005 04:32 PM
Embed Fonts - what's the right way! PEF Components 3 11-18-2004 03:02 PM
wmode embed parameters and how they effect mouse movement detection needMoreCowBell ActionScript 2.0 2 09-28-2004 03:43 PM


All times are GMT. The time now is 07:46 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.