On 11/03/2010 11:46, Susan Day wrote:
On Wed, Mar 10, 2010 at 7:07 PM, Kenneth Kawamoto<[email protected]
wrote:
If I understand you correctly you want to trace "index.html"?

One funky way is...

trace(new XML("<a href='index.html'>Home</a>")....@href);
// traces "index.html"

...therefore if your e.currentTarget.getChildAt(0).htmlText is giving you
"<a href='index.html'>Home</a>" you can do:

trace(new XML(e.currentTarget.getChildAt(0).htmlText)....@href);

I don't know where the heck that took me, something about "go to this
address here" or some such in the address bar of the browser lol. Yeah,
pretty out there and crazy. Definitely not elegant, but you knew that, too.

Karl DeSaulniers asks if I can give the Sprite/MC a name and call that. I've
tried that and I don't get the results I want; namely, an URL.

Paul Andrews asks me to state more clearly that for which I am looking.
Probably a good idea to re-clarify things.
1) I have a TextField (TF) to which I assign attributes.
2) TF is the child of an MC
3) The MC has listeners which call functions
4) One of the functions (onClick) requires that a new Web page be opened;
therefore, either:
      a) I attach and call the URL to/from the TF, or;
      b) I do so from the MC.
TIA,
Susan
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".

Paul



_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to