Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Aug 25, 2013 Aug 25, 2013

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 ?

TOPICS
ActionScript
571
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 25, 2013 Aug 25, 2013

Which line is line 53?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 26, 2013 Aug 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 26, 2013 Aug 26, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines