On Thu, Mar 11, 2010 at 8:01 AM, Paul Andrews <[email protected]> wrote: Susan, > > > I think your main confusion lies with the concept of "attaching" code and > your "clarification" points to the URL being the content of the text field. > > The natural place for your code is in the click handler. > > The click handler knows which MC is involved, so it should be easily > possible to access the URL text via the event property passed to the click > handler. > > Something like event.currentTarget.urlTextField.text > > so in the click handler you need something like: > > var pageURL:String = event.currentTarget.textField.text; > > Then you can navigate. I'm not sure what you mean by "attach". >
So I added a new child (in addition to TF) to the MC specifically to handle the URL. I gave this new child a text property of the URL that is passed through to the function. Now: 1) When I trace the value of this URL within the function in which the child is created and added to the MC, the correct value traces. 2) When I explicitly add the correct value (as opposed to passing it as a parameter to said function, which again printed correctly on trace), the correct value is passed and the link is indeed established in the onMouseClick function. Of course, that won't work on automatic generation, since that same value will be passed to all instances, which is contrary to what I need. 3) **However**, when I call the property in the onMouseClick function when the URL is passed through to the initial function, onMouseClick truncates ".html"!!! The inelegant solution to this, of course, is to tag ".html" on to that which is passed to the navigation function in the onMouseClick function. Yuck. But hey, it works. Now the property which I use to attach the URL to the newly created child is "text". If I use "htmlText", ugly things happen (spits out all sorts of superfluous code). OK, so it works. It's ugly, Any ideas on how to clean it up? TIA, Susan _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

