RE: [Flashcoders] How to access var passed in URL from AS2 class
No problem.. SWF Object is a GREAT way to embed your flash movies into HTML (or whatever).. It allows for a lot for other stuff as well.. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Nate Beck Sent: Tuesday, December 16, 2008 11:17 AM To: Flash Coders List Subject: Re: [Flashcoders] How to access var passed in URL from AS2 class 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 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: > > > var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", > "#336699"); > so.addVariable("variable1", getQueryParamValue("variable1")); > so.addVariable("variable2", getQueryParamValue("variable2")); > so.write("flashcontent"); > > > > 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 >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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] How to access var passed in URL from AS2 class
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 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: > > > var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", > "#336699"); > so.addVariable("variable1", getQueryParamValue("variable1")); > so.addVariable("variable2", getQueryParamValue("variable2")); > so.write("flashcontent"); > > > > 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 >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
RE: [Flashcoders] How to access var passed in URL from AS2 class
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: var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699"); so.addVariable("variable1", getQueryParamValue("variable1")); so.addVariable("variable2", getQueryParamValue("variable2")); so.write("flashcontent"); 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 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
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 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
Re: [Flashcoders] How to access var passed in URL from AS2 class
I think you're passing the vars to the html page, but not the swf. You can use flashvars or just append a querystring to the swf url and you should be able to trace them Cheers Juan Pablo Califano. 2008/12/16 Ali Drongo > 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