Re: [flexcoders] Flex and URL variables
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.mxmlmx:Application xmlns:mx= http://www.macromedia.com/2003/mxml mx:Scriptimport mx.controls.Alert;public var name:String = ; private function onAppInit(){ Alert.show(name);}/mx:Script/mx:ApplicationUsage: http://server/querystring.mxml?name=AbdulIt 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 :)-abdulOn 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. http://www.klynch.com/archives/76.html My implementation: http://www.jessewarden.com/archives/2005/10/code_share_real.html 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: http://dev.jessewarden.com/flex/codeshare/#codeid=43 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 - From: Jonathan Miranda To: flexcoders@yahoogroups.com 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 JesterXLSent: Thursday, March 02, 2006 3:55 PMTo: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Flex and URL variables Flex 1.5 or 2? - Original Message - From: Jonathan Miranda 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 : 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
Re: [flexcoders] Flex and URL variables
Aye, but that's one way. You need to use Kevin's code for the reasons you stated; deep linking. - Original Message - From: Abdul Qabiz To: flexcoders@yahoogroups.com Sent: Friday, March 03, 2006 12:50 PM Subject: Re: [flexcoders] Flex and URL variables 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.mxmlmx:Application xmlns:mx=" http://www.macromedia.com/2003/mxml" mx:Scriptimport mx.controls.Alert;public var name:String = ""; private function onAppInit(){ Alert.show(name);} /mx:Script/mx:ApplicationUsage:http://server/querystring.mxml?name=AbdulIt 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. http://www.klynch.com/archives/76.html My implementation: http://www.jessewarden.com/archives/2005/10/code_share_real.html 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: http://dev.jessewarden.com/flex/codeshare/#codeid=43 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 - From: Jonathan Miranda To: flexcoders@yahoogroups.com 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 JesterXLSent: Thursday, March 02, 2006 3:55 PMTo: flexcoders@yahoogroups.comSubject: Re: [flexcoders] Flex and URL variables Flex 1.5 or 2? - Original Message - From: Jonathan Miranda 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 : 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 a
Re: [flexcoders] Flex and URL variables
Flex 1.5 or 2? - Original Message - From: Jonathan Miranda To: flexcoders@yahoogroups.com Sent: Thursday, March 02, 2006 5:49 PM Subject: [flexcoders] Flex and URL variables Alright, Ive done this with Flash before but Im wondering how similar it is.Lets say I start my app @ http://mysite.com/index.mxml?number=3Whats 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
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 - From: Jonathan Miranda To: flexcoders@yahoogroups.com Sent: Thursday, March 02, 2006 5:49 PM Subject: [flexcoders] Flex and URL variables Alright, Ive done this with Flash before but Im wondering how similar it is. Lets say I start my app @ http://mysite.com/index.mxml?number=3 Whats 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] Flex and URL variables
Don't know the Flex 2 way. For Flex 1.5, I used Kevin Lynch's deep linking code. http://www.klynch.com/archives/76.html My implementation: http://www.jessewarden.com/archives/2005/10/code_share_real.html 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: http://dev.jessewarden.com/flex/codeshare/#codeid=43 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 - From: Jonathan Miranda To: flexcoders@yahoogroups.com 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 JesterXLSent: Thursday, March 02, 2006 3:55 PMTo: flexcoders@yahoogroups.comSubject: Re: [flexcoders] Flex and URL variables Flex 1.5 or 2? - Original Message - From: Jonathan Miranda To: flexcoders@yahoogroups.com Sent: Thursday, March 02, 2006 5:49 PM Subject: [flexcoders] Flex and URL variables Alright, Ive done this with Flash before but Im wondering how similar it is.Lets say I start my app @ http://mysite.com/index.mxml?number=3Whats 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] Flex and URL variables
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:flexcoders@yahoogroups.com] 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 To: flexcoders@yahoogroups.com Sent: Thursday, March 02, 2006 5:49 PM Subject: [flexcoders] Flex and URL variables Alright, Ive done this with Flash before but Im wondering how similar it is. Lets say I start my app @ http://mysite.com/index.mxml?number=3 Whats 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.