On 11/03/2010 13:53, Susan Day wrote:
On Thu, Mar 11, 2010 at 9:25 AM, Paul Andrews<[email protected]>  wrote:

function onClick(e:Event):void{
        trace("navigate to "+e.currentTarget.url);

The blasted thing traced the url without ".html" at the end...again!! What
could possibly be causing this behavior? When I trace Btn.url in the
function where it is created, it correctly traces with the ".html" tag. Why
on earth would it be stripped in the onMouseClick function?? Here's the
pertinent from that fn:

function onPressHandler(e:MouseEvent)
{
if (e.currentTarget.name == ' Home ')
{
Navigation(' Home ', 'index', 235, 0xffffff);
Navigate.to(e.currentTarget.getChildAt(1).text + '.html');
trace(e.currentTarget.url);
The trace statement above doesn't have '.html' appended. You have inconveniently left off the assignment to the url string.

Susan, make a tiny example rather than give snippets.

In general, for an OO solution, code that says "if (e.currentTarget.name == ' Home ') " to look for particular cases isn't very OO!

Also if you had code in your sprite class that said something like:

public var urlTextFld:TextField  ;

In the constructor ..
urlTextFld = new TextField() ..
addChild(urlTextFld);

You can then ditch guessing where on the display list for the target the textfield is because it would then be

Navigate.to(e.currentTarget.urlTextFld.text + '.html');

Paul

...

Please advise.
TIA,
Susan
_______________________________________________
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