Error 1180

the code below is trying to generate a raw object, duplicate it n times and, replace it in a different random position
so i made the code in this way:
var dustRaw:MovieClip;
var dust:MovieClip;
function dustRawGen() {
    dustRaw.graphics.beginFill(0xFF0000);
    dustRaw.graphics.drawEllipse(0,0,1,1);
    dustRaw.graphics.endFill();
function dustGen() {
    for (var i:int = dustArray.length; i<=dustCount-1; i++) {
        dust = new dustRaw();
        addChild(dust);
        dust.x = Math.random() * (rBound-lBound) + lBound;
        dust.y = Math.random() * (dBound-uBound) + uBound;
        dustArray.push(dust);
        tailArray[i] = new Array();
dustRawGen();
dustGen();
but when i test it, there is an error on the bolded line
1180: Call to a possibly undefined method dustRaw.
did anyone know why?
thanks for any help

if dustRaw is an ellipse creating class, you would use it from another class.  for example, if you want to use it from the dustGen class:
// dustRaw.as:
package{
     import flash.display.MovieClip;
          class dustRaw extends MovieClip {
              public function dustRaw(){
                   graphics.beginFill(0xFFFFFF);
                   graphics.drawEllipse(0,0,15,15);
                   graphics.endFill();
// dustGen.as:
package{
import dustRaw;
public class dustGen{
private var dust:dustRaw
public function dustGen() {
    for (var i:int = dustArray.length; i<=dustCount-1; i++) {
        dust = new dustRaw();
        addChild(dust);
        dust.x = Math.random() * (rBound-lBound) + lBound;
        dust.y = Math.random() * (dBound-uBound) + uBound;
        dustArray.push(dust);
        tailArray[i] = new Array();
p.s.  you should use generally accepted coding standards:  your class names should start with an upper case letter, eg DustGen and DustRaw would be what coders expect to see.

Similar Messages

  • Error 1180 : undefined method stop and gotoAndStop

    Error 1180 : undefined method stop and gotoAndStop
    i don't know why
    Here ,, it's my code is file [.as] and i use as3
    package {
              import flash.display.*;
              import flash.events.*;
              import flash.text.*;
              import flash.utils.Timer;
              import flash.media.Sound;
        import flash.media.SoundChannel;
              import flash.net.URLRequest;
              public class MemoryGame extends Sprite {
                        static const numLights:uint = 5;
                        private var lights:Array; // list of light objects
                        private var playOrder:Array; // growing sequence
                        private var repeatOrder:Array;
                        // timers
                        private var lightTimer:Timer;
                        private var offTimer:Timer;
                        var gameMode:String; // play or replay
                        var currentSelection:MovieClip = null;
                        var soundList:Array = new Array(); // hold sounds
                        public function MemoryGame() {
                                  //soundBG.load(new URLRequest("soundBG.mp3"));
                                  //soundBG.addEventListener(Event.COMPLETE,loadSoungBgComplete);
                                  stop();
                                  StartBtn.addEventListener(MouseEvent.CLICK, clickStart);
                                  function clickStart(e:MouseEvent){
                                            gotoAndStop("startPage");
                                  // load the sounds
                                  soundList = new Array();
                                  for(var i:uint=1;i<=5;i++) {
                                            var thisSound:Sound = new Sound();
                                            var req:URLRequest = new URLRequest("note"+i+".mp3");
                                            thisSound.load(req);
                                            soundList.push(thisSound);
                                  // make lights
                                  lights = new Array();
                                  for(i=0;i<numLights;i++) {
                                            var thisLight:Light = new Light();
                                            thisLight.lightColors.gotoAndStop(i+1); // show proper frame
                                            thisLight.x = i*90+100; // position
                                            thisLight.y = 175;
                                            thisLight.lightNum = i; // remember light number
                                            lights.push(thisLight); // add to array of lights
                                            addChild(thisLight); // add to screen
                                            thisLight.addEventListener(MouseEvent.CLICK,clickLight); // listen for clicks
                                            thisLight.buttonMode = true;
                                  // reset sequence, do first turn
                                  playOrder = new Array();
                                  gameMode = "play";
                                  nextTurn();
                        // add one to the sequence and start
                        public function nextTurn() {
                                  // add new light to sequence
                                  var r:uint = Math.floor(Math.random()*numLights);
                                  playOrder.push(r);
                                  // show text
                                  textMessage.text = "Watch and Listen.";
                                  textScore.text = "Sequence Length: "+playOrder.length;
                                  // set up timers to show sequence
                                  lightTimer = new Timer(1000,playOrder.length+1);
                                  lightTimer.addEventListener(TimerEvent.TIMER,lightSequence);
                                  // start timer
                                  lightTimer.start();
                        // play next in sequence
                        public function lightSequence(event:TimerEvent) {
                                  // where are we in the sequence
                                  var playStep:uint = event.currentTarget.currentCount-1;
                                  if (playStep < playOrder.length) { // not last time
                                            lightOn(playOrder[playStep]);
                                  } else { // sequence over
                                            startPlayerRepeat();
                        // start player repetion
                        public function startPlayerRepeat() {
                                  currentSelection = null;
                                  textMessage.text = "Repeat.";
                                  gameMode = "replay";
                                  repeatOrder = playOrder.concat();
                        // turn on light and set timer to turn it off
                        public function lightOn(newLight) {
                                  soundList[newLight].play(); // play sound
                                  currentSelection = lights[newLight];
                                  currentSelection.gotoAndStop(2); // turn on light
                                  offTimer = new Timer(500,1); // remember to turn it off
                                  offTimer.addEventListener(TimerEvent.TIMER_COMPLETE,lightOff);
                                  offTimer.start();
                        // turn off light if it is still on
                        public function lightOff(event:TimerEvent) {
                                  if (currentSelection != null) {
                                            currentSelection.gotoAndStop(1);
                                            currentSelection = null;
                                            offTimer.stop();
                        // receive mouse clicks on lights
                        public function clickLight(event:MouseEvent) {
                                  // prevent mouse clicks while showing sequence
                                  if (gameMode != "replay") return;
                                  // turn off light if it hasn't gone off by itself
                                  lightOff(null);
                                  // correct match
                                  if (event.currentTarget.lightNum == repeatOrder.shift()) {
                                            lightOn(event.currentTarget.lightNum);
                                            // check to see if sequence is over
                                            if (repeatOrder.length == 0) {
                                                      nextTurn();
                                  // got it wrong
                                  } else {
                                            textMessage.text = "Game Over!";
                                            gameMode = "gameover";
    and i don't push any code
    at fla file
    why i got that help me plss
    that is my homework and i must send it today TT

    can you write how to use ?
    i write
    "import the flash.display.MovieClip; "
    still error ahhh
    i try to change extends MovieClip instead Spirt
    and not error stop(); and gotoAndStop Already
    but
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at MemoryGame/nextTurn()
              at MemoryGame/clickStart()
    i got thissssssss TT
    import flash.display.Sprite;
    import flash.events.*;
    import flash.text.*;
    import flash.utils.Timer;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.net.URLRequest;
    import flash.display.MovieClip;
    that i import

  • Whats wrong with this code? Error 1180.

    I keep getting the error 1180:Call to a possible undefined method getURL
    var jscommand:String = "window.open('www.adobe.com','win','height=1024,width=768,toolbar=no,scrollbars=yes');"; getURL("javascript:" + jscommand + " void(0);");
    Any help would be appreciated.
    Thanks guys.

    Got it.
    Thanks!

  • Error 1180: Call to a possibly undefined method class_name

    hi,
    i am new AS 3.0. When i try to compile my file it show the following error.
    1180: Call to a possibly undefined method ClassA.                                 var obj =new ClassA(10,10);
    My class file contains...
    class ClassA {
        public var Avg:Number = 0;
        public function ClassA(a, b) {
            Addit(a,b);
        public function Addit(aval:Number, bval:Number):Number {
            Avg = aval+bval;
            trace("Average - "+Avg);
            return Avg;
    i have called in flash file....
    import ClassA;
    var obj =new ClassA(10,10);
    Any help Pls....
    Ayathas

    i have modified my AS file as
    package TestPackage{
        import flash.display.Sprite;
    public class ClassA extends Sprite {
        public var Avg:Number = 0;
        public function ClassA(a, b) {
            Addit(a,b);
        public function Addit(aval:Number, bval:Number):Number {
            Avg = aval+bval;
            trace("Average - "+Avg);
            return Avg;
    i have included the document path in the properties panel as, TestPackage.ClassA
    now it show's following error message....
    ArgumentError: Error #1063: Argument count mismatch on AS::ClassA$iinit(). Expected 2, got 0.
    When i modifiy ClassA construnctor as follows, it works fine.
      public function ClassA() {
            var a = 10;
            var b = 10;
            Addit(a,b);
    how can i get input values from the user..........
    Thanks in Advance,
    Ayathas
    Message was edited by: ayathas

  • 1180 error on NavigateToURL

    I'm trying to understand why I get the error "1180: Call to a
    possibly undefined method navigateToURL." when I use the following
    code:

    Did you remember to include:
    import flash.net.navigateToURL;
    import flash.net.URLRequest;
    import flash.net.URLVariables;
    or even just:
    import flash.net.*;
    at the top of your package declaration?

  • 1180: Call to a possibly undefined method error for DEFINED method

    Hi,
    I have Document Class  main.Core  that in package main
    In the first frame of the .fla I have:
    stop();
    startGame();
    public function startGame():void {
           world = new World();
            world.startWorld();
    World is class in package world.
    I use import world.World;
    When I am tryng to export I get the error:
    1180: Call to a possibly undefined method startWorld.
    Can someone tell me why?
    Thanks.

    what's the following show:
    package world {
    import flash.display.MovieClip;
         public class World extends MovieClip {
              public function World():void {
    trace(this);         
              public function startWorld():void {
                   trace("b");

  • Error When Using Class :(

    Hey,
    Class:
    package
        import flash.display.MovieClip;
        import flash.events.Event;
        public class Main extends MovieClip
            public var enemyA:Array = [];
            public var birdA:Array = [];
            public var rowNum:int = 2;
            private var gap:int = 100;
            private var obj_no = 2;
            public var enemy1:mychar = new mychar();
            public var TheBird:BirdChar = new BirdChar();
            public function Main()
                // constructor code
                createEnemyF();
                createBirdF();
                this.addEventListener(Event.ENTER_FRAME,loopF);
            public function createEnemyF()
                for (var i:int = 0; i < rowNum; i++)
                    for (var j:int = 0; j < obj_no; j++)
                        enemy1.x = Math.random() * stage.stageWidth - enemy1.width;
                        enemy1.y = - i * (gap + enemy1.height) - 30.65;
                        enemyA.push(enemy1);
                        addChild(enemy1);
            public function createBirdF() {
                TheBird.x = 270.95;
                TheBird.y = 350.95;
                birdA.push(TheBird);
                addChild(TheBird);
            public function loopF(event:Event) {
                updateEnemyPositionsF();
                updateBirdPositionsF();
                hitTestF();
            public function updateEnemyPositionsF() {
                enemy1.y +=  2;
            public function updateBirdPositionsF() {
                TheBird.x = mouseX;
            public function hitTestF() {
                if(TheBird.hitTestObject(enemy1))
                    gotoAndPlay(5);
                    trace('The Bird Hit Enemy 1');
    This conflicts and causes this error:
    1046: Type was not found or was not a compile-time constant: MouseEvent
    ^ ^ Code repeats to all of my event listeners
    Thanks for your time.

    Thanks, i thought it might be this because of previous problems but i seen i already had : import flash.events.Event; so i thought that would be OK!
    Second Error:
    1180: Call to an undefined method Timer.
    I think this is the same sort of thing but what to import to fix this?
    So far these are my imports:
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.events.MouseEvent;
        import flash.events.TimerEvent;
    Thanks for helping.
    Date: Thu, 3 Nov 2011 05:36:22 -0600
    From: [email protected]
    To: [email protected]
    Subject: Error When Using Class
        Re: Error When Using Class
        created by markerline in Flash Pro - General - View the full discussion
    Looks like you imported events.Event but not events.MouseEvent (or some similar syntax) basically you must import MouseEvents separately from other Events.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4005227#4005227
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4005227#4005227. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Flash Pro - General by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • 1180: Call to a possibly undefined method box.

    So I have my class being called on the main timeline
    var test:box = new CustomBoxThing();
    //or
    var test:MovieClip = new CustomBoxThing();
    //then
    test.name = "someName1";
    addChild(test);
    And its not working so well for me, I keep getting error
    1180. I know I'm missing something basic, your help is much
    appreciated :)

    I do - both - although I thought flash would create the class
    for me on the fly anyway?
    The validator in the linkage says I see it. When I look up
    the error online, I find it says the error is thrown only in strict
    mode.
    import flash.display.*;
    import flash.text.*;
    import flash.events.*;
    var test:CustomBoxThing = new CustomBoxThing();
    addChild(test);

  • MouseEventExample.as, Line 1     1180: Call to a possibly undefined method addFrameScript

    Hi. I have a question about a Flash Help example which outputs an error, here - http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/MouseEvent .html?filter_flash=cs5.5&filter_flashplayer=10.3&filter_air=2.6#MOUSE_DOWN
    and the code is at the bottom of the page, in the Examples section, the MouseEventExample class.
    I have created an AS doc named MouseEventExample.as, put in a folder, the same as the one with the Flash pro file, have given the Flash pro file a document class name of MouseEventExample, but when i test movie, i get this error - 1180 addFrameScript, presumably on line 1 of the AS file, but there's no addFrameScript there at all.
    thanks for any help:)

    I just saw the answer to this - by kglad
    at
    http://forums.adobe.com/message/3085064#3085064
    i had some commented code in the timeline, which was the issue outputting this error.
    if u reply kglad, i can CorrectAnswer u/thanks again.

  • 1180: Call to a possibly undefined method... Possibly?

    I have buttons, that when clicked will create an instance in one of 3 movie clips within a movie clip.
    For instance, this works just fine:
    b_IF_4G5_TOP.addEventListener(MouseEvent.CLICK, b_IF_4G5_TOP_add);
    function b_IF_4G5_TOP_add(event:MouseEvent):void
    var b:MovieClip = new IF_4G5_TOP();
    b.name = "IF_4G5_TOP";
    layout.substrate.addChild(b);
    but this does not:
    p_conn_h.addEventListener(MouseEvent.CLICK, p_conn_h_add);
    function p_conn_h_add(event:MouseEvent):void
    var b:MovieClip = new PC_H(); <- This line produces this error: 1180: Call to a possibly undefined method PC_H.
    b.name = "p_conn";
    layout.connectors.addChild(b);
    Which is odd, because as you can see in the first example, I have not "defined" var b:MovieClip = new IF_4G5_TOP();
    Both objects exist in the library, are movie clips, both targets and objects are accuratley named and exist.
    Am I missing something obvious? Thanks in advance for your help.

    Thanks for the suggestions, guys.
    I did try renaming the movieclips, no success.
    The movieclips that work fine, like IF_4G5_TOP have no as linkage or anything. The code simply places a copy of the movieclip from the library onto the stage within its target movieclip.
    I even tried to change their target to the same target as the ones that work:
    layout.connectors.addChild(b);
    to
    layout.substrate.addChild(b);
    But no go...
    Why do you suppose an identical function would work in one case, but throw errors in another? It's seemingly irrational inconsistencies like this that are so frustrating about actionscript.
    Any ideas? Thanks again.

  • As3-cs4 package.as subclasses MovieClip, fla generates error 5000 anyway

    Hi, I am working with a trial version of Flash CS4 on a leopard intel mac.
    Starting with a clean os install, and a clean cs4 install I do the following
    start Adobe Flash CS4: Trial Version
    Select "I would like to continue to use this product on a trial basis" and continue...
    select create new Flash File (action script 3.0)
    open actions window
    type the following..
    trace("hello world");
    save file test_report.fla
    test file
    output ok.
    close swf window
    file > new > action script file
    type in the following code
    package {
        public class test_report{
            public function test_report(){
                trace("Hello world");
    select the test_report.fla tab
    fill in the "Class:" textbox of the property window with the string "test_report"
    click the pencil icon to test that pathing is ok, the UI opens test_report.as so it must be ok.
    test the movie
    2 errors
    1180: Call to a possibley undefined method addFrameScript
    5000: the class "test_report" must subclass 'flash.display.MovieClip' yada yada
    so add the offending line to the as file so that it looks like this..
    package {
        public class test_report{
            import flash.display.MovieClip;
            public function test_report(){
                trace("Hello world");
    save and test movie, same two errors
    AS IF I HAD NOT MADE THE ENTRY!
    NOTHING I CAN DO WILL MAKE THE ERROR GO AWAY
    obviously I am doing something wrong, please help!
    I only have 15 days left on the trial and I would really like to know I can get this to work on leopard!
    thanks
    rob
    Hardware Overview:
      Model Name:    iMac
      Model Identifier:    iMac7,1
      Processor Name:    Intel Core 2 Duo
      Processor Speed:    2.4 GHz
      Number Of Processors:    1
      Total Number Of Cores:    2
      L2 Cache:    4 MB
      Memory:    1 GB
      Bus Speed:    800 MHz
      Boot ROM Version:    IM71.007A.B03
      SMC Version:    1.20f4
      Serial Number:    W880759YX86
      System Version:    Mac OS X Server 10.5.6 (9G71)
      Kernel Version:    Darwin 9.6.0
      Boot Volume:    workSystem
      Boot Mode:    Normal
      Computer Name:    kbox
      User Name:    rob foree (robforee)
      Time since boot:    1:02

    Hi,
    First of all
    import flash.display.MovieClip;
    should be just after "package {" not "class... {"
    and
    public class test_report extends MovieClip
    report further situation

  • Calling a variable from inside a movieclip AS3 in Flash CS4

    I am trying to trace a variable string from inside a movieclip which is inside another movieclip on the main timeline using:
    trace(VariableString);
    and also
    trace(stage.VariableString);
    Neither work
    The variable is an input textfield and traces fine when it is on the main timeline but will not work from inside the movieclip. I am using Actionscript 3 in Flash CS4.
    I appreciate this has probably been discussed previously on this forum but I cannot find a difinitve answer that seems to work.
    Thanks

    Thanks for the reply. However this did not seem to work.
    I think I had better explain a little better.
    On Keyfrme1 I have a MovieClip1 containing a text input component. I have created a variable on keyframe 1 using:
    var VariableString1:String = new String();
    When clicking on a seperate button this happens:
    VariableString1 = MovieClip1.text;
    I can trace this correctly on the main timeline using:
    trace(VariableString1);
    However, if I try to trace this from  another keyframe inside a movieclip2 which is inside another movieclip3 using:
    trace(MovieClip1(root).VariableString1);
    I just get the error 1180 call to a possibly undefined method MovieClip1
    Sorry if this is not very clear but I am getting very confused with this.
    Thanks again

  • Simple question: sending data from as file to a swf

    hi,
    I'm new to AS3 language, so maybe this is a silly question.
    I'm using a Flash 3D visualization tool (Flare3D) to display 3D contents in flash.
    the project consist of a blank fla project and a .as file (main.as) that manage the creation and the diplay of 3D contents.
    Now I want to display the name of the 3D object that I select in a text box created in the fla.
    I wrote:
    in main.as
         var selectedMesh:String = e.target.name                //the 3D object I select
    in step1.fla, frame 1
         root.infoBox.infoBoxText.text = selectedMesh;          //where I want to display the name of the object I've selected
    When I publish the swf file, it report two errors:
    1180: Call to a possibly undefined method addFrameScript.
    1119: Access of possibly undefined property infoBox through a reference with static type flash.display:DisplayObject.
    what's the problem with that? maybe I nedd to extend movieClip class in main.as or something else?
    thank you

    First, you need to post more verbose errors with line numbers - figuring what lines of code from which object throw errors and will help you to pinpoint the source. Then post these offensive lines.
    Otherwise it is practically impossible to give you any suggestions (this is unless one has a christal ball)

  • Help with AS3, loading multiple files into a movieclip in specific order in scrollbar

    Hello! I am in need of some advice. We are trying to build a site with these features:
    Our site will be built in Actionscript 3.
    1. A navigation menu that, when a button is clicked, will scroll the site quickly to a specific Y position using swfaddress.
    2. The entire site is controlled by a flash scroll bar, which will be scrolling a single movieclip.
        2A. The movieclip will load content corresponding to the navigation categories, all which is organized into zipped files (using this to extract the contents of each section, example: about.zip for the about         section of the site)
        2B. The movieclip will load multiple zipped files one by one that correspond to the navigation, in order, making the site appear to be very tall.
    **What we are in need of is understanding how to load multiple zipped files into a movie clip, in a specific order, and having them scroll between one another through the navigation. The separate navigation categories can be in movieclips instead of zipped files if that is easier.
    Here is a reference of something that works like this: http://swfc-shanghai.com/#/about/

    Hello kglad! I have set aside the idea of using zipped files, and am now just using multiple external swfs that I'd like to load into the movieclip in a specific order. Any thoughts?
    I'm new to AS3, and I'm  attempting to create a scrolling movieclip that will load multiple  external files, in order, into that movieclip. I'm using XML as well. At  this point, nothing is loading into my movieclip (contentMain) and it's  a bit frustrating! Thank you for your help!
    Current error: 1180: Call to a possibly undefined method load.
    AS3:
    //XML Loader
    var myXML:XML = new XML();
    myXML.ignoreWhite = true;
    myXML.load ("master.xml");
    myXML.onLoad =function(sucess) {
       if (sucess) {
    contentMain.loadAll();{
         load("1_Overview.swf")
         load("2_Webcam.swf")
         load("3_Twounion.swf")
         load("4_Oneunion.swf")
         load("5_Retail.swf")
         load("6_Nearby.swf")
         load("7_Courtyard.swf")
         load("8_Map.swf")
         load("9_Conference.swf")
         load("10_News.swf")
         load("11_Sustainability.swf")
         load("12_Contact.swf")
    addEventListener("complete",onLoad)
    onLoad();{
    //load all
         }else {
             trace("ERROR LOADING XML");

  • Method not found ?!

    i write a method in the <script> markup :
    public function gotoURL(str:String):void {......}
    int the xml part,
    <mx:Component id="downloadListItemRenderer" >
    <mx:HBox width="100%" horizontalAlign="left"
    verticalAlign="middle">
    <mx:LinkButton click="gotoURL('dg')"
    label="{data.@name}"/>
    </mx:HBox>
    </mx:Component>
    Compilation ERROR : 1180 gotoURL undefined !
    I dont understand. Can you help me ?

    You have to write the script tag inside the compoent i.e.
    inside the HBox or LinkButton.
    try this -
    <mx:HBox width="100%" horizontalAlign="left"
    verticalAlign="middle">
    <mx:Script>
    <![CDATA[
    public function gotoURL(str:String):void {......}
    ]]>
    </mx:Script>
    <mx:LinkButton click="gotoURL('dg')"
    label="{data.@name}"/>
    </mx:HBox>
    It should work.
    If it does not then try putting the script tag inside the
    LinkButton.
    - Sameer

Maybe you are looking for