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;

Tags: Adobe Animate

Similar Questions

  • 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

  • 1046: type was not found or is not a constant of compilation: [flashx.textLayout.elements]: IFormatResolver, error. Help?

    If im working on a project and this error keeps happening and I have no idea why. Does anyone know how can I fix? For now I was just opening an old version of the file and copy and paste my changes in it, but it is extremely time consuming and I was hoping that he could be another faster way around that. If someone could just tell me what could be the cause of what would be a great help.

    Im working in Flash CS6 with AS3

    1046: type was not found or is not a constant of compilation: [flashx.textLayout.elements]: IFormatResolver.

    Well by going to settings publish Flash I realized that everything what happened past the Flash version he published as Flash player 9 Flash player No 11.4. I went on it and the error message no longer appears.

    Thanks for your help Ned.

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

    Hi all!

    I'm having a little difficulty with ActionScript 3 and I was wondering if someone could help me.

    I'm new to Flash CS5 and AS3, but I tried to create a sample track (originally single) application that allows the user to click on an image to start/stop an mp3, I had the initial sorting script where the button could toggle to go and stop the mp3. I tried hard for weeks, but as soon as I tried to package (to allow additions future script effects) he threw it to the top of the following error:

    C:\Users\Alice\Desktop\Prototype\com\app\Application.as, line 57

    1046: type was not found or is not a constant of compilation: URLRequest.

    Here is the code for the Application.as package

    package com.app {}



    to import flash.display.SimpleButton;

    import flash.media.Sound;

    import flash.media.SoundChannel;

    import flash.events.Event;

    import flash.display.MovieClip;

    import flash.events.MouseEvent;

    import flash.display.Sprite;

    import flash.net.URLLoader;


    SerializableAttribute public class Application extends MovieClip {}



    public var flag: Boolean;


    public void Application()

    {

    bozeat.addEventListener (MouseEvent.CLICK, bozeat_button_Handler);

    flag = false;

    }



    public void bozeat_button_Handler (e:MouseEvent): void {}


    bozeat_snd.load (new URLRequest ("drums.mp3"));

    if (flag == false) {}

    bzChannel = bozeat_snd.play (0, int.) MAX_VALUE);

    flag = true;

    trace ("true");

    { } else if(flag == true) {}

    bzChannel.stop ();

    flag = false;

    trace ("false");

    }

    }


    This is the error #1046: he keeps pointing me:

    bozeat_snd. Load (new URLRequest ("drums.mp3"));

    And here is the code for the .fla file

    import com.app.Application;

    App: var app = new Application();

    I named the document class for

    com.app.Application

    My mp3 is

    with an instance name of bozeat_sound drums.mp3

    I hope someone understands what I'm talking about lol. Sorry for the hassle for any help in advance thanks

    Alice19Eighty8

    You did not import flash.net.URLRequest

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

    I get this error message with my code:

    1046: type was not found or is not a constant of compilation: ResultEvent.

    The code that causes the error is line 10:
    private void checkLogin(evt:ResultEvent):void

    Help, please!

    I think you are missing import for ResultEvent statement.

    TIP: Hover your mouse coursor just after the word ResultEvent and then do ctrl + space, FB will insert the statement import for you.

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

    It worked yesterday so I have not what happened today?

    In the document class, I have a main swf with the 'Hero' inside mc

    1046: type was not found or is not a constant of compilation: Point.

    package {}

    import 12345678910111213import;

    import flash.display.MovieClip;

    import flash.media.Sound;

    import flash.events.Event;

    import flash.ui.Mouse;

    import flash.events.MouseEvent;

    import fl.transitions.Tween;

    import fl.transitions.TweenEvent;

    fl.transitions.easing import. *;

    import proyectos.trivia.TriviaEvent;

    public class game1SunnyWalk extends MovieClip {}

    private var v: Number = 5;

    varObject:String private var;

    i: Number private var;

    arrayObjects:Array private var;

    soundClip:Sound private var;

    randomnumber:Number private var;

    public void game1SunnyWalk() {}

    stage.addEventListener (MouseEvent.CLICK, myClickReaction);

    / / fill array and initialize the variables i and varObject

    this.arrayObjects = ["one", "two", "three", "four", "five"];

    this.i = 1;

    this.varObject = arrayObjects [i-1];

    }

    / / trace (varObject);

    / / speeds along the HYPOTENUSE

    / / point of mouse click

    var clickPoint:Point = new focus();

    public void myClickReaction(e:MouseEvent):void {}

    clickPoint.x = this.mouseX;

    clickPoint.y = this.mouseY;

    addEventListener (Event.ENTER_FRAME, onEnterFrame);

    addEventListener (Event.ENTER_FRAME, enterFrameHandler);

    }

    You must add

    to import flash.geom.Point;

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

    I am creating a Flash game and I'm at the point where I am trying to add blocks to my platform but want to do by script so that I can tell him where to place them on the stage rather than my having to do it manually. However, I now get the following errors and the code on mygame.as:

    1046: type was not found or is not a compilation constant: rect2020.
    var newObject:rect2020 = new rect2020();

    1180: call to a method may be undefined rect2020.
    var newObject:rect2020 = new rect2020();

    I mygame.fla in the library a movieclip to rect2020 which is essentially a 20 x 20 image I had created in fireworks and imported into the library. Is there something special I need to do? my code is attached:

    You must assign a class name to the element in the library. Did you do that? If not, then right-click on it in the library and select the binding element in the menu. In the interface that appears, select the export for actionscript option and the name of mc should automatically fill in the class field. Remember, it is that your code calls (rect2020).

  • 1046: type was not found.

    I tried to insert a clock in an ActionScript file, but it came out wrong. Specifically, it gave this error:

    1046: type was not found or is not a constant of compilation: TimerEvent.

    I'm not experiented it rules of Object Oriented programming, so it's a bit difficult to find errors.

    -Kasper

    Try:

  • 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: 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.

  • 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.

  • 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 in the ActionScript 3: 1046: Type was not found or...

    Hello

    I am completely new to the FLAS and AS3. I am creating an opacity slider by using the slider. I found a similar tutorial and tried to change it to fit to my needs opacity. In line 8 (function opacityChange (event: SliderEvent): void {}) I get the 1046 error message. When I test in Flash the cursor flashes on light up very quickly too. Although I searched, I am clueless as to what is the problem.

    Any help will be appreciated.

    Thank you!!

    importfl.events.SliderEvent;

    percent_txt. Text = "% opacity: 0 '. » ;

    Slider.Value = 0;

    slider.addEventListener (SliderEvent.CHANGE, opacityChange);

    function opacityChange (event: SliderEvent): void {}

    percent_txt. Text = "% opacity:"+ event.target.value; "

    logo.Alpha = event.target.value;

    }

    This should be:

    import fl.events.SliderEvent

    (and you need a slider component in your library or you will raise and 1172 error):

    1172: definition fl.events:SliderEvent could not be found.
  • 1046: type was not found or is not a constant of compilation: SQLConnection.

    Appologise I posted this earlier and thought I had fixed it, but I did not

    I'm trying to update, insert, drop etc tables in a database from a class file.

    The class file is called from a fla not an air application and when I try and run it I get the error 1046 on each instance of sql related, he claims that my imports are defined. Is there an Air application to access a database?

    If what I'm doing wrong. These are my imports

    import flash.events.SQLErrorEvent;
    import flash.events.SQLEvent;
    import flash.data.SQLConnection;
    import flash.errors.SQLError;

    And I try the basics:

    var updateStmt:SQLStatement = new SQLStatement();
    updateStmt.sqlConnection = conn;
    updateStmt.addEventListener (SQLEvent.RESULT, updateHandler);
    updateStmt.addEventListener (SQLErrorEvent.ERROR, errorHandler);
    updateStmt.text = "statement;
    updateStmt.execute ();

    function updateHandler(event:SQLEvent):void {}
    trace ("updated successfully");
    }
    function errorHandler(event:SQLErrorEvent):void {}
    trace (Event.Error);
    }

    It fails on every line with SQL in it.

    Any help would be appreciated, I don't want to make the file an Air application

    Thank you

    Yes.

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

    How to solve this error? I'm a little lost here (again)...

    This is my code:

    loader.addEventListener (ProgressEvent.PROGRESS, onProgress);

    loader.addEventListener (Event.COMPLETE, onComplete);

    function onProgress(e:ProgressEvent): void

    {

    var loaded: number = loader.bytesLoaded;

    var total: Number = loader.bytesTotal;

    preloader_mc.scaleX = 1-(load/total);

    }

    function onComplete(e:Event): void

    {

    removeChild (preloader_mc);

    removeChild (loadLogo_mc);

    }

    Kind regards!

    Fernandes

    You probably have a lot more errors in your code if this is the case.  What I gave is a must have, so if he has only increased your errors, this means that fixed an error allowed for many other errors which have not yet been disclosed to appear.  The compiler often generates errors in stages, not all at once.

    If you need help to create a preloader, here is a link to a tutorial that should help you...

    http://www.gotoandlearn.com/play?ID=85

    It allows to display the full error messages you get.  They help to give an idea of where the problems lie.

Maybe you are looking for

  • my macbook pro is running yosemite with several kernel panics

    I have problems sending messages and providing a copy of the panic the kernel connects what to do? It is said contains invalid characters.

  • Qosmio X 775-Q7384 bought in USA - Service in Europe?

    Hello I bought a laptop Qosmio X 775-Q7384 of the United States.Currently im living in Bosnia-and Herzegovina &. After 1 month, one of the HARD drive has failed and will need replacement.I need to know if I can deliver/ship the defective material to

  • need drivers for hp 2000 ACPI\ASD0001\2

    I can't use the HDMI or the PCI port, pilots need and I can not find them anywhere, it's a 2000 HP by using 64-bit windows 8 and the syntactic PCI\VEN_10EC & DEV_5229 & SUBSYS_2128103C & REV_01\00000001004CE00000 and ACPI\ASD0001\2 & DABA3FF & 1 (it

  • When I close a program, it seems that the page is molten! What are the causes that

    Just as I said, when I close my Internet explore the page looks as it melts down. When I close the Office computer looks like it is melting. What are the causes and how can I fix what is wrong I ran mcafee and malware programs. I have compaq presario

  • Why does my PDF files appear as word documents?

    My PDF files are displayed as icons in word document and I don't know why. I can still open them as a PDF file just right click and then go to 'Open with' but I prefer them rather to open as a PDF immediately. I did some research and most popular ans