Re: [Flashcoders] how do i say "string" + anything?
You have to cast the variable as a String before the concatination or the two values might be incompatable ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] how do i say "string" + anything?
On Wed, Sep 23, 2009 at 05:36:20PM -0700, Steven Sacks wrote: > var compareBranch:String = "index/nav/home/whatever/else"; > > if (compareBranch.indexOf(event.validBranch) > -1) Would fail if the substring is found farther than the beginning. Should be checked for being == 0 eventually. --strk; Free GIS & Flash consultant/developer () ASCII Ribbon Campaign http://foo.keybit.net/~strk/services.html /\ Keep it simple! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] how do i say "string" + anything?
var compareBranch:String = "index/nav/home/whatever/else"; if (compareBranch.indexOf(event.validBranch) > -1) On Sep 23, 2009, at 5:56 AM, Kenneth Kawamoto wrote: Or you could just use indexOf(). Kenneth Kawamoto http://www.materiaprima.co.uk/ strk wrote: On Wed, Sep 23, 2009 at 12:40:55PM +0100, thomas horner wrote: what i need to know if how to say is ; if (event.validBranch == "index/nav/his" + "anything else that might follow"){ Compare a substring of event.validBranch, from start to length of "index/nav/his". --strk; Free GIS & Flash consultant/developer () ASCII Ribbon Campaign http://foo.keybit.net/~strk/services.html /\ Keep it simple! ___ 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 do i say "string" + anything?
i ended up using a slice, bit messy but worked. function onAfterGoto(event:GaiaEvent):void { var subString:String; subString=event.validBranch; trace("subslice = "+ subString.slice( 13 ) ); trace("current branch = "+ event.validBranch); if ((nav2.numChildren < 0) && (event.validBranch == ("index/nav/his"+ subString.slice(13 { createSubNavhis(); TweenMax.to(menuBar, 0.25, {x:-270, ease:Bounce.easeInOut}); createBackButton(); } -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kenneth Kawamoto Sent: 23 September 2009 13:57 To: Flash Coders List Subject: Re: [Flashcoders] how do i say "string" + anything? Or you could just use indexOf(). Kenneth Kawamoto http://www.materiaprima.co.uk/ strk wrote: > On Wed, Sep 23, 2009 at 12:40:55PM +0100, thomas horner wrote: > >> what i need to know if how to say is ; if(event.validBranch == >> "index/nav/his" + "anything else that might follow"){ > > Compare a substring of event.validBranch, from start to length > of "index/nav/his". > > --strk; > > Free GIS & Flash consultant/developer () ASCII Ribbon Campaign > http://foo.keybit.net/~strk/services.html /\ Keep it simple! ___ 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 do i say "string" + anything?
Or you could just use indexOf(). Kenneth Kawamoto http://www.materiaprima.co.uk/ strk wrote: On Wed, Sep 23, 2009 at 12:40:55PM +0100, thomas horner wrote: what i need to know if how to say is ; if(event.validBranch == "index/nav/his" + "anything else that might follow"){ Compare a substring of event.validBranch, from start to length of "index/nav/his". --strk; Free GIS & Flash consultant/developer () ASCII Ribbon Campaign http://foo.keybit.net/~strk/services.html /\ Keep it simple! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] how do i say "string" + anything?
On Wed, Sep 23, 2009 at 12:40:55PM +0100, thomas horner wrote: > what i need to know if how to say is ; if(event.validBranch == > "index/nav/his" + "anything else that might follow"){ Compare a substring of event.validBranch, from start to length of "index/nav/his". --strk; Free GIS & Flash consultant/developer () ASCII Ribbon Campaign http://foo.keybit.net/~strk/services.html /\ Keep it simple! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] how do i say "string" + anything?
i've built a global nav but now when it comes to detecting the current page and updating the subnav accordingly i've got a little stuck, i think im nearly there, what i need to know if how to say is ; if(event.validBranch == "index/nav/his" + "anything else that might follow"){ basically how do i say "index/nav/his" + "anything"){ function onAfterGoto(event:GaiaEvent):void { trace("current branch = "+ event.validBranch); if(event.validBranch == "index/nav/his++"){ createSubNavhis(); TweenMax.to(menuBar, 0.25, {x:-270, ease:Bounce.easeInOut}); createBackButton() } } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders