Hi Susan,
In DisplayPicLoaded you add displayObject as a child of container.
So in navToURL you can reference it as e.currentTarget.displayObject
HTH
Willem van den Goorbergh

On 2-mrt-2010, at 13:59, Susan Day wrote:

2010/3/1 Beatrix Krümmer-Frau <[email protected]>

Did you check the spelling?


Thank you all. Yes, yesterday's lesson was brought to me by the letter 'N'
lol.
Today's lesson is different. Here's my code:

function DisplayPicLoaded(evt:Event):void
{
var container:Sprite = new Sprite();
var myXArray:Array = new Array(10,176,342,508,674,840);
var loaderInfo:LoaderInfo = evt.target as LoaderInfo;
var displayObject:DisplayObject = loaderInfo.content;
displayObject.width = 150;
displayObject.height = 150;
displayObject.x = myXArray[countRounds];
displayObject.y = 10;
displayObject.filters = [createBevel()];
container.addChild(displayObject);
addChild(container);
navPics.push(displayObject);
container.addEventListener(MouseEvent.CLICK, navToURL);
if (countRounds < 5)
{
countRounds++;
init();
}
}

function navToURL(e:Event):void
{
e.currentTarget.removeEventListener(MouseEvent.CLICK, navToURL);
Navigate.to("test.html");
}

The above code works fine, but it's only a baby-step toward what I need. I'm confused how to change "test.html" into a dynamic url that depends on which iteration of the displayObject is created in DisplayPicLoaded. I believe I'm supposed to use "e.currentTarget.???" and that's where I'm lost. Of course, e.currentTarget refers to "container", not displayObject. Perhaps I could add an URL element to "container" in DisplayPicLoaded, then reference it in
navToURL. Please advise.
TIA,
Susan
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Geografiek is a Dutch, Utrecht-based map and chart design company.
Willem van den Goorbergh can be contacted by telephone: (+31) 30-2719512 or cell phone: (+31)6-26372378
or by fax: (+31)302719687
snail mail: Hooghiemstraplein 89 3514 AX UTRECHT
Visit our website at: http://www.geografiek.nl
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=





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

Reply via email to