If you are using a static HTML page to serve up the SWF file, then you
need to manually specify the params as flashVars variables in the
wrapper. For example, to pass the name Nick Danger you might do this:

<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflas
h.cab#version=9,0,0,0' width='500' height='500'>
        <param name='flashVars' value='firstname=Nick&lastname=Danger'>
        <param name='src' value='FlashVarsValues.mxml.swf'>
                <embed
pluginspage='http://www.macromedia.com/go/getflashplayer' width='500'
height='500' 
                flashVars='firstname=Nick&lastname=Danger'
src='FlashVarsValues.mxml.swf'/>
</object>

If you are using something like JSP to serve up the SWF file, then you
can use expressions to set the values of the flashVars in the wrapper:

<%
        String fName = (String) request.getParameter("firstname");
        String lName = (String) request.getParameter("lastname");
%>
...
<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflas
h.cab#version=9,0,0,0' width='500' height='500'>
        <param name='flashVars' value='firstname=<%= fName
%>&lastname=<%= lName %>'>
        <param name='src' value='FlashVarsValues.mxml.swf'>
                <embed
pluginspage='http://www.macromedia.com/go/getflashplayer' width='500'
height='500' 
                flashVars='firstname=<%= fName %>&lastname=<%= lName %>'
src='FlashVarsValues.mxml.swf'/>
</object>

If you have the FDS server, then query string params are converted to
flashVars for you.

Hth,

Matthew J. Horn
Flex docs


> -----Original Message-----
> From: flexcoders@yahoogroups.com 
> [mailto:[EMAIL PROTECTED] On Behalf Of yaagcur
> Sent: Sunday, March 05, 2006 1:39 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Flex and URL variables
> 
> http://livedocs.macromedia.com/flex/20beta1/docs/00001300.html
> 
>  covers this topic
> However, although it works if you pass the URL as a .swf, if 
> you try .html (which is presumably what you want) then it 
> fails Hope someone can explain how to do this in Flex 2.0 as 
> it would be a great feature
> 
> Andy Clark
> 
> --- In flexcoders@yahoogroups.com, "Gordon Smith" <[EMAIL PROTECTED]> wrote:
> >
> > In Flex 2, the Application instance has a parameters property with 
> > name/value pairs for the URL parameters and FlashVars.
> > 
> >  
> > 
> > So in an Application script you would just access parameters.number 
> > and it would be 3.
> > 
> >  
> > 
> > From other scripts, you would use
> > Application.application.parameters.number.
> > 
> >  
> > 
> > - Gordon
> > 
> >  
> > 
> > ________________________________
> > 
> > From: flexcoders@yahoogroups.com 
> [mailto:[EMAIL PROTECTED] 
> > On Behalf Of JesterXL
> > Sent: Thursday, March 02, 2006 2:55 PM
> > To: flexcoders@yahoogroups.com
> > Subject: Re: [flexcoders] Flex and URL variables
> > 
> >  
> > 
> > Flex 1.5 or 2?
> > 
> >  
> > 
> > ----- Original Message -----
> > 
> > From: Jonathan Miranda <mailto:[EMAIL PROTECTED]>
> > 
> > To: flexcoders@yahoogroups.com
> > 
> > Sent: Thursday, March 02, 2006 5:49 PM
> > 
> > Subject: [flexcoders] Flex and URL variables
> > 
> >  
> > 
> > Alright, I've done this with Flash before but I'm wondering how 
> > similar it is.
> > 
> > Let's say I start my app @ http://mysite.com/index.mxml?number=3
> > 
> > What's the easiest way to get that 3 into a variable in Flex? Using 
> > FlashVars in the embed/object tags and then somehow do 
> > mx.core.application.Application.number as my variable?
> > 
> > _________________________________________
> > 
> > Jonathan Miranda
> > 
> > Flexible Master of the Web
> > 
> > "Try not to become a man of success, but a man of value." - Albert 
> > Einstein
> > 
> > HealthGrades <http://www.healthgrades.com/> : Guiding America to 
> > Better
> > Healthcare(tm)
> > 
> > NASDAQ: HGRD
> > 
> > w  (720) 963-3832
> > 
> > c  (707) 761-0868
> > 
> > [EMAIL PROTECTED] 
> > 
> > _________________________________________
> > 
> > The message contains confidential and/or legally privileged 
> > information and is intended for use only by the indicated 
> addressee.  
> > If you are not the named addressee you should not disseminate, 
> > distribute, or copy this e-mail. Please notify the sender 
> immediately 
> > by e-mail if you have received this e-mail by mistake and 
> delete this e-mail from your system.
> > E-mail transmissions cannot be guaranteed to be secure or 
> error-free 
> > as information could be intercepted, corrupted, lost, 
> destroyed,arrive 
> > late or incomplete, or contain viruses. The sender 
> therefore does not 
> > accept liability for any errors or omissions in the 
> contents of this 
> > message which arise as a result of e-mail transmission. If 
> > verification is required please request a hard-copy version.
> > 
> >  
> > 
> > 
> > 
> > --
> > Flexcoders Mailing List
> > FAQ: 
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives:
> > http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > 
> > 
> > 
> > 
> > SPONSORED LINKS
> > 
> > Web site design development
> > 
> <http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=We
> > b+
> > 
> site+design+development&w2=Computer+software+development&w3=Software+d
> > site+design+es
> > 
> ign+and+development&w4=Macromedia+flex&w5=Software+development+best+pr
> > ign+and+ac
> > tice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ>
> > 
> > Computer software development
> > 
> <http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=
> > We
> > 
> b+site+design+development&w2=Computer+software+development&w3=Software
> > b+site+design++d
> > 
> esign+and+development&w4=Macromedia+flex&w5=Software+development+best+
> > esign+and+pr
> > actice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw>
> > 
> > Software design and development
> > 
> <http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w
> > 1=
> > 
> Web+site+design+development&w2=Computer+software+development&w3=Softwa
> > Web+site+design+re
> > 
> +design+and+development&w4=Macromedia+flex&w5=Software+development+bes
> > +design+and+t+
> > practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ>
> > 
> > Macromedia flex
> > 
> <http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+desig
> > n+ 
> > 
> development&w2=Computer+software+development&w3=Software+design+and+de
> > ve
> > 
> lopment&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s
> > =1
> > 66&.sig=OO6nPIrz7_EpZI36cYzBjw>
> > 
> > Software development best practice
> > 
> <http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practic
> > e& 
> > 
> w1=Web+site+design+development&w2=Computer+software+development&w3=Sof
> > tw
> > 
> are+design+and+development&w4=Macromedia+flex&w5=Software+development+
> > are+design+and+be
> > st+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw>
> > 
> >  
> > 
> >  
> > 
> > ________________________________
> > 
> > YAHOO! GROUPS LINKS
> > 
> >  
> > 
> > *    Visit your group "flexcoders
> > <http://groups.yahoo.com/group/flexcoders> " on the web.
> >       
> > *    To unsubscribe from this group, send an email to:
> >      [EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>
> >       
> > *    Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> > Service <http://docs.yahoo.com/info/terms/> . 
> > 
> >  
> > 
> > ________________________________
> >
> 
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to