Note that there are some explanatory texts on larger screens.

plurals
  1. POError #1034, with a MouseEvent
    text
    copied!<p>I am making a basic point n' click game and I came upon this error:<br> <strong>TypeError: Error #1034: Type Coercion failed: cannot convert 3 to cem.mouvement.</strong></p> <p>Here's my script:</p> <pre><code>package cem { import flash.events.Event; import flash.display.MovieClip; import cem.microjeux.events.InfoJeuEvent; import cem.mouvement; import flash.events.MouseEvent; public class monterJeu extends MovieClip { private static var pType:String = "type"; private static var pNom:String = "testNom"; private static var pCourriel:String = "test@hotmail.com"; private static var pDifficulte:int = 0; private static var pLangue:int = 0; private static var pTitre:String = "Veuillez sortir"; private static var pVersion:String = "1.5"; private static var pCoordonnees:Number; private var environnementJeu:environnement = new environnement(); private var personnageJeu:personnage = new personnage(); public function monterJeu():void { jouer(pNom,pDifficulte,pLangue); dispatchEvent(new InfoJeuEvent(pType,pNom,pCourriel,pTitre,pVersion)); stage.addEventListener(MouseEvent.CLICK, test); } public function jouer(PNom:String,PDifficulte:int,PLangue:int):void { addChild(environnementJeu); addChild(personnageJeu); } function test(e:MouseEvent){ pCoordonnees = stage.mouseX; trace(pCoordonnees); mouvement(3); } } } </code></pre> <p>And on mouvement();</p> <pre><code>package cem { public class mouvement { public function mouvement(blabla) { trace(blabla); } } } </code></pre> <p>I searched everywhere I could, and didn't find anything. I have no instances on the stage. Everything is imported on the first frame. I am kind of a beginner (let's say i'm no good at programming), so you can notify at the same time if you something that needs to be corrected. (BTW, the strange words are in french ;D) Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload