Skip to main content
Participant
August 25, 2013
Question

How to roll over image tiles and bring image to front ?

  • August 25, 2013
  • 1 reply
  • 592 views

Hey
I have started practising AS3 from O'Reilly.Wanna make a game in it.
I have created an image collage on the stage by importing & resizing images.
Then, I made all of them as individual symbols named "Pic1","Pic2",..
Then I created variables in AS named "Pic1":MovieClip (then addChild(Pic1)),"Pic2" :MovieClip (then addChild("Pic2") and so on..

then as O'reilly says

this.addEventListener(MouseEvent.MOUSE_OVER, onBringToTop, false, 0,

true);

function onBringToTop(evt:MouseEvent):void {

this.setChildIndex(evt.target, this.numChildren-1);

}

Images not moving.
Error:

Scene 1, Layer 'Layer 1', Frame 1, Line 531118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.display:DisplayObject.


So what do I need to learn more ?

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
August 25, 2013

Which line is line 53?

Andaman21Author
Participant
August 26, 2013

Sir, that's irrelevant. I had written another code above , then converted it as a comment.
So, the above code is all that is valid.

Inspiring
August 26, 2013

I´m not sure if its due to language barriers, but your reply comes across as snarky.

If someone, who is considered an expert on this forum asks you to provide better information it is not to belittle you, but to help you efficiently.

So, the above code is all that is valid.

The code you provided has nothing in it that could hint at what causes the compile error.

If you don`t know how to read Error messages, then most here will gladly help you to improve that skill.