RE: [Flashcoders] add string to a function

2009-08-28 Thread thomas horner
thanks for the first answer, works a treat, i'm not really sure what other
stuff is though!

thanks, 

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Hans Wichman
Sent: 28 August 2009 10:35
To: Flash Coders List
Subject: Re: [Flashcoders] add string to a function

ps a better option might be a parameter and a switchstatement

On Fri, Aug 28, 2009 at 11:20 AM, thomas horner
tho...@megawattmedia.co.ukwrote:

 this is possibly a very basic problem,   I'm still building my dynamic
 global sub nav, slooowly.



 what I want to know if can I add a string to a function,



 I have my initial first level navigation, I click a button and then if the
 button has children in that section it says true and then brings up the
 corresponding children to populate that subnav,



 I was going to have 3 separate functions for the subnavs







 what I'm unsure about is the line:  'createSubNav +page();



 ///I wanted to then have the following functions createSubNavHis
 createSubNavHerscreateSubNavTheirs



 //is this possible?



 //here is my code on the first level buttons///





 function mouseClickHandler(e:Event):void {



//var siteNav:XML =
 IXml(assets.siteNav).xml;

var
 page:String=e.target.label.text;

trace(page);

targetPage=e.target.linkTo;



//targetPage =
 e.target.linkTo;









if
 (e.target.kiddies.children().length()0) {


 hasChildren=true;


 TweenMax.to(nav1, 0.25, {x:-200, ease:Bounce.easeInOut});


 trace(e.target.kiddies.children());


createSubNav
 + page() ;








 trace(hasChildren);

} else {


 hasChildren=false;


 trace(hasChildren);


 Gaia.api.goto( + [targetPage] + );



}

}





 ___
 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] add string to a function

2009-08-28 Thread Hans Wichman
Hi,

you are looking for:
this[createSubNav+page]();
HTH
JC


On Fri, Aug 28, 2009 at 11:20 AM, thomas horner
tho...@megawattmedia.co.ukwrote:

 this is possibly a very basic problem,   I'm still building my dynamic
 global sub nav, slooowly.



 what I want to know if can I add a string to a function,



 I have my initial first level navigation, I click a button and then if the
 button has children in that section it says true and then brings up the
 corresponding children to populate that subnav,



 I was going to have 3 separate functions for the subnavs







 what I'm unsure about is the line:  'createSubNav +page();



 ///I wanted to then have the following functions createSubNavHis
 createSubNavHerscreateSubNavTheirs



 //is this possible?



 //here is my code on the first level buttons///





 function mouseClickHandler(e:Event):void {



//var siteNav:XML =
 IXml(assets.siteNav).xml;

var
 page:String=e.target.label.text;

trace(page);

targetPage=e.target.linkTo;



//targetPage =
 e.target.linkTo;









if
 (e.target.kiddies.children().length()0) {


 hasChildren=true;


 TweenMax.to(nav1, 0.25, {x:-200, ease:Bounce.easeInOut});


 trace(e.target.kiddies.children());

createSubNav
 + page() ;








 trace(hasChildren);

} else {


 hasChildren=false;


 trace(hasChildren);


 Gaia.api.goto( + [targetPage] + );



}

}





 ___
 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] add string to a function

2009-08-28 Thread Hans Wichman
ps a better option might be a parameter and a switchstatement

On Fri, Aug 28, 2009 at 11:20 AM, thomas horner
tho...@megawattmedia.co.ukwrote:

 this is possibly a very basic problem,   I'm still building my dynamic
 global sub nav, slooowly.



 what I want to know if can I add a string to a function,



 I have my initial first level navigation, I click a button and then if the
 button has children in that section it says true and then brings up the
 corresponding children to populate that subnav,



 I was going to have 3 separate functions for the subnavs







 what I'm unsure about is the line:  'createSubNav +page();



 ///I wanted to then have the following functions createSubNavHis
 createSubNavHerscreateSubNavTheirs



 //is this possible?



 //here is my code on the first level buttons///





 function mouseClickHandler(e:Event):void {



//var siteNav:XML =
 IXml(assets.siteNav).xml;

var
 page:String=e.target.label.text;

trace(page);

targetPage=e.target.linkTo;



//targetPage =
 e.target.linkTo;









if
 (e.target.kiddies.children().length()0) {


 hasChildren=true;


 TweenMax.to(nav1, 0.25, {x:-200, ease:Bounce.easeInOut});


 trace(e.target.kiddies.children());

createSubNav
 + page() ;








 trace(hasChildren);

} else {


 hasChildren=false;


 trace(hasChildren);


 Gaia.api.goto( + [targetPage] + );



}

}





 ___
 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] add string to a function

2009-08-28 Thread thomas horner
 10:49
To: 'Flash Coders List'
Subject: RE: [Flashcoders] add string to a function

thanks for the first answer, works a treat, i'm not really sure what other
stuff is though!

thanks, 

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Hans Wichman
Sent: 28 August 2009 10:35
To: Flash Coders List
Subject: Re: [Flashcoders] add string to a function

ps a better option might be a parameter and a switchstatement

On Fri, Aug 28, 2009 at 11:20 AM, thomas horner
tho...@megawattmedia.co.ukwrote:

 this is possibly a very basic problem,   I'm still building my dynamic
 global sub nav, slooowly.



 what I want to know if can I add a string to a function,



 I have my initial first level navigation, I click a button and then if the
 button has children in that section it says true and then brings up the
 corresponding children to populate that subnav,



 I was going to have 3 separate functions for the subnavs







 what I'm unsure about is the line:  'createSubNav +page();



 ///I wanted to then have the following functions createSubNavHis
 createSubNavHerscreateSubNavTheirs



 //is this possible?



 //here is my code on the first level buttons///





 function mouseClickHandler(e:Event):void {



//var siteNav:XML =
 IXml(assets.siteNav).xml;

var
 page:String=e.target.label.text;

trace(page);

targetPage=e.target.linkTo;



//targetPage =
 e.target.linkTo;









if
 (e.target.kiddies.children().length()0) {


 hasChildren=true;


 TweenMax.to(nav1, 0.25, {x:-200, ease:Bounce.easeInOut});


 trace(e.target.kiddies.children());


createSubNav
 + page() ;








 trace(hasChildren);

} else {


 hasChildren=false;


 trace(hasChildren);


 Gaia.api.goto( + [targetPage] + );



}

}





 ___
 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