1046: not a compilation constant: TimerEvent.

I know it's simple, but I can't see what I'm doing wrong
This is in reference to "public function moveClip(event:TimerEvent):void {}".
any help is appreciated.
my code is attached

Thank you

What is import flash. TimerEvent.Event?

Try:

import flash.events.TimerEvent. *;

p.s. This should be in the as3 forum

Tags: Adobe Animate

Similar Questions

  • Help! «1046: type was not found or was not a compilation constant: TimerEvent.»

    I get the followiing error in my main document class:

    «1046: type was not found or was not a compilation constant: TimerEvent.»

    It shows online 47 and 54 (in red below). Any help would be appreciated. BTW, this is my first time creating a class of main document since its release to class files! :

    package

    {

    STATEMENTS IMPORT *.

    import flash.display.MovieClip;

    import com.greensock.TweenLite;

    import flash.utils.Timer;

    SerializableAttribute public class Main extends MovieClip

    {

    //***************** Variables ***************************

    / * private var appStoreURL:URLRequest = new URLRequest ("http://itunes.apple.com/us/artist/quackenworth/id518210161");

    private var facebookURL:URLRequest = new URLRequest ("http://www.facebook.com/quackenworth");

    private var twitterURL:URLRequest = new URLRequest ("http://www.twitter.com/quackenworth") ;*/

    private var MainScene:Main = new Main();

    private var PopUp_MoreApps:MoreApps_mc = new MoreApps_mc();

    private var PopUp_About:About_mc = new About_mc();

    SPLASH SCREEN *.

    private var mc_timerSplash:Timer;

    private var splashScreen:mcSplashScreen;

    //*****************CONSTRUCTOR CODE ***********************************************************************************

    public void Main()

    {

    mc_timerSplash = new Timer (3000,1);

    mc_timerSplash.addEventListener (TimerEvent.TIMER, StartTimer);

    When the timer is finished, stop the timer;

    mc_timerSplash.addEventListener (TimerEvent.TIMER_COMPLETE, timerCompleted);

    splashScreen = new mcSplashScreen();

    addChild (splashScreen);

    splashScreen.x = stage.stageWidth / 2;

    splashScreen.y = stage.stageHeight / 2;

    mc_timerSplash.start ();

    }

    //*********** FUNCTIONS *********************************

    private void timerCompleted(e:TimerEvent):void

    {

    mc_timerSplash.stop ();

    mc_timerSplash = null;

    }

    private void StartTimer(e:TimerEvent):void

    {

    TweenLite.to (splashScreen, 1, {alpha: 0, onComplete: SplashScreen});

    }

    private void SplashScreen (): void

    {

    removeChild (splashScreen);

    addMainScene();

    }

    private function addMainScene (): void

    {

    addChild (MainScene);

    MainScene.x = 489;

    MainScene.y = 350;

    TweenLite.from (MainScene.wbbIntro_mc,.5, {alpha: 0});

    TweenLite.from (MainScene, 1, {alpha: 0});

    TweenLite.to (MainScene.girls_mc, 1, {y: 395, delay: 3.});

    TweenLite.to (MainScene.boys_mc,.5, {y: 396, delay:. 6});

    TweenLite.to (MainScene.Joe_mc,.5, {y: 339, delay: 1});

    TweenLite.to (MainScene.Paul_mc,.5, {y: 322, delay: 1.2});

    }

    private function removeMainScene (): void

    {

    removeChild (MainScene);

    TweenLite.to (MainScene.girls_mc,.1, {y:690});})

    TweenLite.to (MainScene.boys_mc,.1, {y:693});})

    TweenLite.to (MainScene.Joe_mc,.1, {y:636});})

    TweenLite.to (MainScene.Paul_mc,.1, {y:619});})

    }

    }

    }

    Add a line to import the TimerEvent class:

    import flash.events.TimerEvent;

  • Error: Type was not found or was not a compilation constant: AlertDialog.

    I tried to compile one of my PlayBook AIR applications using the SDK of AIR BB10 tonight and got:

    Error: Type was not found or was not a compilation constant: AlertDialog.

    The command I used to compile was:

    Set JAVA_HOME = e: files (x 86) \Java\jre7
    set PATH = % PATH %; E:\Program Research In Motion\blackberry-tablet-sdk-3.0.0\bin

    CD E:\Users\Daniel\Dropbox\Apps\iTunesSync\Version0.3
    mxmlc + configname = air - library-path +=. iTunesSync.as o iTunesSync.swf - swf-version = 10

    This works if I use the SDK 2.0.0, but doesn't if I'm using 3.0.0.

    Strange.

    I confirmed that AlertDialog is always present:

    https://developer.BlackBerry.com/Air/beta/APIs/QNX/dialog/AlertDialog.html#includeExamplesSummary

    In BB10, device skins (and others) require the ANE must be loaded with the installation.

  • Type was not found or was not a compilation constant: ImportExportConfiguration

    Hello

    I use a text layout framework and get an error type was not found or was not a compilation constant: ImportExportConfiguration. I use Flex Builder 3, Flex SDK version flex_sdk_4.0.0.10485 and flash player 10.0.12, surprisingly this not found error in my project workspace.

    In my code I am using

    Import flashx.textLayout.container.DisplayObjectContainerController;

    Help

    Thank you

    Kumar Gaurav Pandey

    You are using an older version of our code. I suggest upgrade you to the latest code, see: http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK.

    You don't need to use the Flex Framework, but it comes with the latest textLayout libraries and source code.

    Hope this helps,

    -robin

  • Error: Type was not found or was not a compilation constant: PieChart.

    Hi all

    I get an obtuse error message from the compiler again. I get

    Error: Type was not found or was not a compilation constant: PieChart.

    For the following code

    < mx:VBox >
    < mx:PieChart id = dataProvider = "{parentApplication.services.webservice.getDealData.lastResult.SeriesVO"dealsPieChart"}" showDataTips = "true" > "
    < mx:series >
    < mx:PieSeries labelPosition = "legend" field = "count" field name = "name" / >
    < / mx:series >
    < / mx:PieChart >
    < mx:Legend dataProvider = "{dealsPieChart}" / >
    < / mx:VBox >

    I don't know what I am getting this error. According to the examples that I read on the site of flex on the charts all seem fine. Any pointers welcom.

    OK - I think that I n "t have the component graph charting. It looks like a separate download. The is not going to be open comes? If this isn't the case - first bad sign for me of the authenticity of the open source moves.

  • 1046: do not type a compilation constant: TimerEvent.

    I have a simple spaceship in a fla
    have this .as file
    but still get the error
    associated with the line "public function moveClip(event:TimerEvent):void {}".

    import flash.events.TimerEvent. *;

    must be:

    import flash.utils.Timer;
    import flash.events.TimerEvent;

  • Type 1046: Type was not found or was not a compilation constant: NetworkInfo

    Hello

    All started to play with the new AIR features NetworkInfo and NetworkInterface, but cannot build...

    This is the example that I started by: tourdeflex

    But these lines cause errors:

    var networkInfo:NetworkInfo = NetworkInfo.networkInfo;
    var networkInterfaces:Vector.<NetworkInterface> = networkInfo.findInterfaces();

    Looks like this isn't the construction with the last AIR2, although my app.xml looks OK:

    <? XML version = "1.0" encoding = "utf-8" standalone = 'no '? >
    " < application xmlns =" http://ns.Adobe.com/air/application/2.0 ">

    And my Build of Flex is:

    c:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0

    Any ideas on how to solve it?

    Thank you very much

    Frank

    AIR 2 is not delivered with Flash Builder 4.0.0. FB currently has 1.5. On AIR dev tools page http://www.adobe.com/products/air/tools/ you can find this link http://kb2.adobe.com/cps/495/cpsid_49532.html which explains how to use the AIR SDK by copying and then superimpose the required files. The 1.5 reference docs, but they apply to 2.0.

    Once you've done that, add the new SDK in FB under preferences > Flash Builder > installed SDKS and point your project to the new SDK.

    Jason San Jose

    Software engineer, Flash Builder

  • 1046: type was not found or is not a compilation constant: void.

    Stop();

    addEventListener (Event.ENTER_FRAME, abc1);

    function abc1(e:Event):Void {}

    gotoAndStop (10);

    }

    Here's what I copied under the compile error

    function abc1(e:Event):Void {}

    I have no idea why this is happening):

    Sub must be lowercase.

  • src\starling\textures\ConcreteRectangleTexture.as, line 49 1046: Type was not found or is not a compilation constant: RectangleTexture.

    Framework of Starling showing this error in flash professional cs6

    I tried to run the simple code starling. My journey has been authorized.

    package

    {

    import flash.display.Sprite;

    Import starling.core.Starling;

    [SWF (width = "400" height = "300", frameRate = "60", backgroundColor = "#ffffff")]

    Game/public class extends Sprite

    {

    private var _starling:Starling;

    public function Startup()

    {

    _starling = new Starling (game, Stadium);

    _starling. Start();

    }

    }

    }

    Post in the forum of starling.

  • Type 1046: Type was not found or was not a compilation constant:

    Hi all

    It's driving me crazy and I can't understand it.

    This is my code

    package ShoppingCart.Model
    {
              // IMPORT STATEMENTS
              import flash.events.EventDispatcher;
              import ShoppingCart.Model.DataModel;
              
              [Bindable]
              public class ShopViewAdapter
              {
                   // VARIABLES
                   public var dispatcher:EventDispatcher;
                   public var dataModel:Datamodel;
                   
                   public function ShopViewAdapter()
                   {
                        
                   }
              }
    }
    

    Any help please?

    Thank you very much

    DataModel is badly spelled - there should be DataModel - capital M (unless the class name is Datamodel, in which case it is misspelled in import)

  • Type was not found or was not a compilation constant: ArrayCollection collection

    I've never seen this type of error before. I was running the asdoc tool when I arrived at the Office:

    package adventureGame.util
    {
         import mx.collections.ArrayCollection;
    
         public class ACConvertor
         {
              public function toAC(array:Array):ArrayCollection
              {
                   var arrayObject:Array = new Array();
                   var ac:ArrayCollection = new ArrayCollection();
                   
                   return ac = arrayObject as ArrayCollection;
              }
         }
    }
    

    Why I get:

    ACConvertor.as (31): col: 37 error: Type was not found or is not a constant of compilation: ArrayCollection collection.

    public void toAC(array:Array):ArrayCollection

    Collection ArrayCollection and any class that starts with mx... is that the Flex code. You work in an IDE Flex or Flash?

  • Error: Type was not found or was not a compilation constant: PromptDialog.

    My PlayBook application compiles to the BB10 SDK of AIR due to the error in the subject. See also: https://developer.blackberry.com/air/beta/apis/qnx/dialog/PromptDialog.html#includeExamplesSummary

    package
    {
        import flash.display.Sprite;
        import qnx.fuse.ui.dialog.AlertDialog;
        import qnx.dialog.PromptDialog;
    
        [SWF(width="768", height="1280", backgroundColor="#FFFFFF", frameRate="60")]
        public class Example extends Sprite
        {
            public function Example()
            {
                try
                {
                    showPromptDialog();
                }
                catch(error:Error)
                {
                    dialog("Error on Initialization", error.message);
                }
            }
    
            private function showPromptDialog():void
            {
                var prompt:PromptDialog = new PromptDialog();
                // ...
            }
    
            private function debug(msg:String):void
            {
                dialog("Debug", msg);
            }
    
            private function dialog(title:String, msg:String):void
            {
                var alert:AlertDialog = new AlertDialog();
                alert.title = title;
                alert.message = msg;
                alert.addButton("Ok");
                alert.show();
            }
        }
    }
    

    Please do not take into account. Somehow I failed to change the import statement to refer to the new location of this class in BB10:

    Import qnx.fuse.ui.dialog.PromptDialog;

  • Why the MouseEvent not a compilation is constant?

    Hi - I'm trying to understand AS3 having never really understood AS2.

    In a class file, I have a button (GameButton) I want to all proceedings there are exactly the same. I found this code in a tutorial, but when I run it I get the error: "Type was not found or was not a compilation constant: MouseEvent.»  And then he appoints 2 of my public duties. I don't see what is wrong, so I hope someone can tell me what is the problem here.  Here's all the code in my class file:

    package {}

    import flash.display.MovieClip;

    SerializableAttribute public class GameButton extends MovieClip {}

    public void GameButton() {}

    trace ("GameButton has been created");
    Stop();


    addEventListener (MouseEvent.MOUSE_OVER, hoverOver);
    addEventListener (MouseEvent.MOUSE_OUT, hoverOff);
    }

    public void hoverOver(event:MouseEvent):void
    {
    this.gotoAndStop (2);
    }
    public void hoverOff(event:MouseEvent):void
    {
    this.gotoAndStop (1);
    }

    public void setLabel(newLabel:String):void
    {
    this.buttonLabel.text = newLabel;
    }
    }
    }

    TIA your expertise.

    JL

    When you see a message like that it means that you need to import that class (just as you have imported the movieclip class).  (or, you have made a typo, and there is no such class.)

    If you don't know how to import this class, see this category in the help files, and at the top, it will show how it should be imported:

    import flash.events.MouseEvent

  • 1046 - compilation constant: vector

    I was tring to use wavy but I get 1046 - compilation constant: vector. Any ideas?

    Could you please try this and let me know if it works?

    GoTo your project properties, select compiler Flex-> Adobe Flash player Options, the value of player version 10.1.0

    Thank you

    Ravi

  • Error: Could not find compiled resource bundle "components" for locale "en_US".

    We are porting a large enough body of the Flex3 code developed as part of FlexBuilder 3 to Flex4 under FlashBuilder 4.  Most of the conversion seems to work very well, with one exception.  When I run the version of Flex4, all my exchanges of data with the server works.  Just as he is about to display the user interface, the following error occurs:

    Error: not found compiled resource bundle "components" for locale "en_US".

    I actually use a locale of en_US, but I guess that it could not conclude that revenue back to en_US, has yet again and then barfed.  If I look in

    ~ Adobe Flash Builder 4\sdks\4.0.0\frameworks\locale\fr_FR

    I see a lot of swc and of course not «components.swc» files  I think the problem is that our code Flex3 is using mx components, and compatibility mode is not correctly handles it for some reason any.  I think it is mainly from our internal user interface library.  The properties of this library (and for my main application, I'm testing now) have:

    -Use default SDK (currently 'Flex 4.0')

    -Use Flex 3 compatibility mode

    -Use the minimum version (Flash Player) required by the Flex SDK kit

    -Enable strict type checking

    -Enable warnings

    I also tried to put the compatibility flag command-line compilation mxmlc, without a change in behavior.  This project is built with the following script:

    Ruby scripts/concat_properties.rb o resources.properties ^.
    src/main/Flex/local/FR_Common/res_myname_fr_common. Properties ^.
    src/main/Flex/local/FR_Common/Scout/res_myname_scout_fr_common. Properties ^.
    src/main/Flex/local/en_GB/res_myname_fr_fr. Properties ^.
    .. /.. /Scout/common/src/locale/FR_Common/mypals/resources.properties
    mxmlc-local = en_US-source-path =. ^
    -compatibility-version = 3.0.0. ^
    static-RSLS = true ^.
    -resources include-resource-bundles = ^.
    -output src/main/resources/bundles/mypals/fr_fr_resources.swf
    copy src\main\resources\bundles\mypals\fr_fr_resources.swf ^.
    bin-debug\bundles\mypals

    What did I miss?

    When you compile your SWF application, use the - resource-bundle-option list indicating something like - resources-bundle-list = C:\bundles.txt. The compiler must write to this file the names of all the bundles of resources that your application uses.

    Then add all these names together in the - include-resource-bundles option when you compile your modules of resources, so that your resource modules have not only your own resources, but also the resources required by classes in the framework that your application uses. Use a comma-separated list as - include-resource-bundles = resources, core, the container controls. Specify additional source paths so that it can find the .properties files for these packages, which are located in directories such as frameworks/projects/framework/bundles/en_US, frameworks/projects/mx/bundles/en_US, frameworks/projects/candle/bundles/en_US. You can use {local} instead of the actual location, as in frameworks/projects/framework/bundles / {local}.

    If this does not resolve the problem, I'm afraid I'm out of ideas.

    Gordon Smith

    Adobe Flex SDK team

Maybe you are looking for