Multiple Instances of calling object getting Error #1009

Hello

I think it must be a logical explanation for this. I have the code here as follows:

private void action (): void {}

thematicMap.passBox (canvas, regions);
thematicMap.drawthematicMap.passBox (canvas);

Definition of the Web
thematicMap.setCanvas (0,0,30,50);
thematicMap.drawthematicMap.draw (regions);
thematicMap.setCanvas (24,24,453,455);
thematicMap.drawthematicMap.draw (regions);
}

This opens two instances of the thematicMaps, which is what works in main.zip. However, what I really want to do is the following:


private void action (): void {}

thematicMap.passBox (canvas, regions);
thematicMap.drawthematicMap.passBox (canvas);

a = new ThematicMap();
b = new ThematicMap();

Definition of the Web
a.setCanvas (0,0,30,50);
b.setCanvas (24,24,453,455);

Draw
a.drawthematicMap.draw (regions);
b.drawthematicMap.draw (regions);
}

The output of the application below is only a blank screen. I then studied and added some try and catch clauses to see what errors there are.

try {}
Definition of the Web
a.setCanvas (0,0,30,50);
b.setCanvas (24,24,453,455);
}
catch (errObject:Error) {Alert.show ("an error occurred:" + errObject.message) ;}}

The results I got was #1009 Error. How come that I've provided parameters and return is a null reference object?

Thanks for your help.

Alice

Jin

the null object reference must be provide a lot more information, and the question could be to what a & b relate to, is thematicmap, a component or a class that relies on the scene? More code is needed to see what is what.

David

Tags: Flex

Similar Questions

  • Local calling XML gives Error #1009: cannot access a null object

    Kind of perplexed as to what is happening...

    Calling a function "loadDownloads" which prepares to load a local file "downloads.xml" (located in the CBC even as the application mxml file); This XML file is very simple, containing a root 'downloads' with several 'download' elements it contains (each is a brief description and the url)

    I put my compiler settings for - use-network = 'false' to be able to load local XML file, and I use a HTTPService.send () to raise the load.  My HTTPService is defined as follows:

    <mx: HTTPService id="httpService" resultFormat="e4x" 
     fault="httpService_fault(event)" result="httpService_result(event)" />
    

    I put the default event handler until, in case of default, an alert indicates the error information; the result handler simply does the following:

    private function httpService_result(evt:ResultEvent):void {
         xmlContent = XML(evt.result);}
    

    Yes, all variables have been previously declared and typed.  This throws any errors (he did at the beginning, when I was incorrect for the URL file names and when I had the malformed XML instructions, so I know that Manager error works) to access the XML file

    However, when I try to access the nodes or elements in the XML document, I get this runtime Error #1009: cannot access method or property object, null, and of course, xmlContent shows as null.  Here's how I'm trying to access:

    for each (xmlDownload in xmlContent.downloads) {
         // do stuff here like...
         linkLabel.text = [email protected]();
    }
    

    All all all ideas why HTTPService is to see the XML file and says it's OK, but does not seem to extract the XML file in the xmlContent:XML object?

    Three service objects would be better.

    Also remember that you can not call a fair request after the other because you can have only active requires both.

    You must call each new request out of the resultHandler of demand of ends.

  • Getting error #1009 in my mp3 player

    Hello

    I am new to AS3 and flash. I'm making a mp3 player that plays multiple pieces through a playlist in an XML file. I get this when I try to test it.

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    at mp3player_fla::MainTimeline/frame1() [mp3player_fla. MainTimeline::frame1:35]

    TypeError: Error #1090: XML parser failure: element is incorrect.

    at mp3player_fla::MainTimeline/processXML() [mp3player_fla. MainTimeline::frame1:42]

    at flash.events::EventDispatcher/dispatchEventFunction()

    at flash.events::EventDispatcher/dispatchEvent()

    at flash.net::URLLoader/onComplete()

    Is happening here? The following XML code thus:

    <? XML version = "1.0" encoding = "utf-8"? >

    < songs >

    < = song name "Glow in the Dark" file = " " https://files.NYU.edu/gal287/public/audiofortheweb/glow-in-the-dark.MP3 " />

    < = song name "Kick" file = " " https://files.NYU.edu/gal287/public/audiofortheweb/kickstarter.MP3 ″ />

    < = song name "Lovers Walk" file = " " https://files.NYU.edu/gal287/public/audiofortheweb/lovers-walk.MP3 ″ />

    < = song name "Power Juice" file = " " https://files.NYU.edu/gal287/public/audiofortheweb/power-juice.MP3 " />

    < = 'Time to go' song name file = " " https://files.NYU.edu/gal287/public/audiofortheweb/time-to-go.MP3 " />

    < / songs >

    Thanks in advance!

    :

    function loadSong(mySong:Number): void {}

    var myFile = my_songs[mySong].@file;

    Song.Load (new URLRequest (myFile));

    myTitle var = my_songs[mySong].@name;

    songStatus_lbl.text = "play";

    nowPlaying_lbl.text = "Now Playing:";

    songTitle_lbl.text = "myTitle".

    If {(channel)

    Channel.Stop ();

    channel.removeEventListener (Event.SOUND_COMPLETE, nextSong);

    }

    song = new Sound();

    Song.Load (new URLRequest (myFile));

    Channel = song.play ();

    channel.addEventListener (Event.SOUND_COMPLETE, nextSong);

    play_btn.mouseEnabled = false;

    pause_btn.mouseEnabled = true;

    myTimer.start ();

    }

  • Flash help-trying to make movement buttons images (getting error 1009)

    Help! I am trying to create a portfolio site, and I want my photo strip to flow and then become buttons. I did the buttons, but once the tape stops I get this message.

    TypeError: Error #1009: cannot access a property or method of a null object reference.
    at portfolio_fla::MainTimeline/frame62()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()

    This is the code I have in the Panel actions

    Stop();

    LISTEN TO THE CLICK OF THE BUTTONS

    pics_mc.card_btn.addEventListener (MouseEvent.CLICK, cardClick);

    function cardClick(e:MouseEvent):void {}
    trace ("cardClick");

    }

    pics_mc.wine_btn.addEventListener (MouseEvent.CLICK, wineClick);

    function wineClick(e:MouseEvent):void {}
    trace ("wineClick");
    }

    pics_mc.edge_btn.addEventListener (MouseEvent.CLICK, edgeClick);

    function edgeClick(e:MouseEvent):void {}
    trace ("edgeClick");

    }

    pics_mc.group_btn.addEventListener (MouseEvent.CLICK, groupeCliquez here);

    function groupClick(e:MouseEvent):void {}
    trace ("groupClick");

    }

    pics_mc.romeo_btn.addEventListener (MouseEvent.CLICK, romeoClick);

    function romeoClick(e:MouseEvent):void {}
    trace ("romeoClick");

    }

    I am new to flash
    Thank you!

    1009 error indicates that one of the objects targeted by your code are out of reach.  This may mean that the object...
     
    n ' is not in the display list
    n ' is not have an instance name (or the name of the instance is misspelled)
    n ' is not in the frame where this code tries to talk to her
    -is animated in place, but is not assigned the name of the instances of each keyframe for her
    -is one of the two or more consecutive keyframes of the same objects without a name assigned in the image previous (s).
     
    If you go to your section to publish the Flash settings and select permit debugging option, your error message should have a suite of line number the number of the frame that will help you to isolate the object that is involved.

    Since you say that you move things in, I suspect the 4th listed element could relate to your problem, but it could be one of them.

  • Multiple instances of an object-oriented ScrollBar?

    Hi everyone, Ive went through the tutorial-oriented Scrollbar object on gotoandlearn.com. His works very well and I have several buttons inside the moveclip, he lives inside. The problem occurs when I create a new one on the same page. I put a 1 frame and the other on the 5 framework so that I can choose a 'category' and the scrollbar movieclip changes to the corresponding keys.
    Ive duplicated video clips and changed bodies accordingly. I get these errors in the exit reading my swf Panel;

    TypeError: Error #1009: cannot access a property or method of a null object reference.
    at as3_movieplayer_fla::MainTimeline/frame1()

    and when I click similar to the second category, it comes up with this error.
    TypeError: Error #1009: cannot access a property or method of a null object reference.
    at as3_movieplayer_fla::scrollbox_1/thumbUp()

    Not really sure what im doing wrong - or even what that means!

    Here is the code of my layer main actions;

    stop();

    //buttons

    btn_advertising.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    function mouseDownHandler(event:MouseEvent):void {
        gotoAndStop(1);
    }

    btn_corporate.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler2);
    function mouseDownHandler2(event:MouseEvent):void {
        gotoAndStop(5);
    }

    //video player script
    function videoOne(event:MouseEvent):void{
       vidPlayer.source = "flvs/ib_enginuity.flv";
       }
    function videoTwo(event:MouseEvent):void{
       vidPlayer.source = "flvs/ib_blists_hill.flv";
       }
    function videoOneCorp(event:MouseEvent):void{
       vidPlayer.source = "flvs/ib_explore_enjoy.flv";
       }
    function videoTwoCorp(event:MouseEvent):void{
       vidPlayer.source = "flvs/ib_great_year_visit.flv";
       }
      
    //text script
    function button1text(event:MouseEvent):void{
       textBox.text = "Ironbridge - Enginuity";
       }
    function button2text(event:MouseEvent):void{
       textBox.text = "Ironbridge - Blists Hill";
       }
    function button1CORPtext(event:MouseEvent):void{
       textBox.text = "Ironbridge - A Place to Explore and Enjoy";
       }
    function button2CORPtext(event:MouseEvent):void{
       textBox.text = "Ironbridge - A Great Year to Visit";
       }

    //event listeners
    scrollbox.content.button1.addEventListener(MouseEvent.CLICK,videoOne);
    scrollbox.content.button1.addEventListener(MouseEvent.CLICK,button1text);
    scrollbox.content.button2.addEventListener(MouseEvent.CLICK,videoTwo);
    scrollbox.content.button2.addEventListener(MouseEvent.CLICK,button2text);
    scrollboxCorp.content.button1Corp.addEventListener(MouseEvent.CLICK,videoOneCorp);
    scrollboxCorp.content.button1Corp.addEventListener(MouseEvent.CLICK,button1CORPtext);
    scrollboxCorp.content.button2Corp.addEventListener(MouseEvent.CLICK,videoTwoCorp);
    scrollboxCorp.content.button2Corp.addEventListener(MouseEvent.CLICK,button2CORPtext);


    and also the code of my layer actions inside my movieclip that is located on the frame of 5;

    import caurina.transitions.*;

    var yOffset:Number;
    var yMin:Number = 0;
    var yMax:Number = sb.track.height - sb.thumb.height;

    sb.thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbDown);
    stage.addEventListener(MouseEvent.MOUSE_UP, thumbUp);

    function thumbDown(e:MouseEvent):void
    {
       stage.addEventListener(MouseEvent.MOUSE_MOVE, thumbMove);
       yOffset = mouseY - sb.thumb.y;
    }

    function thumbUp(e:MouseEvent):void
    {
       stage.removeEventListener(MouseEvent.MOUSE_MOVE, thumbMove);
    }

    function thumbMove(e:MouseEvent):void
    {
       sb.thumb.y = mouseY - yOffset;
       if(sb.thumb.y <= yMin)
          sb.thumb.y = yMin;
       if(sb.thumb.y >= yMax)
          sb.thumb.y = yMax;
       var sp:Number = sb.thumb.y / yMax;
       Tweener.addTween(contentCorp, {y:(-sp*(contentCorp.height-masker.height)),
                            time:1});
       e.updateAfterEvent();
    }


    Please help me iron these problems!

    Thank you very much
    Dan Williams

    Unfortunately, I'm not getting errors after I added the name of the two instances and clicking around while in this article.

  • Game Score Update: get error 1009

    Hi all

    I have a simple puzzle game that has a score keeping mechanism. When you choose to display an 'idea', your score is supposed to be lowered. My game is set up with the main .fla file and an external actionscript 3.0 file.

    Problem is when I try to call the function to display the new score after changing, I get this error:
    "TypeError: Error #1009: cannot access a property or method of a null object reference."

    It was not a problem actually add the variable to the partition, because my record came out very well.

    I have no idea why it does that... Here's the code for the 2 files. I hope that someone will be able to help!

    NOTE: The part of the code that calls my .fla file is towards the bottom of the .AS file. I've included earlier that people could see how I got the variables for the defined score.
    ------------------
    File 1:. FLA file '
    (segment to within a clip called "Dominique")





    Well, I have found a workaround at least for the problem I had.

    For my Event.ADDED_TO_STAGE function onAdded, I got another call to a function outside on the main timeline. This function in turn recalls the consturctor function and passes a Boolean value. Flags to true if statement in the constructor which takes care of out my score back on the scene.

    It seems that my constructor function was the only one in my class who had access to scene, so it was the easiest way for me to take. Although I do not have to remind this function since it is against the purpose of a constructor... Well.

    It's weird I have a clip that is class identifier is the name of my SlidingPuzzle class. The only way I got access step was to call the constructor function of inside of this clip. (this is what finally solved my problem.

    For others who could be trapped in a similar place, I'll show the code that I used below:

  • I get error 1009 on my design page

    In the part of design when I try to move something I get TypeError 1009, please advice!

    Here are some ways to resolve this error:
    Adobe Muse | 1009 errors troubleshooting

  • Animation of Instances of an object created by a For loop

    I ' v been playing with this for a few weeks now and I will try to find the best way to animate multiple instances of an object created by looping through an ENTER_FRAME function. When the function runs only 1 of 3 instances created comes alive.

    var balloonArray:Array = new Array();
    var ball: hotAirBalloon;
    var xVel: number = - 3;
    yVel var: number = - 4;

    addEventListener (Event.ENTER_FRAME, startBalloons)

    for (var i: int = 0; i < 3; i ++)
    {
    ball = new hotAirBalloon;
    addChild (balloon);
    balloonArray.push (balloon) / / tried to push the bodies into an array
    setBalloons();
    }

    function setBalloons (): void
    {
    Balloon.x = randomRange (200, 400);
    Balloon.y = randomRange (400, 550)
    balloon.scaleX = balloon.scaleY = randomRange (0.3, 1);
    }

    function startBalloons(evt:Event):void
    {
    Balloon.y += yVel / / this anime only one instance

    Balloon.x += xVel
    }

    I also tried to push the object in a table in the loop and with the help of this balloonArray [i] there += yVel in the ENTER_FRAME function and I get an error message indicating that a term is not defined. I know there is a simple way to do this. Thank you.

    using splice(i,1) works well to remove the array ith element.  generally, you should browse paintings of late start if you remove elements from an array in a loop for.

  • Error #1009 - buttons on new executives

    Hello

    * I'm a little new to ActionScript 3 you must forgive my probably inaccurate descriptions, but here we deplacements.*

    I am developing a flash website and (surprise, surprise) I am using the buttons... but I get errors. I get error #1009 and think that I found the problem I am facing:

    The first group of 3 buttons (let's call group them A1 for clarity) is the Framework 1. Each of these buttons leads to its own subpage of 2 buttons (groups A2 - C2) that each leads to its own page (and, therefore, framework.)

    Here is a graph that illustrates my layout of the site, it also illustrates my love for graphics.

    graph.png

    I use your common code for the buttons, but I get the error #1009. I think it's because the buttons I've included in the code are in different time periods, despite the code being written in the same place.

    What should I do to fix this?

    Thank you

    Joshua

    You cannot reference a button using actionscript until it exists, or you will get this error 1009.

    for example, if the code for all of these buttons is on frame 1 of your main timeline, you add all these buttons to the stage in frame 1.

    because you want all these buttons visible on frame 1 to the start of your swf file you can use the visible property to control what the user sees (and does not).

  • Click and drag the shape tool creates multiple instances (w / photos)

    When I click on and drag a shape tool, illustartor creates multiple instances of the object, such as a card when you earn solitare.

    No idea what could cause this?

    Is your tilde ~ key down, or you have any plug ins installed that may be corrupt you system?

  • Error 1009 (call of the Null object) Flash CS4

    Hi all

    I am very new to Flash (this is my first attempt) and try to find a way to deal with this error I get.

    The code is supposed to animate a popup on a score to the mouse event.

    I'm really surprised, I did that well before letting mouth gaping.

    Please help, my brain hurts.

    Here is my code:

    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;

    var FishingSub_mc:MovieClip = FishingSub_mc;
    var Fishing_btn:SimpleButton = Fishing_btn;

    function FishingFlyout (event: MouseEvent): void
    {
    var FishingTween:Tween = new Tween (FishingSub_mc, "y", Regular.easeOut, 0, 40, 20, false);
    }
    Fishing_btn.addEventListener (MouseEvent.MOUSE_OVER, FishingFlyout);

    And here is the error I get:


    TypeError: Error #1009: cannot access a property or method of a null object reference.
    at menu_fla::MainTimeline/frame1() [menu_fla. MainTimeline::frame1:12]

    Thanks for your help.

    Dave

    You're welcome, Dave

  • ActionScript3 Error #1009: Cannot access a property or method of a null object reference

    Having a problem with the creation of a website in CC animate with ActionScript3.

    Any help would be appreciated.

    Basically, I'm trying to get 'home', 'services' 'contact' buttons work when you click "about".

    import flash.events.MouseEvent;

    Stop();

    header_mc.home_btn.addEventListener (MouseEvent.CLICK, gohome);

    gohome function (event: MouseEvent): void {}

    gotoAndStop (1);

    }

    header_mc.about_btn.addEventListener (MouseEvent.CLICK, goabout);

    function goabout (event: MouseEvent): void {}

    gotoAndStop (2);

    }

    header_mc.services_btn.addEventListener (MouseEvent.CLICK, goservices);

    goservices function (event: MouseEvent): void {}

    gotoAndStop (3);

    }

    header_mc.contact_btn.addEventListener (MouseEvent.CLICK, gocontact);

    function gocontact (event: MouseEvent): void {}

    gotoAndStop (4);

    }

    Ran the test after allowing debugging and myself

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    at WORKINGwebsite_fla::MainTimeline/frame1() [WORKINGwebsite_fla. MainTimeline::frame1:3]

    Chassis 1 line 3.

    1009 error indicates that one of the objects targeted by your code are out of reach.  This may mean that the object...

    -is declared but not instantiated

    n ' is not have an instance name (or the name of the instance is misspelled)

    n ' is not in the frame where this code tries to talk to her

    -is animated in place, but is not assigned the name of the instances of each keyframe for her

    -is one of the two or more consecutive keyframes of the same objects without a name assigned in the image previous (s).

  • TypeError: Error #1009: cannot access a property or method of a null object reference.      at FC_Home_A

    Dear Sir.

    I really need your help at the very last moment, I'm stuck, but I was about to finish a project. Here is the explanation below...

    I have two files called "holder.swf" and "slide.swf" i want to improt 'slide.swf' using this action below

    var myLoader:Loader = new Loader();

    var url: URLRequest = new URLRequest ("slide.swf");

    myLoader.load (url);

    addChild (myLoader);

    myLoader.x = 2;

    myLoader.y = 2;

    Also, I am attaching the flash file of "'holder.swf '." My concern is the time that I call the 'slide.swf' inside the 'holder.swf', it is showing the following error...

    " TypeError: Error #1009: cannot access a property or method of a null object reference. .

    to FC_Home_Ads_Holder_v2_fla::MainTimeline() .

    Here are the files downloaded for your reference, please download this file http://www.touchpixl.com/ForumsAdobecom.zip

    This error is being occurred file 'MainTimeline.as', here is the code used within this file below...

    package FC_Home_Ads_Holder_v2_fla

    {

    Import __AS3__.vec. * ;

    Adobe.utils import. *;

    com.danehansen import. *;

    import com.greensock;

    com.greensock.easing import. *;

    com.greensock.plugins import. *;

    flash.accessibility import. *;

    flash.desktop import. *;

    import flash.display. *;

    flash.errors import. *;

    import flash.events. *;

    flash.external import. *;

    flash.filters import. *;

    import flash.geom. *;

    flash.globalization import. *;

    import flash.media. *;

    flash.net import. *;

    flash.net.drm import. *;

    flash.printing import. *;

    flash.profiler import. *;

    flash.sampler import. *;

    flash.sensors import. *;

    flash.system import. *;

    import flash.text. *;

    flash.text.engine import. *;

    flash.text.ime import. *;

    flash.ui import. *;

    import flash.utils. *;

    flash.xml import. *;

    SerializableAttribute public class dynamics MainTimeline extends flash.display.MovieClip

    {

    public void MainTimeline()

    {

    new vector. < String > (6) [0] = "productivity."

    new vector. < String > (6) [1] = "Leadership."

    new vector. < String > (6) [2] = "Execution."

    new vector. < String > (6) [3] = "Education";

    new vector. < String > (6) [4] = "speed of trust";

    new vector. < String > (6) [5] = "Sales";

    Super();

    addFrameScript (0, this.frame1);

    return;

    }

    public void init (): void

    {

    var loc1: * = null;

    com.greensock.plugins.TweenPlugin.activate ([com.greensock.plugins.Aut oAlphaPlugin]);

    LOC1 = new flash.net.URLLoader (new flash.net.URLRequest (this. XML_LOC));

    loc2 var: *;

    This.next_mc.buttonMode = loc2 = true;

    This.prev_mc.buttonMode = loc2;

    stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;

    internship. Align = flash.display.StageAlign.TOP_LEFT;

    LOC1.addEventListener (flash.events.Event.COMPLETE, this.xmlLoaded, false, 0, true);

    This.prev_mc.addEventListener (flash.events.MouseEvent.CLICK, this.minusClick, false, 0, true);

    This.next_mc.addEventListener (flash.events.MouseEvent.CLICK, this.plusClick, false, 0, true);

    return;

    }

    public void xmlLoaded (arg1:flash.events.Event): void

    {

    var loc1: * = null;

    loc2 var: * = 0;

    this.xmlData = new XML (arg1.target.data);

    loc2 = 0;

    While (loc2 < this.) LABELS.length)

    {

    LOC1 = new Btn (this. LABELS [loc2], loc2);

    this.btnHolder_mc.addChild (loc1);

    This. BTNS.push (loc1);

    trace (this.) LABELS [loc2]);

    ++ loc2.

    }

    This.Current = uint (this.xmlData.@firstPick);

    trace ("- width-");

    trace (this.contentMask.Width);

    var loc3: * = this.contentMask.width / this. LABELS.length;

    trace (LOC3);

    loc2 = 0;

    While (loc2 < this.) BTNS.length)

    {

    This. Inclinometer [loc2] .width = loc3;

    This. Inclinometer [loc2] .x = loc3 * loc2.

    ++ loc2.

    }

    this.btnHolder_mc.addEventListener (flash.events.MouseEvent.CLICK, this.numClick, false, 0, true);

    this.selectMovie ();

    return;

    }

    public void numClick (arg1:flash.events.MouseEvent): void

    {

    this.killTimer ();

    This.Current = arg1.target.i;

    this.selectMovie ();

    return;

    }

    public void killTimer (): void

    {

    this.timerGoing = false;

    If (this.timer)

    {

    This.Timer.Reset ();

    this.timer.addEventListener (flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);

    This.Timer = null;

    }

    return;

    }

    public function selectMovie (): void

    {

    If (this.timerGoing)

    {

    This.Timer = new flash.utils.Timer (uint (this.xmlData.ad [com.danehansen.MyMath.modulo (t his.current, this.xmlData.ad.length ())] .@delay), 1);

    This.Timer.Start ();

    this.timer.addEventListener (flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);

    }

    While (this.holder_mc.numChildren > 0)

    {

    This.holder_mc.removeChild (this.holder_mc.getChildAt (0));

    }

    var loc1: * = new flash.display.Loader ();

    LOC1. Load (new flash.net.URLRequest (this.xmlData.ad [com.danehansen.MyMath.modulo (thi s.current, this.xmlData.ad.length ())] .@loc));

    This.holder_mc. AddChild (LOC1);

    loc2 var: * = 0;

    While (loc2 < this.) BTNS.length)

    {

    This. BTNS [loc2]. Deselect();

    ++ loc2.

    }

    This. BTNS [com.danehansen.myMath.modulo (this.current, this.xmlData.ad.length ())] .select ();

    var loc3: * = this. BTNS [com.danehansen.myMath.modulo (this.current, this.xmlData.ad.length ())] .x + this. BTNS [com.danehansen.myMath.modulo (this.current, this.xmlData.ad.length ())] .width/2 + this.btnHolder_mc.x;

    trace ("addLength:" + this.xmlData.ad.length ());

    trace (loc3, com.danehansen.MyMath.modulo (this.current, this.xmlData.ad.length ()));

    com.greensock.TweenLite.to (this.indicator_mc, 0.3, {'x': loc3, "ease":com.greensock.easing.Cubic.easeOut});})

    LOC1.contentLoaderInfo.addEventListener (flash.events.Event.COMPLETE, this.adLoaded, false, 0, true);

    return;

    }

    public void adLoaded (arg1:flash.events.Event): void

    {

    var evt:flash.events.Event;

    loc1 var: *;

    evt = arg1;

    Try

    {

    evt.target.content.xmlData = this.xmlData.ad [com.danehansen.MyMath.modulo (this.current, this.xmlData.ad.length ())];

    }

    catch (er: error)

    {

    };

    return;

    }

    public void minusClick (arg1:flash.events.MouseEvent): void

    {

    this.killTimer ();

    loc1 var: *;

    loc2 var: * = ((loc1_=_this).current - 1);

    LOC1. Current = loc2;

    this.selectMovie ();

    return;

    }

    public void plusClick (arg1:flash.events.Event): void

    {

    If (arg1.type! = "timer")

    {

    this.killTimer ();

    }

    loc1 var: *;

    loc2 var: * = ((loc1_=_this).current + 1);

    LOC1. Current = loc2;

    this.selectMovie ();

    trace ("Next");

    return;

    }

    public function ended (arg1:flash.events.Event): void

    {

    If (arg1.type! = "timer")

    {

    this.killTimer ();

    }

    loc1 var: *;

    loc2 var: * = ((loc1_=_this).current + 1);

    LOC1. Current = loc2;

    this.selectMovie ();

    trace ("Next");

    return;

    }

    public void STARTED (arg1:flash.events.Event): void

    {

    this.killTimer ();

    return;

    }

    function frame1(): *.

    {

    this.timerGoing = true;

    addEventListener ("endNow", this.) COMPLETED, false, 0, true);

    addEventListener ("startNow", this.) STARTED, false, 0, true);

    This.init ();

    return;

    }

    public const XML_LOC:String = stage.loaderInfo.parameters.xmlLoc? stage.loaderInfo.parameters.xmlLoc: "home_ads.xml";

    public const LABELS: __AS3__.vec. Vector. < String > = new Vector. < String > (6);

    public const BTNS:__AS3__.vec. Vector. < Btn > = new Vector. < Btn > ();

    public const TRANSITION_TIME:Number = 0.2;

    public var contentMask:flash.display.MovieClip;

    public var btnHolder_mc:flash.display.MovieClip;

    public var holder_mc:flash.display.MovieClip;

    public var indicator_mc:flash.display.MovieClip;

    public var prev_mc:flash.display.MovieClip;

    public var next_mc:flash.display.MovieClip;

    public var current: int;

    public var xmlData:XML;

    public var timer:flash.utils.Timer;

    public var timerGoing:Boolean;

    }

    }

    Here's the file uploaded to the server for you to get a clear picture, please click this link to download the entire folder. http://www.touchpixl.com/ForumsAdobecom.zip

    I'm not being able to solve the problem, it needs a master to get the right solution. I would ask you to help me.

    Thanks and greetings

    Sanjib Das

    This will fix the error you mentioned, if it comes to your document class:

    package FC_Home_Ads_Holder_v2_fla

    {

    Import __AS3__.vec. * ;

    Adobe.utils import. *;

    com.danehansen import. *;

    import com.greensock;

    com.greensock.easing import. *;

    com.greensock.plugins import. *;

    flash.accessibility import. *;

    flash.desktop import. *;

    import flash.display. *;

    flash.errors import. *;

    import flash.events. *;

    flash.external import. *;

    flash.filters import. *;

    import flash.geom. *;

    flash.globalization import. *;

    import flash.media. *;

    flash.net import. *;

    flash.net.drm import. *;

    flash.printing import. *;

    flash.profiler import. *;

    flash.sampler import. *;

    flash.sensors import. *;

    flash.system import. *;

    import flash.text. *;

    flash.text.engine import. *;

    flash.text.ime import. *;

    flash.ui import. *;

    import flash.utils. *;

    flash.xml import. *;

    SerializableAttribute public class dynamics MainTimeline extends flash.display.MovieClip

    {

    public const XML_LOC:String;

    public const LABELS: __AS3__.vec. Vector. = new Vector. (6);

    public const BTNS:__AS3__.vec. Vector. = new Vector. ();

    public const TRANSITION_TIME:Number = 0.2;

    public var contentMask:flash.display.MovieClip;

    public var btnHolder_mc:flash.display.MovieClip;

    public var holder_mc:flash.display.MovieClip;

    public var indicator_mc:flash.display.MovieClip;

    public var prev_mc:flash.display.MovieClip;

    public var next_mc:flash.display.MovieClip;

    public var current: int;

    public var xmlData:XML;

    public var timer:flash.utils.Timer;

    public var timerGoing:Boolean;

    public void MainTimeline()

    {

    XML_LOC = internship. LoaderInfo.Parameters.xmlLoc? stage.loaderInfo.parameters.xmlLoc: "home_ads.xml";

    new vector. (6) [0] = "productivity."

    new vector. (6) [1] = "leadership."

    new vector. (6) [2] = "execution."

    new vector. (6) [3] = "education";

    new vector. (6) [4] = "speed of trust";

    new vector. (6) [5] = "sales";

    Super();

    addFrameScript (0, this.frame1);

    return;

    }

    public void init (): void

    {

    var loc1: * = null;

    com.greensock.plugins.TweenPlugin.activate ([com.greensock.plugins.Aut oAlphaPlugin]);

    LOC1 = new flash.net.URLLoader (new flash.net.URLRequest (this. XML_LOC));

    loc2 var: *;

    This.next_mc.buttonMode = loc2 = true;

    This.prev_mc.buttonMode = loc2 = true;

    stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;

    internship. Align = flash.display.StageAlign.TOP_LEFT;

    LOC1.addEventListener (flash.events.Event.COMPLETE, this.xmlLoaded, false, 0, true);

    This.prev_mc.addEventListener (flash.events.MouseEvent.CLICK, this.minusClick, false, 0, true);

    This.next_mc.addEventListener (flash.events.MouseEvent.CLICK, this.plusClick, false, 0, true);

    return;

    }

    public void xmlLoaded (arg1:flash.events.Event): void

    {

    var loc1: * = null;

    loc2 var: * = 0;

    this.xmlData = new XML (arg1.target.data);

    loc2 = 0;

    While (loc2<>

    {

    LOC1 = new Btn (this. LABELS [loc2], loc2);

    this.btnHolder_mc.addChild (loc1);

    This. BTNS.push (loc1);

    trace (this.) LABELS [loc2]);

    ++ loc2.

    }

    This.Current = uint (this.xmlData.@firstPick);

    trace ("- width-");

    trace (this.contentMask.Width);

    var loc3: * = this.contentMask.width / this. LABELS.length;

    trace (LOC3);

    loc2 = 0;

    While (loc2<>

    {

    This. Inclinometer [loc2] .width = loc3;

    This. Inclinometer [loc2] .x = loc3 * loc2.

    ++ loc2.

    }

    this.btnHolder_mc.addEventListener (flash.events.MouseEvent.CLICK, this.numClick, false, 0, true);

    this.selectMovie ();

    return;

    }

    public void numClick (arg1:flash.events.MouseEvent): void

    {

    this.killTimer ();

    This.Current = arg1.target.i;

    this.selectMovie ();

    return;

    }

    public void killTimer (): void

    {

    this.timerGoing = false;

    If (this.timer)

    {

    This.Timer.Reset ();

    this.timer.addEventListener (flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);

    This.Timer = null;

    }

    return;

    }

    public function selectMovie (): void

    {

    If (this.timerGoing)

    {

    This.Timer = new flash.utils.Timer (uint (this.xmlData.ad [com.danehansen.MyMath.modulo (t his.current, this.xmlData.ad.length ())] .@delay), 1);

    This.Timer.Start ();

    this.timer.addEventListener (flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);

    }

    While (this.holder_mc.numChildren > 0)

    {

    This.holder_mc.removeChild (this.holder_mc.getChildAt (0));

    }

    var loc1: * = new flash.display.Loader ();

    LOC1. Load (new flash.net.URLRequest (this.xmlData.ad [com.danehansen.MyMath.modulo (thi s.current, this.xmlData.ad.length ())] .@loc));

    This.holder_mc. AddChild (LOC1);

    loc2 var: * = 0;

    While (loc2<>

    {

    This. BTNS [loc2]. Deselect();

    ++ loc2.

    }

    This. BTNS [com.danehansen.myMath.modulo (this.current, this.xmlData.ad.length ())] .select ();

    var loc3: * = this. BTNS [com.danehansen.myMath.modulo (this.current, this.xmlData.ad.length ())] .x + this. BTNS [com.danehansen.myMath.modulo (this.current, this.xmlData.ad.length ())] .width/2 + this.btnHolder_mc.x;

    trace ("addLength:" + this.xmlData.ad.length ());

    trace (loc3, com.danehansen.MyMath.modulo (this.current, this.xmlData.ad.length ()));

    com.greensock.TweenLite.to (this.indicator_mc, 0.3, {'x': loc3, "ease":com.greensock.easing.Cubic.easeOut});})

    LOC1.contentLoaderInfo.addEventListener (flash.events.Event.COMPLETE, this.adLoaded, false, 0, true);

    return;

    }

    public void adLoaded (arg1:flash.events.Event): void

    {

    var evt:flash.events.Event;

    loc1 var: *;

    evt = arg1;

    Try

    {

    evt.target.content.xmlData = this.xmlData.ad [com.danehansen.MyMath.modulo (this.current, this.xmlData.ad.length ())];

    }

    catch (er: error)

    {

    };

    return;

    }

    public void minusClick (arg1:flash.events.MouseEvent): void

    {

    this.killTimer ();

    loc1 var: *;

    loc2 var: * = ((loc1_=_this).current - 1);

    LOC1. Current = loc2;

    this.selectMovie ();

    return;

    }

    public void plusClick (arg1:flash.events.Event): void

    {

    If (arg1.type! = "timer")

    {

    this.killTimer ();

    }

    loc1 var: *;

    loc2 var: * = ((loc1_=_this).current + 1);

    LOC1. Current = loc2;

    this.selectMovie ();

    trace ("Next");

    return;

    }

    public function ended (arg1:flash.events.Event): void

    {

    If (arg1.type! = "timer")

    {

    this.killTimer ();

    }

    loc1 var: *;

    loc2 var: * = ((loc1_=_this).current + 1);

    LOC1. Current = loc2;

    this.selectMovie ();

    trace ("Next");

    return;

    }

    public void STARTED (arg1:flash.events.Event): void

    {

    this.killTimer ();

    return;

    }

    function frame1(): *.

    {

    this.timerGoing = true;

    addEventListener ("endNow", this.) COMPLETED, false, 0, true);

    addEventListener ("startNow", this.) STARTED, false, 0, true);

    This.init ();

    return;

    }

    }

    }

  • Error #1009 when sound inside game, a movie clip that is called to the scene with child add method

    What is supposed to happen

    I have a clip that is called when the user clicks a button. When moving clip appears music is expected to play. When the user clicks the close button the music stops and the clip is removed from the scene.

    But then I get an error

    When I test the movie I get the following error:

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    to mc_playSong / frame2 () [mc_playSong::frame2:6]

    This is the code that calls the clip on the stage (no problem here):

    Call the video clip with the song played on stage

    stage.addEventListener (MouseEvent.MOUSE_DOWN, goButtons);

    function goButtons(event:MouseEvent):void

    {

    If (event.target is song_bnt)

    {

    SoundMixer.stopAll ();

    addChild (myPlaySong);

    myPlaySong.x = 558;

    myPlaySong.y = 384;

    Event.stopImmediatePropagation;

    }

    The following code inside the clip is called to the scene. The music is meant to play:

    Stop();

    Variables for listening to music

    var RJPlaySong:RJSong = new RJSong();

    var RJPlaySongChannel:SoundChannel;

    Music for plays

    stage.addEventListener (Event.ENTER_FRAME, startRJSong); (I think that the error in the code is in this function. When I comment on him I don't get error.)

    function startRJSong(event:Event):void

    {

    RJPlaySongChannel = RJPlaySong.play ();

    }

    Stop all sounds, sets variables to null and calls a send event that removes the clip of the scene.

    bnt_closeSong.addEventListener (MouseEvent.MOUSE_DOWN, closeCreditSongScreen);

    function closeCreditSongScreen(event:MouseEvent):void

    {

    SoundMixer.stopAll ();

    RJPlaySong = null;

    RJPlaySongChannel = null;

    dispatchEvent (new Event ("RemoveMCsong"));

    }

    Someone at - it ideas? This seems to be a pretty simple question, but I can't understand it.

    I meant that you have quoted just to be taken literally.  If it's still not clear what I say or what did your code, try the following in order to demonstrate the IT change... This code to be...

    stage.addEventListener (Event.ENTER_FRAME, startRJSong);

    function startRJSong(event:Event):void {}

    trace ("I can do this all day");

    }

    After doing this, you can see why you want to only call the function once, and you could eliminate most of it and just put...

    RJPlaySongChannel = RJPlaySong.play ();

    Instead, or as I said originally, you can change it to be...

    function startRJSong (): void

    {

    RJPlaySongChannel = RJPlaySong.play ();

    }

    startRJSong();

  • TypeError: Error #1009: cannot access a property or method of a null object reference.      to tail/Chec

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    to Tail / CheckCollision ([Tail::frame1:5])

    I have 2 movieclips, head and tail placed on stage (frame 1 and exported for ACE), head is the name of the instance of head, the tail has instances tail_1, tail_2, tail_3, tail_4 , I'm trying to detect collisions between these two. When head hits any instance of the queue class I want to delete tail_3 and tail_4 how this can be done?

    Code on frame 1 of tail MC

    function CheckCollision(evt:Event):void

    {

    If (Math.abs (MovieClip (root).head.x - x) < 20 & & Math.abs (MovieClip (root).head.y - y) < 20) / / 20 is the size of each and registration is at the centre

         {

    MovieClip (root) .collisionDetected = 1;

         }

    }

    addEventListener (Event.ENTER_FRAME, CheckCollision);

    Code on the MainTimeLine

    for (var m:uint = 3; m < = 4; m ++)

         {

    removeChild (getChildByName ("tail_" + m));

    tail_3 and tail_4 are dynamically added class tail by another function (which is not relevant here), tail_1 and tail_2 are on //stage

         }

    I get this message but SWF file works fine, there is no error either, and BTW if I don't know this message there will be a problem with performance, this message very much continue to pour into the output window (I guess that's normal since I ENTER_FRAME event)

    If you add these bodies without a name in one table, then you can loop through the array and use something like...

    for (var i: uint = 0; i

    {if (mcA.hitTestObject (mcBArray [i]))}

    No matter what

    }

    }

    You can probably also do the same at the breast of each mcB, just using the reverse, without looping...

    {if (this.hitTestObject (MovieClip (root) .mcA))}

    No matter what

    }

    You just need to be sure that you are targeting mcA (or BCP) correctly, which you can determine by drawing the target.

Maybe you are looking for