Skip to main content
August 15, 2011
Question

Implicit coercion of a value of type flash.display:MovieClip to an unrelated type Class.

  • August 15, 2011
  • 1 reply
  • 5918 views

These are my errors: in Adobe Flash CS5.5

I don't understand why this script doesn't work. I am new to Action Script 3.0 and I watched this incomplete video on youtube. -- http://www.youtube.com/watch?v=LC7BaZCForE&feature=relmfu -- and I got the fails below.

Scene 1, Layer 'actionscript', Frame 1, Line 11 1067: Implicit coercion of a value of type flash.display:MovieClip to an unrelated type Class.

Scene 1, Layer 'actionscript', Frame 1, Line 11 1118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.display:DisplayObject.
Main Timeline:
import flash.filters.GlowFilter;
import flash.events.MouseEvent;
import flash.display.MovieClip;
var navBtnGlow:GlowFilter = new GlowFilter(0x999999, 0.5, 0, 15, 1, 2, true, false);
navbar_jj.addEventListener(MouseEvent.MOUSE_OVER, navOverF);
navbar_jj.addEventListener(MouseEvent.MOUSE_OUT, navOutF);
function navOverF(event:MouseEvent):void{
     event.target.filters = [navBtnGlow];
navbar_jj.setChildIndex(event.target as MovieClip(event.target), 1);
dropmenus_jj.gotoAndStop(navbar_jj.getChildAt(1).name);
trace("We are Rolled Over..." + navbar_jj.getChildAt(1).name)
}
function navOutF(event:MouseEvent):void{
     event.target.filters = [];
}
Clicker Drop Down
import flash.events.MouseEvent;
stop();
leadersframe_btn.addEventListener(MouseEvent.MOUSE_OVER, goBackF);
function goBackF(event:MouseEvent):void{
    gotoAndStop (1);
}

This topic has been closed for replies.

1 reply

Inspiring
August 15, 2011

Use:

navbar_jj.setChildIndex(MovieClip(event.target), 1);

Or

navbar_jj.setChildIndex(DisplayObject(event.target), 1);