referring to the movieclips on stage in a table problem

I have a movieclip on the stage in which I have a few 90 movieclips on the stage.

I created a table to organize clips.

But when I try adding eventlisteners to these movieclips in cycling through the table, I get an error 1009 ("could not parse the XML code. Error #1009: cannot access a property or a method of a null object reference. ('') Curiously, however, the application seems to work fine, manage my listener events.

However, if I add eventlisteners for each movieclip individually, everything works fine - no error is thrown.

Can someone please point out my error?

I found the problem...

I feel sheepish on the subject, but I misspelled of MovieClip instance names in the code (there are 90 of these clips).

This is why the error was generated, but some parts of the application still work.

Thanks to all who responded!

Tags: Adobe Animate

Similar Questions

  • Remove the movieclip from stage

    I have a movie clip on stage that contains 10 frames.

    I need scrip on the last image to remove the clip from the scene.

    any idea?

    this.parent.removeChild (this);

  • the cell's overflow to find table - problem with script

    Hello

    as a translation company, we often do some DTP on Framemaker documents. Documents often contain many tables and the translated text will always enters the cells, giving overflow. I'm looking by creating a script that detects the overflow in the table cells.

    I already tested a few scripts and met today with a problem that I can't find. I started detecting overflow from the cells in a selected table, that works very well and gives an alert when an overflow is detected. This script:

    // == WORKS ON SELECTED TABLE ==
    var doc = app.ActiveDoc;  
    var tbl = doc.SelectedTbl;  
    var row = tbl.FirstRowInTbl;  
    var cell;  
      
    while (row.ObjectValid () === 1) {  
        cell = row.FirstCellInRow;  
        while (cell.ObjectValid () === 1)  {  
         if (cell.Overflowed === 1) {  
      alert("cell overflow Will Robinson!");
      }
            cell = cell.NextCellInRow;  
        }  
        row = row.NextRowInTbl;  
    }  
    // == END OF WORKS ON SELECTED TABLE ==
    

    However, I thought it would be nice to browse tables in a document and find all the cells of overflows, instead of going to table by table. If this script runs successfully in tables, lines and cells in a document:

    // === LOOPS THROUGH TABLE, NO OVERFLOW ===
    var doc = app.ActiveDoc;
    var tbl = app.ActiveDoc.FirstTblInDoc;
    var row = tbl.FirstRowInTbl;
    var cell;
    
    
    while (tbl.ObjectValid()) {
      alert ("gimme a table");
      while (row.ObjectValid () === 1) {
      cell = row.FirstCellInRow;  
      while (cell.ObjectValid () === 1)  {  
      alert("gimme a cell");
      cell = cell.NextCellInRow;
      }
      row = row.NextRowInTbl;
      }
    tbl = tbl.NextTblInDoc;  
    }    
    // === END OF LOOPS THROUGH TABLE, NO OVERFLOW ===
    

    When I add the block

        while (cell.ObjectValid () === 1)  {  
         if (cell.Overflowed === 1) {  
      alert("cell overflow Will Robinson!");
    

    in this script, it does not work. According to the cell. Overwhelmed A requires the table to be selected? Does anyone know how to get around this problem - by selecting the table if the object is valid before performing a loop on the lines, or by the detection cell. A swamped in the above script?

    I also - why not :) - I tried overflow under the doc.flow rather than FirstTbl, but although it detects flowes/frameworks and subcol correctly, it is not always register the overflow.

    var doc = app.ActiveDoc
    var flow = doc.FirstFlowInDoc
    var frame = flow.FirstTextFrameInFlow
    var subcol =frame.FirstSubCol
    
    while (flow.ObjectValid()){        
                while (frame.ObjectValid()) {               
                        while (subcol.ObjectValid()){
                            if (subcol.OverFlowed === 1){
                            alert("colsies"); //doesn't work!
                            }
                            subcol = subcol.NextSubCol
                            }
                    frame = frame.NextTextFrameInFlow
                    }
                flow = flow.NextFlowInDoc
       }
    

    I'm clearly missing something, but I can't know what? Any help would be greatly appreciated...

    Kind regards

    Geert

    Your code in the second script isn't quite right. Try this:

    var doc, tbl, row, cell;
    
    doc = app.ActiveDoc;
    tbl = doc.FirstTblInDoc;
    while (tbl.ObjectValid ()) {
        row = tbl.FirstRowInTbl;
        while (row.ObjectValid ()) {
            cell = row.FirstCellInRow;
            while (cell.ObjectValid ()) {
                if (cell.Overflowed === 1) {
                    alert ("Cell overflowed");
                }
                cell = cell.NextCellInRow;
            }
            row = row.NextRowInTbl;
        }
        tbl = tbl.NextTblInDoc;
    }
    
  • Why I can't change the index of movieclips on stage? (createjs)

    What I want to achieve is relative, simply and works in Flash but not animate a reason any.


    On the stage, I have a movieclip called 'Subscript', with a field of dynamic text inside this type 'text '. I want to create a dyamically of box shape and place it inside the movieclip 'index' behind the 'text '. Here is my script:


    var hint = this.hint;
    var padding = 10;
    var text = hint.text;
    var limit = hint.getBounds ();

    Create forms
    var box = createjs new. MovieClip ('independent', 0, false, null);
    var rect = new createjs. Shape();
    var stroke = new createjs. Shape();

    Colors
    accident var stroke = "#000000";
    var bgcolor = "#FFFFCD";
    shadow of var = 'rgba (0, 0.3, 0.0);

    Draw shapes
    outline.graphics.beginStroke (AVC) .drawRect (bounds.x - padding, bounds.y - padding, bounds.width + (padding * 2), bounds.height + (padding * 2));
    rect.graphics.beginFill (bgcolor) .drawRect (bounds.x - padding, bounds.y - padding, bounds.width + (padding * 2), bounds.height + (padding * 2));
    Box.Shadow is new createjs. Shadow (shadow, 3, 3, 0);

    Add forms to hint
    box.addChild (rect);
    hint.addChild (outline);
    hint.addChild (box);

    Text to switch on the front
    hint.setChildIndex (text, hint.getNumChildren () - 1);

    Unfortunately, no matter what I do, the last line does nothing. The shape is always on the top text! Yet, this same exact file works perfectly well in Flash.

    After doing some additional testing, it seems to me the the ' plan ' and 'rect' is drawn on the text at each tick. So, although the index of 'text' is changed, the forms are are then immediately pull out the top of it.

    I don't know why this has changed from Flash, it looks like a bug to me.

    UM...

    // text must already have been on stage for at least one frame
    
  • Help to copy the timeline of the movieclip on the stage of chronology for exporting .mov

    Hello

    I'm under Flash CS5 on a Macbook Pro, version 10.6.8.

    I'm trying to convert .swf to a .mov to an animation I created. I already tried the 'export' in Flash Basic options, but it exports only the "scene 1" first frame and not the real movieclip (648 images) I created which is placed in the scene 1.» Of after online videos / websites, I've gathered that I need to copy the movieclip on the stage 1 layers and then export that normally. While I can do (select the layer of the timeline of the movieclip, make a right click Copy frames and then paste this layer in scene 1), glued on the stage of the layers are out of the original (movieclip). Is there a quick way to move all layers in the timeline (frames) the scene 1 without losing their location on the stage? It is a fair way to export the movieclip in. MOV directly without messing with the parent stage 1?

    Thanks in advance!

    If you stretched it scenario main enough to show all the images in 645 and there not animate, implying that there are more nesting inside that you need to take into account. You'll need transform these MC incorporated into graphics so and stretch out them to full length.

  • Question: adding the movieclip even at the stage

    Hi all

    This small class adds the same movieclip on stage with random scale and position

    Garden represents a movieClip in the library

    attached FLA and the document class

    My question:

    Why use the garden of name for all instances of the garden is not a problem?

    Can I track each individual instance of the garden to the screen or remember it for something else?

    package {}
    import flash.display.MovieClip;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    SerializableAttribute public class GardenClass extends MovieClip {}

    private var timer: Timer = new Timer (100);

    public void GardenClass (): void
    {init () ;}

    public void init (): void
    {timer.addEventListener (TimerEvent.TIMER, makeGarden);
    Timer.Start ();
    }
    private void makeGarden(e:TimerEvent):void
    { var Garden: Garden = new Garden(); }
    garden.scaleX = garden.scaleY = Math.Random ();
    Garden.x = Math.random () * this.stage.stageWidth;
    Garden.y = Math.random () * this.stage.stageHeight;
    this.addChild (garden);
    }
    }
    }

    This is because the instance is create in the scope of the function. Compiler, perhaps, assign unique to each instance pointers.

    In order to follow them, you can take several approaches.

    May be to give a unique instance name. In your case because there is only one instance of the garden the instance of GardenClass - will be needed to name the instances of GardenClass:

    var gardenInst0:GardenClass = new GardenClass();

    gardenInst0.name = "garden_0";

    var gardenInst1:GardenClass = new GardenClass();

    gardenInst1.name = "garden_1";

    var gardenInst2:GardenClass = new GardenClass();

    gardenInst2.name = "garden_2";

    then you can read them as:

    trace (gardenInst2.Name);

    Or:

    trace (this ["garden2"]);

    If you want to learn how to garden instance in an instance of GardenClass you need to make it accessible/public:

    package {}
    import flash.display.MovieClip;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    SerializableAttribute public class GardenClass extends MovieClip {}
           
    private var timer: Timer = new Timer (100);
    declare the garden in the scope of class

    var private garden: Garden;
    public void GardenClass (): void
    {init () ;}
           
    public void init (): void
    {timer.addEventListener (TimerEvent.TIMER, makeGarden);
    Timer.Start ();
    }
    private void makeGarden(e:TimerEvent):void
    { 

    Garden = new Garden();
    garden.scaleX = garden.scaleY = Math.Random ();
    Garden.x = Math.random () * this.stage.stageWidth;
    Garden.y = Math.random () * this.stage.stageHeight;
    this.addChild (garden);
    }

    This method allows to access the instance of garden

    public function getGarden (): Garden {}

    return the garden;

    }
    }
    }

  • Set the movieclip to the stage

    Here is my code, I don't know why it is not f ' ing work?

    function newBomb() {}

    var newBomb = attachMovie ("bomb", "bomb");

    newBomb._x = 200;

    newBomb._y = 200;

    }

    newBomb();

    Please tell me what stupid thing I did.

    And Yes, the linkage/properties of the movieclip in the library are correct (link: bomb).

    Try to avoid using the same name for different things and see if it works.  Name of the instance, which is the same as the linkage and not to name the same as the function variable.

  • "If the child on stage can do this."

    Is this possible? And if so, how do I do it? With a boolean value?

    My code is

    Game1.addEventListener ("Credit", ontermine);

    function ontermine(evt:Event)

    {

    removeChild (game1);

    dispatchEvent (new Event ("startmusic"));

    }

    And I want is when the musicgo1 movieclip on stage, the startmusic event is distributed, but is not something else.

    Could someone please help or explain to me?

    use

    If (getChildByName ("musicgo")! = null) {}

    }

    then

  • How to rotate the movieclip with drag and drop?

    Hello everyone,

    I work with drag and drop game.

    I'm done with drag and drop. now, I have problem in totating the movieclip.

    I want video clip rotate using the mouse. Do not use the click mouse. !!!

    Can someone give me a solution for this?

    var isDrageen:Boolean;

    var lastX:Number;

    var derriГЁre: Number;

    var dragX:Number;

    var dragY:Number;

    stage.addEventListener (MouseEvent.MOUSE_DOWN, down);

    stage.addEventListener (MouseEvent.MOUSE_UP, up);

    stage.addEventListener (MouseEvent.MOUSE_MOVE, mov);

    function down(e:MouseEvent):void {}

    isDrageen = true;

    lastX = mouseX;

    derriГЁre = mouseY;

    }

    function up(e:MouseEvent):void {}

    isDrageen = false

    }

    function mov(e:MouseEvent):void {}

    {if (isDrageen)}

    dragX = mouseX-lastX;

    dragY = mouseY-derriГЁre;

    MC.rotationY += dragX/1.65;

    MC.rotationX += dragY/1.65;

    lastX = mouseX;

    derriГЁre = mouseY;

    }

    }

  • Help (recovery of the image of an xml file name, then appear inside the movieclip

    Hello guys, I just want to ask sometihng about the display of the image inside the movieclip by pulling on the image name in the xml file.

    It comes to my xml file.

    <? PHP

    Header ("Content-type: text/xml");

    $host = "localhost";

    $user = 'root ';

    $pass = "";

    $database = "test";

    $gelo = "image1.jpg";

    / * xml output * /.

    $xml_output = ' <? XML version=\"1.0\? > ';

    $xml_output. = "< GALLERY > ';

    $xml_output. = '< IMAGE > '. $gelo. "< / IMAGE >";

    $xml_output. = "< / GALLERY > ';

    echo $xml_output;

    ? >

    This is the code inside my actionscript

    stage.scaleMode = StageScaleMode.NO_SCALE;

    var loader: URLLoader = new URLLoader();

    loader.dataFormat = URLLoaderDataFormat.TEXT

    loader.addEventListener (Event.COMPLETE, loadCompleteHandler);

    loader.load (new URLRequest ("http://localhost/loadimagefromxmlAS3/data.php"));

    function loadCompleteHandler(event:Event):void {}

    var xml = new XML (event.target.data);

    txt.text = xml.toXMLString ();

    trace (xml. IMAGE [0]);

    var list: XMLList = xml.data.title

    var loader: Loader = new Loader()

    This ["holder_mc" + 0]. AddChild (Loader)

    Loader.Load (new URLRequest (list [0]. IMAGE))

    }

    When I run it in flash, I got the error


    Image1.jpg

    TypeError: Error #1010: a term is undefined and has no properties.

    at xml_fla::MainTimeline/loadCompleteHandler()

    at flash.events::EventDispatcher/dispatchEventFunction()

    at flash.events::EventDispatcher/dispatchEvent()

    at flash.net::URLLoader/onComplete()

    I hope you will consider my ignorance since im a beginner with actionscript. Thank you

    (1) you should have "Permit debugging" enabled in the settings of publication so you could tell exactly the line of witch will not

    (2) this line makes no sense for me: var list: XMLList = xml.data.title

    Change it to var list: XMLList = xml. IMAGE;

    (3) loader.load (new URLRequest (list [0] m:System.NET.SocketAddress.ToString (()));

    (4) also this line is suspicious: this ["holder_mc" + 0] .addChild (loader)

    Why not just say: holder_mc0.addChild (loader)?

  • I need help which extends the MovieClip class

    I want to add a property to the MovieClip class. I have just a bunch of clips that are placed on the stage by reading an XML file and creating lots of clips from the information in them. Now, I need to know what MovieClips were created under previous clips, and I think that the best way to do it would be extending the MovieClip class and add a property of the order.

    I have some problems however: I do not know how to set or get this property of order within the main Clip, I do not know how to put this clip in my movie, and I don't know how to create them dynamically (just do something like var myNewObjectOfExtendedClass: myExtendedClassName = new myExtendedClassName?)

    This is the code that I have on my category Advanced, called Expando.as:

    Expando class extends MovieClip {}

    _order:Number private var;

    public function get command (): number {}

    return _order;

    }

    order(nOrder:Number):Void {} public function public set

    _order = nOrder;

    }

    }

    I recommend that you see for the tutorial of the tree in order to see how this should be done.  I think you are missing some basics.

  • Scene make dark when the movieclip is opened. AS3

    I am trying to create an effect that when someone clicks on a button, it opens a movieclip.  I want everything behind this movieclip to dark so that the only option is to click a button in the open movieclip.  Does anyone know how to do this?

    You could probably create a movieclip that is a stage size black box that you make visible/invisible if necessary and place just behind the movieclip selected in the index of the child order.  The first thing you need to do is to get the movieclip that was clicked to the highest index of the children in the film (numChildren-1) and the black movieclip would be awarded to the second highest high... (numChildren-2).

    You may need to assign a set of event listeners pout with the dummy event handler functions to the black area in order to block whatever it is clickable below.  The alternative would be to have something that disables all other clickable objects until disappearance of the black area.

    If your background is black, another approach would be to do everything except the movieclip that was clicked invisible.

  • To access the MovieClip instances in a loaded SWF file

    The situation as follows:

    loadedSWF.swf (published with Flash Player 8 AS2 or AS3 of Alpha Flash Player 9), contains on the symbols of the stage with the instance names: clipA, clipB, clipC, etc... No ActionScript is included in the file.

    In a Flex Builder 2.0 project, a component that extends mx.core.UIComponent load loadedSWF.swf:

    script
    var request: URLRequest = new URLRequest ("loadedSWF.swf");
    loaded var: Loader = new Loader();
    Loaded.Load (request);
    addChildAt(loaded,0);


    loadedSWF.swf successfully is displayed in the component's display list, but MovieClip instances that it contains are inaccessible.

    Its existence is verified:

    script
    trace (getChildAt (0)) / / result: [object Loader]
    trace (getChildAt (0) .root) / / result: [object _system_mx_managers_SystemManager]

    However, even if .root getChildAt (0) returns a mx.managers.SystemManager and mx.managers.SystemManager supports the numChildren property, trace (getChildAt (0).root.numChildren) survey error: 1119: access of the numChildren property possibly not defined through a reference with static type flash.display:DisplayObject.. Other methods like getChildAt(), etc. are also impossible to call. Direct access with getChildAt (0).root.clipA also throws an error, etc...

    Is it possible to access instances of the MovieClip on the stage of the loaded SWF file of a component that loads? I would appreciate any advice on this issue.

    a.Neko


    Note:
    The goal is to be able to load multiple clips into a component in a single loading of SWF file, then to instantiate the separately if necessary with addChild() and addChildAt() methods.

    Solution found:

    (Checked for loadedSWF.swf published with Adobe Flash Professional 9 Alpha Public)

    script (excerpt from Flex 2.0 AS3 component class)

    protected var clip: MovieClip = new MovieClip();

    protected final void requestSWF(value:String):void {}
    var request: URLRequest = new URLRequest (value);
    var asked: Loader = new Loader();
    requested.contentLoaderInfo.addEventListener (Event.COMPLETE, this.onRequestSWFComplete);
    requested. Load (request);
    return;
    };

    protected final void onRequestSWFComplete(event:Event):void {}
    event.stopPropagation ();
    This.clip = event.target.content.clipA; conversion of a local variable.
    this.addChild (this.clip);
    return;
    };

    this.requestSWF ("loadedSWF.swf");

    Result: clipA is added separately to the display of the component list.

    a.Neko

  • By dragging the movieclip symbol

    Hi all

    I am referring to a source code available online and up to now arrived at this point and the existence of the problem. Currently at work so can't provide details ALSO, but about the problem is the following.

    I had the scene with other elements. The flash made box is supposed to appear after a user click on a button symbol. There are 2 buttons of symbol that will be clicked and show the 2 done flash box one at a time.

    I made a movieclip symbol which covers the entire scene with alpha 0. A transparent movieclip. are entered into the movieclip and created the 1st done flash window with 3 images on each layer on a total of 6 layers which are headers, header, upbtn, dwnbtn, bg, dynamic textfield. 1 setting of each layer is empty frames. 2nd frame of each layer contains the things mentioned above.

    the 2nd flash render window is the same order as above, but they reside on the 3rd frame of each layer instead of 2nd frame. Thus so, 1e-2e framework on this 2nd flash window is empty. This means that these 2 done flash windows lies in the same movieclip, but at different levels and different frames.

    Hope that everyone can get the picture I'm painting here.

    After the publication, I click the btn symbol, ONLY the dynamic textfield was released. the rest of the upbtn, the dwonbtn, the headers, the header, bg are all invisible. BUT, when I put my cursor to the position where the above items are supposed to be, work items. I can drag, close it, highlight the textfield and down using inclinometer. Sometimes the other symbol of btn as well.

    How is it that they are invisible? I try to put the layer of transparent movieclip symbol on the bottom of the folder, it still does not work. If the problem lies in the transparent movieclip, then why does the textfield appear? I went from the TextField to the layer below in the movieclip while the rest of the layers as headers, header, bg, upbtn and downbtn are on top of it. but it still does not work.

    I don't think that's the number code, but more on the layers and frames the subject also drag and closing activities. does the dynamic textfield scrolling using the upbtn and downbtn.

    Please help me. Thanks in advance.

    In the end, I looked for other examples and found a way to use another method.

    It is to play with the visibility. Quite lame. but I had no choice.

  • My cd-rom has dissapeard when parsing it referred to the 39 failure

    My cd-rom has dissapeard when parsing it referred to the 39 failure

    Depending on the operating system, try following the steps under "Windows 7 or Windows Vista" or "Windows XP" in the MS KB article:

    http://support.Microsoft.com/kb/982116

    These measures, to remove the UpperFilters and LowerFilters, values if they exist, in the registry key named can help.

    Create a System Restore Point beforehand and restart the computer later.

Maybe you are looking for

  • iMovie does not detect iTunes

    Hello, my iMovie 11 suddenly stopped iTunes detection in the field of music and sound effects. I did a lot, a lot of videos and have always been able to navigate audio in my iTunes.

  • WiFi connectivity weird when I plug in the USB Flash drive?

    I found this WiFi connection problem a few days ago, when I plugged a USB Flash drive in "USB port right side' of my MacBook Pro. Every time when USB , WiFi won't work - the connection is lost and can not connect to any hotspot even turn the WiFi mar

  • What can I do for my windows xp to improve the vid card?

    Hello I want to upgrade the video card for my windows xp, but I think that he have one I think there a video onboard built in... what should I do... .the details of my pc are all here http://support.HP.com/us-en/document/c00283344 Thanks guys I hope

  • How to install 3.6 and 4.0 on different profiles?

    I have FF 4.0. I want to stay with it because it improves. In the meantime, 3.6 has been faster between tabs, and most of the loading sites. How do I load FF 3.6 and put it on a different profile.

  • Can Qosmio G50 - 10I - I increase the RAM?

    Hello I have the Qosmio G50 - 10I OS Windows 7 64 bit with 4 096 (2 048 + 2 048) of RAM MB DDR2 RAM (800 MHz) memory technology. I noticed that behind the laptop there is only or not that I can see the two places for the memories. The question is can