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