On Thu, Mar 11, 2010 at 10:17 AM, Paul Andrews <[email protected]> wrote:
> The trace statement above doesn't have '.html' appended. You have
> inconveniently left off the assignment to the url string.
>
I believe I mentioned in an earlier post that when I print url in the
calling function, it prints the entire url, with ".html". However, when I
print it in the called fn, it drops the ".html". Is that not clear? Does
something else need clarification?
>
> Susan, make a tiny example rather than give snippets.
>
Not sure what you mean here. Complete code? If necessary, please let me
know.
>
> In general, for an OO solution, code that says "if (e.currentTarget.name== '
> Home ') " to look for particular cases isn't very OO!
>
Well, that's the next question lol. But let's deal with this one first.
>
> 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);
>
It says:
package
{
import flash.display.Sprite;
public class URLClip extends Sprite
{
public var url:String;
public function URLClip ()
{
}
}
}
Exactly what a previous poster supplied. It's called thus:
nsprite.url = nurl;
where nsprite has the listener that calls the onClick fn and nurl is passed
as a var to the fn from which the above line is quoted.
I just don't understand why, when I trace nsprite.url in the calling fn, it
prints with ".html", but when I call it in the listening fn (the onClick),
it drops it! Why would it do that?
TIA,
Susan
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders