Hey that's cool, I didn't know that existed.  Thanks whispers!
-- 

Cheers,
Nate
----------------------------------------
http://blog.natebeck.net

On Tue, Dec 16, 2008 at 9:08 AM, whispers <whispers...@hotmail.com> wrote:

> You can also use SWF Object to embed the movie...  I believe you have the
> options or grabbing vars form the query string.
>
> Makes it quite easy:
>
>  The SWFObject script also comes with an extra function which allows you to
> pull variable values from the url string. An example is you have a url that
> looks like this:
> http://www.example.com/page.html?variable1=value1&variable2=value2. Using
> the function getQueryParamValue() you can easily pull these values from the
> url and then pass them into your Flash movie. Here is an example, we'll
> assume that the url looks like the above example:
>
> <script type="text/javascript">
>   var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8",
> "#336699");
>   so.addVariable("variable1", getQueryParamValue("variable1"));
>   so.addVariable("variable2", getQueryParamValue("variable2"));
>   so.write("flashcontent");
> </script>
>
>
> Take care
>
> -----Original Message-----
> From: flashcoders-boun...@chattyfig.figleaf.com
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Nate Beck
> Sent: Tuesday, December 16, 2008 10:35 AM
> To: Flash Coders List
> Subject: Re: [Flashcoders] How to access var passed in URL from AS2 class
>
> http://www.mydomain.com/index.html?passedPage=180
> This won't pass into flash as a flashvar.  You have a few options though.
>
>   - Use Javascript to grab the query string and then write it in as a
>   flashvar or query string to the swf. (ex: MySwf.swf?passedPage=180"
>   - Make an ExternalInterface call a javascript function that returns the
>   variables to you.
>   - Auto populate the flashvar with a serverside language: php, cf, jsp...
>   etc....
>   - If you're using Flex, look into BrowserManager.
>
> Cheers,
> Nate
>
> On Tue, Dec 16, 2008 at 8:12 AM, Ali Drongo <alidro...@googlemail.com
> >wrote:
>
> > Hi there, I'm passing a variable to my swf through a query string like
> > this:
> >
> > htp://www.mydomain.com/index.html?passedPage=180
> >
> > I have my main AS2 class that is the root class and have tried to
> > access the variable like this:
> >
> >                trace("====PASSPAGE SET:"+this["passedPage"]);
> >                trace("====PASSPAGE SET:"+_level0.passedPage);
> >                trace("====PASSPAGE SET:"+_root.passedPage);
> >
> > each of these traces returns undefined.
> >
> > I am compiling this SWF using MTASC which means I can't write the var
> > as passedPage as MTASC says this is an unknown variable.
> >
> > I have tried declaring passedPage as a public variable within the
> > class though I still can't access it.
> >
> > Any suggestions much appreciated.
> >
> > Thanks
> > Ali
> >
> >
> > _______________________________________________
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to