dimanche 19 mars 2017

EventDispatch error in action script 3

I am not sure if something is wrong with my code or if I have to handle the error differently. I have an instance of Gear and the other one is bLine. I am trying to make both move as soon as the gear falls on the line. So what I have inside of the instance coded is:

var ev2:Event = new Event("transfer");



In the bLine I have: `

import flash.events.Event;


function Move(e:Event):void {


Then, in the main timeline:

 import flash.events.Event;

function transferGear(e:MouseEvent) {


This is the output I'm getting: "TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::Event@16bbd6bb7821 to flash.events.MouseEvent. at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent()

at Rube2_fla::mc_gear_4/frame24()"

So what am I doing wrong and how I could fix it?

Aucun commentaire:

Enregistrer un commentaire