On Tue, Mar 2, 2010 at 9:15 AM, Geografiek <[email protected]> wrote:
> Hi Susan,
> In DisplayPicLoaded you add displayObject as a child of container.
> So in navToURL you can reference it as e.currentTarget.displayObject
>
Half-way there. I now have this 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.url = myURLs[countRounds];
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(e.currentTarget.displayObject.url);
}
This throws an error 1119 on this line:
displayObject.url = myURLs[countRounds];
How do I attach that url?
TIA,
Susan
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders