Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3442186
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:38:20+00:00 2026-05-18T08:38:20+00:00

I am making a basic point n’ click game and I came upon this

  • 0

I am making a basic point n’ click game and I came upon this error:
TypeError: Error #1034: Type Coercion failed: cannot convert 3 to cem.mouvement.

Here’s my script:

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);
        }
    }
}

And on mouvement();

package cem
{
    public class mouvement {

        public function mouvement(blabla) {
            trace(blabla);
        }
    }
}

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:38:20+00:00Added an answer on May 18, 2026 at 8:38 am

    The error is due to you trying to cast 3 to mouvement.

    I think what you want is something like

    function test(e:MouseEvent){
        pCoordonnees = stage.mouseX;
        trace(pCoordonnees);
        var mouve:mouvement = new mouvement(3);
    }
    

    Notice that you have to have new in order to create a new instance of a class.

    On another note, you should capitilize classes so they stand out better. So I would name the class Mouvement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm thinking about making a networked game. I'm a little new to this, and
I'm sorry if this is really basic, but: I feel at some point I
I am making a simple game in order to learn a new language. I
Can someone point me in the right direction in regards to making an api
I'm currently writing a very basic Java game based on the idea of Theme
So, I've been making iOS apps since the first iPod touch came out, but
I posted this basic question before, but didn't get an answer I could work
This is beyond both making sense and my control. That being said here is
I am a little lost at this point in my project. I work for
This is probably basic stuff, but I can't find the clear answer anywhere.. Lets

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.