Hi Jesse,

I think, even in Flex 1.5 it was quite straight forward. You just need to declare public vars in MXML and then you can pass those vars through query string. F.ex.:


##querystring.mxml

<mx:Application xmlns:mx=" http://www.macromedia.com/2003/mxml">
    
<mx:Script>
import mx.controls.Alert;

public var name:String = "";

private function onAppInit()
{
    Alert.show(name);
}
</mx:Script>

</mx:Application>


Usage:

http://server/querystring.mxml?name=Abdul


It would show the passed value in Alert...


Kevin and Manish deep linking was useful when you want to save the state of application in form of rest url. Or re initialize to same state from the rest URL...

FYI! Patent has been filed for this idea :)

-abdul




On 3/3/06, JesterXL <[EMAIL PROTECTED] > wrote:
Don't know the Flex 2 way.
 
For Flex 1.5, I used Kevin Lynch's deep linking code.
 
 
My implementation:
 
Basically, _javascript_ will set vars for you and you can use Kevin's class to get vars.  The are at least 2 other implementations I've seen on the net, but this one worked, so I stuck with it.
 
So:
 
codeid = browserState.getValue("codeid");
 
Allows me to get the codeid value from this url:
 
And thus I can do stuff with that variable.  If I want to update the browser's URL to reflect the "state" of the app:
 
browserState.setValue("codeid", posts_lb.selectedItem.id);
 
You can bookmark these links too.  There was something funky with Firefox where you come from an existing bookmark or something, but whatever it was was an extreme use case (sort of).
 
 
 
 
----- Original Message -----
Sent: Thursday, March 02, 2006 6:02 PM
Subject: RE: [flexcoders] Flex and URL variables

Dos

 

 

_________________________________________

Jonathan Miranda

Flexible Master of the Web

"Try not to become a man of success, but a man of value." - Albert Einstein

HealthGrades: Guiding America to Better Healthcare™

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.


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of JesterXL
Sent: Thursday, March 02, 2006 3:55 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex and URL variables

 

Flex 1.5 or 2?

 

----- Original Message -----

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 : Guiding America to Better Healthcare™

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 Computer software development Software design and development
Macromedia flex Software development best practice


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




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to