TypeError: Error #1009 (loaded SWF)

I'm pulling out my hair on this one!
I'm just starting a site (full-Flash site) using CS3 and AS3.
I'm pretty much accustom to the new AS3 changes. I built a rough
structure to make sure the way I wanted to set the site up would
work (loading in external SWFs, etc.). The tests worked.
Now, I'm going in to make some things real, and I'm getting
this error as soon as an external SWF loads in:
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at test_fla::MainTimeline/test_fla::frame2()
I've tried narrowing it down, couldn't find the exact culprit
(had to remove every ounce of ActionScript before it started to
function again). So I started to rebuild that movie entirely --
cleared out the Library and deleted every layer. Didn't work.
Couldn't even add a stop(); action in Frame 1.
Then I started completely fresh File > New, rebuilt again.
I tested after every single change. I finally built it up to the
point where I first tested the original, and it worked. So, then I
added a couple more things tested again, and got the error again.
Ahh, so I removed EXACTLY what I had just added. Tested again. SAME
ERROR -- now it won't go away no matter what I remove!
Crazier yet is that I can still load in my other test SWF
files and they have actions in them, and they're set up the exact
same way -- but they work...
The whole site is new, so every SWF is CS3/AS3. I'm not even
doing anything crazy, so I'm getting pretty frustrated trying to
build an all AS3 site and I can't even do basic stuff....
I can upload/email the FLA files in question if anyone has
time to look...
Thanks,
Brandon

Well, when I test the loaded SWF within the Flash environment
(by itself), it plays just fine.
Then, I try to play the root containing movie (both within
Flash and on the web server) and as soon as that section loads, is
when the error occurs.
I've tried tracing everything. even down to putting trace()
actions between every layer. Can't determine what causes it...
One thing I noticed (but I assume is a naming convention that
Flash uses), is in the error above you see "test_fla", well, lets
say I have these files:
test-container.fla
test-home.fla
I don't have a test_fla, but the error code refers to it
anyway...

Similar Messages

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

    Dear Sir,
    I really need your valuable assistance i was about to finish a project but at very last moment i am stuck. Here is the explanation below...
    I have two files called "holder.swf" and "slide.swf" i want to improt the "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 have attached the flash file of "holder.swf". My concern is the moment i am calling 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.
              at FC_Home_Ads_Holder_v2_fla::MainTimeline() "
    Here are the files uploaded for your reference, please download this file http://www.touchpixl.com/ForumsAdobecom.zip
    This error is being occured from "MainTimeline.as" file here is the code been use inside of this file below....
    package FC_Home_Ads_Holder_v2_fla
        import __AS3__.vec.*;
        import adobe.utils.*;
        import com.danehansen.*;
        import com.greensock.*;
        import com.greensock.easing.*;
        import com.greensock.plugins.*;
        import flash.accessibility.*;
        import flash.desktop.*;
        import flash.display.*;
        import flash.errors.*;
        import flash.events.*;
        import flash.external.*;
        import flash.filters.*;
        import flash.geom.*;
        import flash.globalization.*;
        import flash.media.*;
        import flash.net.*;
        import flash.net.drm.*;
        import flash.printing.*;
        import flash.profiler.*;
        import flash.sampler.*;
        import flash.sensors.*;
        import flash.system.*;
        import flash.text.*;
        import flash.text.engine.*;
        import flash.text.ime.*;
        import flash.ui.*;
        import flash.utils.*;
        import flash.xml.*;
        public dynamic class MainTimeline extends flash.display.MovieClip
            public function 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 function 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));
                var loc2:*;
                this.next_mc.buttonMode = loc2 = true;
                this.prev_mc.buttonMode = loc2;
                stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
                stage.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 function xmlLoaded(arg1:flash.events.Event):void
                var loc1:*=null;
                var loc2:*=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.BTNS[loc2].width = loc3;
                    this.BTNS[loc2].x = loc3 * loc2;
                    ++loc2;
                this.btnHolder_mc.addEventListener(flash.events.MouseEvent.CLICK, this.numClick, false, 0, true);
                this.selectMovie();
                return;
            public function numClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                this.current = arg1.target.i;
                this.selectMovie();
                return;
            public function 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);
                var loc2:*=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 function adLoaded(arg1:flash.events.Event):void
                var evt:flash.events.Event;
                var loc1:*;
                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 function minusClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current - 1);
                loc1.current = loc2;
                this.selectMovie();
                return;
            public function plusClick(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((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();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function STARTED(arg1:flash.events.Event):void
                this.killTimer();
                return;
            function frame1():*
                this.timerGoing = true;
                addEventListener("endNow", this.ENDED, 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 is the folder uploaded on the server for you to get clear picture, please click on this link to download the entire folder. http://www.touchpixl.com/ForumsAdobecom.zip
    I am not being able to resolve the issue, it needs a master to get the proper solution. I would request you to help me.
    Thanks & Regards
    Sanjib Das

    Here is the entire code of MainTimeline.as below, please correct it.
    package FC_Home_Ads_Holder_v2_fla
        import __AS3__.vec.*;
        import adobe.utils.*;
        import com.danehansen.*;
        import com.greensock.*;
        import com.greensock.easing.*;
        import com.greensock.plugins.*;
        import flash.accessibility.*;
        import flash.desktop.*;
        import flash.display.*;
        import flash.errors.*;
        import flash.events.*;
        import flash.external.*;
        import flash.filters.*;
        import flash.geom.*;
        import flash.globalization.*;
        import flash.media.*;
        import flash.net.*;
        import flash.net.drm.*;
        import flash.printing.*;
        import flash.profiler.*;
        import flash.sampler.*;
        import flash.sensors.*;
        import flash.system.*;
        import flash.text.*;
        import flash.text.engine.*;
        import flash.text.ime.*;
        import flash.ui.*;
        import flash.utils.*;
        import flash.xml.*;
        public dynamic class MainTimeline extends flash.display.MovieClip
            public function 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 function init():void
                var loc1:*=null;
                com.greensock.plugins.TweenPlugin.activate([com.greensock.plugins.AutoAlphaPlugin]);
                loc1 = new flash.net.URLLoader(new flash.net.URLRequest(this.XML_LOC));
                var loc2:*;
                this.next_mc.buttonMode = loc2 = true;
                this.prev_mc.buttonMode = loc2 = true;
                stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
                stage.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 function xmlLoaded(arg1:flash.events.Event):void
                var loc1:*=null;
                var loc2:*=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.BTNS[loc2].width = loc3;
                    this.BTNS[loc2].x = loc3 * loc2;
                    ++loc2;
                this.btnHolder_mc.addEventListener(flash.events.MouseEvent.CLICK, this.numClick, false, 0, true);
                this.selectMovie();
                return;
            public function numClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                this.current = arg1.target.i;
                this.selectMovie();
                return;
            public function 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(this.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(this.current, this.xmlData.ad.length())].@loc));
                this.holder_mc.addChild(loc1);
                var loc2:*=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 function adLoaded(arg1:flash.events.Event):void
                var evt:flash.events.Event;
                var loc1:*;
                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 function minusClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current - 1);
                loc1.current = loc2;
                this.selectMovie();
                return;
            public function plusClick(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((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();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function STARTED(arg1:flash.events.Event):void
                this.killTimer();
                return;
            function frame1():*
                this.timerGoing = true;
                addEventListener("endNow", this.ENDED, 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;

  • Error 1009 - TypeError: Error #1009: Cannot access a property or method of a null object reference.

    hello,
    I am trying to load a menu as an external file ....  and getting this :  TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at com::menu()
    here is my code:
    if(!menuLoader){   
    var menuRequest:URLRequest = new URLRequest("menu.swf");
    var menuLoader:Loader = new Loader();
    menuLoader.load(menuRequest);
    container.addChild(menuLoader);
    menuLoader.x = 700;
    menuLoader.y = 50;
    can anyone give me a helping hand?
    thanks in advance.

    use:
    here is my code:
    if(menuLoader!=null){   
    var menuRequest:URLRequest = new URLRequest("menu.swf");
    var menuLoader:Loader = new Loader();
    menuLoader.load(menuRequest);
    container.addChild(menuLoader);
    menuLoader.x = 700;
    menuLoader.y = 50;

  • Stupid TypeError: Error #1009:

    Ok, guys I have posted this same question to a few forums but no luck. So heres my problem that im getting when I complile my swf. I get this stupid, compiling error message, I know what its reffering to but I tried tackleing the line which its referring to but no luck.
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at net.schemagroup.ui::Interface/revealDropDown()[/Users/abel/Desktop/mySite/fla/net/schemag roup/ui/Interface.as:174]
    at net.schemagroup::LatestWorks/initRevealDropDown()[/Users/abel/Desktop/mySite/fla/net/sche magroup/LatestWorks.as:407]
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at SetIntervalTimer/onTimer()
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()
    So basically i'm just calling a instance method from my LatestWorks.as class. Which this instance method is defined in Interface.as class also, my Interface.as class is initialized through my Shell.as class.
    Heres my hiarchy of my class structure.
    here are my classes in order Shell.as,Interface.as, and LatestWorks.as
    Here is Shell.as class
    Code: Select all
    package net.schemagroup
       import gs.*;
       import gs.easing.*;
       import flash.display.*;
       import flash.media.Sound;
       import flash.media.SoundChannel;
       import flash.media.SoundLoaderContext;
       import flash.media.SoundTransform;
       import flash.events.*;
       import flash.net.*;
       import net.schemagroup.ui.Interface;
       import net.schemagroup.LatestWorks;
       public class Shell extends MovieClip
          public var duration:Number;
          public var swfWidth:uint;
          public var swfHeight:uint;
          private var mySound:Sound;
          private var urlSound:String;
          private var urlRequest:URLRequest;
          private var soundBuffTime:Number;
          private var sndChannel:SoundChannel;
          private var testingSound:Boolean;
          private var transform0:SoundTransform;
          private var directoryPath:String;
          private var latestPage:MovieClip;
          var myWork:LatestWorks;
          public function Shell()
             soundBuffTime = 1000;
             var myInterface:Interface = new Interface();
             myInterface.revealInterface(interface_mc);
             latestPage = pages_mc.page0_mc;
             testingSound = true;
             duration = 0.75;
             if (testingSound)
                directoryPath = "../ambient/";
                urlSound = directoryPath + "06_Dabz_Beat.mp3";
             else
                directoryPath = "ambient/";
                urlSound = directoryPath + "06_Dabz_Beat.mp3";
             mySound = new Sound();
             urlRequest = new URLRequest(urlSound);
             var context:SoundLoaderContext = new SoundLoaderContext(soundBuffTime, true);
             mySound.load(urlRequest, context);
             sndChannel = mySound.play();
             transform0 =  sndChannel.soundTransform;
             addEventListener(Event.ENTER_FRAME, onPosition);
             myWork = new LatestWorks();
             swfWidth = stage.stageWidth;
             swfHeight = stage.stageHeight;
             setDefaultStageSettings();
             stage.scaleMode = StageScaleMode.NO_SCALE;
             stage.align = StageAlign.TOP_LEFT;
             stage.frameRate = 30;
             stage.addEventListener(Event.RESIZE, resizeDisplay);
             var myFullScreenSprite:Sprite = MovieClip(usability_controls_mc.fullscreen_mc);
             myFullScreenSprite.buttonMode = true;
             myFullScreenSprite.addEventListener(MouseEvent.CLICK, _handleClick);
             pages_mc.page0_mc.title0_mc.mask = pages_mc.page0_mc.mask_mc;
             pages_mc.page0_mc.scrollBox_mc.sb.mask = pages_mc.page0_mc.scrollBox_mc.maskscrollbar_mc;
          private function goFullScreen():void
             if (stage.displayState == StageDisplayState.NORMAL)
                stage.displayState = StageDisplayState.FULL_SCREEN;
             else
                stage.displayState=StageDisplayState.NORMAL;
          private function _handleClick(event:MouseEvent):void
             trace("here!");
             goFullScreen();
          private function onPosition(e:Event):void
             var soundPosition:uint = Math.ceil(Math.ceil(Math.abs(sndChannel.position))/Math.ceil(Math.abs(mySound.length)) * 100);
             if (soundPosition == 90)
                removeEventListener(Event.ENTER_FRAME, onPosition);
                transform0.volume = 1;
                TweenMax.to(sndChannel, 12, {volume:0});
                var mySound2:Sound = new Sound();
                var context2:SoundLoaderContext = new SoundLoaderContext(1000, true);
                mySound2.load(new URLRequest(directoryPath + "14_Broken_Language.mp3"), context2);
                var sndChannel2:SoundChannel = mySound2.play();
                var transform:SoundTransform =  sndChannel2.soundTransform;
                transform.volume = 1;
                TweenMax.from(sndChannel2, 12, {volume:0});
          public function setDefaultStageSettings():void
             pages_mc.page0_mc.scrollBox_mc.mask_content_mc.width = swfWidth;
             pages_mc.page0_mc.bar6_mc.expandbar2_mc.width = swfWidth;
             pages_mc.page0_mc.bar5_mc.expandbar_mc.width = swfWidth;
             usability_controls_mc.x = swfWidth - usability_controls_mc.width;
             usability_controls_mc.y = swfHeight - usability_controls_mc.height;
             myWork.setStageHeight = swfHeight;
             myWork.setStageWidth = swfWidth;
             myWork.setupParameters(latestPage);
             myWork.runInitAnimation();
             trace("My stageWidth is: "+ myWork.setStageWidth);
             trace("My stageHeight is: "+ myWork.setStageHeight);
             pages_mc.y = swfHeight - 478;
             trace("Pages y is: " + pages_mc.y);
          public function resizeDisplay(e:Event):void
             swfWidth = stage.stageWidth;
             swfHeight = stage.stageHeight;
             myWork.setStageHeight = swfHeight;
             myWork.setStageWidth = swfWidth;
             pages_mc.page0_mc.scrollBox_mc.mask_content_mc.width = swfWidth;
             pages_mc.page0_mc.bar6_mc.expandbar2_mc.width = swfWidth;
             pages_mc.page0_mc.bar5_mc.expandbar_mc.width = swfWidth;
             usability_controls_mc.x = swfWidth - usability_controls_mc.width;
             usability_controls_mc.y = swfHeight - usability_controls_mc.height;
             pages_mc.y = uint(swfHeight - pages_mc.height);
    Here is Interface.as class
    Code: Select all
    package net.schemagroup.ui
       import gs.*;
       import gs.easing.*;
       import flash.events.*;
       import flash.display.*;
       import flash.utils.setTimeout;
       import flash.net.URLLoader;
       import flash.net.URLRequest;
       import flash.net.Socket;
       import flash.text.AntiAliasType;
       import flash.text.TextFieldAutoSize;
    a
       public class Interface extends MovieClip
          private var duration:Number;
          private var xml:XML;
          private var movContainer:MovieClip;
          private var movDropDownContainer:MovieClip;
          private var myMenuArray:Array;
          private var myMenuDropArray:Array;
          private var newY:uint;
          private var oldY:uint;
          private var spacer:int;
          private var timedProcess:int;
          private var myMainDrop:DropItem;
          public function Interface():void
             duration = 0.75;
             spacer = 12;
             myMenuDropArray = [];
             myMenuArray = [];
          public function revealInterface(myContainer:MovieClip):void
             trace("Revealing Interface!");
             movContainer = myContainer;
             movDropDownContainer = myContainer.container_mc;
             var yArray:Array = [-10.0,6,105];
             var delayArray:Array = [2,2.15,2.45];
             TweenMax.to(movContainer.logo_mc, duration, {y:yArray[0], delay:delayArray[0], alpha:1,timeScale:1, ease:Strong.easeOut});
             TweenMax.to(movContainer.bar0_mc, duration, {y:yArray[1], delay:delayArray[1], alpha:1,timeScale:1, ease:Strong.easeOut});
             TweenMax.to(movContainer.bar1_mc, duration, {y:yArray[2], delay:delayArray[2], alpha:1,timeScale:1, ease:Strong.easeOut, onComplete:loadXML});
          private function loadXML():void
             var testingSound = true;
             var xmlPath:String;
             if (testingSound)
                xmlPath = "../xml/interface.xml";
             else
                xmlPath = "xml/interface.xml";
             var xmlURLRequest:URLRequest = new URLRequest(xmlPath);
             var xmlURLLoader:URLLoader = new URLLoader(xmlURLRequest);
             xmlURLLoader.addEventListener(Event.COMPLETE, onComplete);
          private function onComplete(e:Event):void
             xml = new XML(e.target.data);
             //trace(xml);
             if (xml != null)
                buildInterface(xml);
             else
                trace("XML did not load successfully!");
          private function buildInterface(e:XML):void
             var xmlLength:uint = e.menu.section.page.length();
             var xmlLength2:uint = e.dropdown.section.item.length();
             //trace("XMLength is: "+ xmlLength);
             var xmlList:XMLList = new XMLList(e.menu.section.page);
             var xmlList2:XMLList = new XMLList(e.dropdown.section.item);
             myMainDrop = new DropItem();
             myMainDrop.mainDrop_mc.txt.text = e.dropdown.section.attribute("title");
             myMainDrop.mainDrop_mc.txt.autoSize = TextFieldAutoSize.LEFT;
             myMainDrop.mainDrop_mc.txt.antiAliasType = AntiAliasType.ADVANCED;
             myMainDrop.alpha = 0;
             myMainDrop.y = int(Math.round(myMainDrop.height / 2));
             myMainDrop.buttonMode = true;
             myMainDrop.mouseChildren = false;
             myMainDrop.addEventListener(MouseEvent.CLICK, dropDown);
             var yArray:Array = [0,spacer * 2];
             TweenMax.to(myMainDrop, duration, {y:int(spacer), alpha:1, ease:Strong.easeOut});
             movContainer.dropcontainer_mc.addChild(myMainDrop);
             oldY = uint(movContainer.dropcontainer_mc.y +  -  spacer);
             for (var i:uint = 0; i < xmlLength; i++)
                //trace(xmlList[i].title);
                var myItem:MenuItem = new MenuItem();
                myItem.myText_mc.txt.htmlText = xmlList[i].title.toString();
                myItem.myText_mc.txt.autoSize = TextFieldAutoSize.LEFT;
                myItem.myText_mc.txt.antiAliasType = AntiAliasType.ADVANCED;
                myItem.y = int(myItem.height + spacer) * i;
                myItem.alpha = 0;
                myMenuArray.push(myItem);
                var setDynamicDelay = Number("0." + 1) * i;
                trace(setDynamicDelay);
                myItem.mouseChildren = false;
                myItem.buttonMode = true;
                myItem.addEventListener(MouseEvent.CLICK, selectedPage);
                TweenMax.to(myItem, duration, {y:yArray[i], alpha:1, delay:setDynamicDelay, ease:Strong.easeOut});
                movContainer.container_mc.addChild(myItem);
             for (var j:uint = 0; j < xmlLength2; j++)
                //trace(xmlList[i].title);
                var dropItem:MenuItem = new MenuItem();
                dropItem.myText_mc.txt.text = xmlList2[j].title.toString();
                dropItem.myText_mc.txt.autoSize = TextFieldAutoSize.LEFT;
                dropItem.myText_mc.txt.antiAliasType = AntiAliasType.ADVANCED;
                dropItem.y = int(spacer) * j;
                dropItem.x = int(spacer);
                myMainDrop.container_mc.y =  -  int(myMainDrop.container_mc.height);
                newY = myMainDrop.container_mc.y;
                myMenuDropArray.push(dropItem);
                dropItem.buttonMode = true;
                dropItem.mouseChildren = false;
                dropItem.addEventListener(MouseEvent.CLICK, selectedPage);
                myMainDrop.mask_mc.height = myMainDrop.container_mc.height;
                movDropDownContainer.addChild(dropItem);
                if(j >= xmlLength2-1)
                   //timedProcess = setTimeout(revealDropDown, 400);
          private function dropDown(e:MouseEvent):void
             revealDropDown();
          private function selectedPage(e:MouseEvent):void
          public function revealDropDown():void
             TweenMax.to(movDropDownContainer, 1, {y:200, ease:Strong.easeOut});
             TweenMax.to(myMenuArray[1], 1, {y:movDropDownContainer.height + spacer + spacer/2, ease:Strong.easeOut});
    Here is LatestWorks.as class
    Code: Select all
    package net.schemagroup
       import gs.*;
       import gs.easing.*;
       import flash.events.*;
       import flash.net.URLLoader;
       import flash.net.URLRequest;
       import flash.geom.Rectangle;
       import flash.net.Socket;
       import flash.display.*;
       import flash.utils.*;
       import flash.filters.BlurFilter;
       import flash.text.AntiAliasType;
       import flash.text.TextFieldAutoSize;
       import net.schemagroup.ui.Interface;
       public class LatestWorks extends Interface {
          private var currentCount:uint;
          private var setDelays:Array;
          private var imageTarget:Array;
          private var myXCordBoxArray:Array;
          private var myYCordBoxArray:Array;
          private var setBlurX:Array;
          private var setBlurY:Array;
          private var setTimeScale:Number;
          private var setDuration:Number;
          private var passXMLength:Number;
          private var imageRatio:Number;
          private var xmlPath:String;
          private var timedProcess:Number;
          private var xmlLength:int;
          private var xmlLength2:int;
          private var xmlURLRequest:URLRequest;
          private var xmlURLLoader:URLLoader;
          private var xml:XML;
          private var categorySelector:uint;
          private static var spacer:int=10;
          private var passMask:Sprite;
          private var passScrollBar:MovieClip;
          private var projectItemURL:Array;
          public var catButtonsArray:Array;
          public var passContainer:MovieClip;
          public var whatState:Boolean;
          private var imageDirectory:String;
          private var counter:Number;
          private var projectImageWidth:Number;
          private var testingXML:Boolean;
          public var btnClicked:Boolean;
          private var passedArray:Array;
          public var scrollBarWidth:Number;
          public var whatCategory:int;
          public var increment:int;
          public var increment2:int;
          private var swfWidth:int;
          private var swfHeight:int;
          private var projectsLoaded:Boolean;
          private static const tintColor:int=0x0180AA;
          public var mainObject:MovieClip;
          private var myInterface:MovieClip;
          private var myThumbContainer:DisplayObjectContainer;
          private var someInterface:Interface;
          public function LatestWorks():void
             this.projectsLoaded=false;
             this.increment=0;
             this.increment2=0;
             this.catButtonsArray=[];
             testingXML=true;
             if (testingXML) {
                imageDirectory="../images/";
                xmlPath="../xml/portfolio.xml";
             } else {
                imageDirectory="images/";
                xmlPath="xml/portfolio.xml";
          public function setupParameters(latestPage:MovieClip):void {
             this.mainObject = latestPage;
             this.passScrollBar= mainObject.scrollBox_mc.sb.scrollbar_mc;
             this.passMask= mainObject.mask_mc;
             this.passContainer= mainObject.scrollBox_mc.content_mc;
             counter=30;
             setBlurX = [5,
             5,
             5,
             0,
             150,
             150,
             10];
             setBlurY = [10,
             10,
             10,
             10,
             150,
             150,
             0];
             myXCordBoxArray = [-260,
                -55,
                -147,
                271,
                289,
                this.swfWidth+577,
                this.swfWidth+368];
             myYCordBoxArray = [this.swfHeight + -50,
                this.swfHeight + -167,
                this.swfHeight + -309,
                this.swfHeight + 72,
                this.swfHeight + 72,
                this.swfHeight + 142,
                72];
             setDelays=[0,0.35,0.55,0.75,0.95,1.15,1.35,1.45];
             setTimeScale=2;
             this.mainObject.categoryHolder_mc.mask = this.mainObject.mask_category_mc;
             setDuration=0.75;
          public function runInitAnimation():void {
             var objectLength:uint = 7;
             for (var i:int = 0; i < objectLength; i++) {
                var myMC:DisplayObject = this.mainObject["bar"+i+"_mc"];
                //trace("Counter is: " + i + " " + myMC.name + " Ycord is: "+  myYCordBoxArray[i]);
                TweenMax.from(myMC, setDuration, {blurFilter:{blurX:setBlurX[i],
                  blurY:setBlurX[i]},
                  x:myXCordBoxArray[i],
                  y:myYCordBoxArray[i],
                  delay:setDelays[i],
                  timescale:Math.random() * setTimeScale,
                  ease:Back.easeInOut});
                if (i>=4) {
                   TweenMax.from(mainObject.bar5_mc, setDuration, {blurFilter:{blurX:setBlurX[5],
                    blurY:setBlurY[5]},
                    x:myXCordBoxArray[5],
                    delay:setDelays[5],
                    ease:Strong.easeOut});
                   TweenMax.from(mainObject.bar6_mc, setDuration, {blurFilter:{blurX:setBlurX[6],
                    blurY:setBlurX[6]},
                    x:myXCordBoxArray[6],
                    delay:setDelays[6],
                    ease:Strong.easeOut});
                   TweenMax.to(this.passMask, setDuration, {scaleX:1, delay:2, ease:Strong.easeOut, onStart:AssignXMLSettings});
                   break;
          public function AssignXMLSettings():void {
             xmlURLRequest=new URLRequest(xmlPath);
             xmlURLLoader=new URLLoader(xmlURLRequest);
             xmlURLLoader.addEventListener(Event.COMPLETE, onLoaded);
          public function onLoaded(e:Event):void {
             xml=new XML(e.target.data);
             if (xml.data!=null) {
                trace(xmlPath + " successfully loaded!");
                buildPortfolio(xml);
                buildCatMenu(xml);
                TweenMax.to(mainObject.categoryHolder_mc, 0.75, {y:221, ease:Strong.easeOut});
                TweenMax.to(mainObject.scrollBox_mc.maskscrollbar_mc, setDuration, {scaleX:1,  ease:Strong.easeOut});
             } else {
                trace(xmlPath + " did not load successfully!");
          public function buildCatMenu(e:XML):void {
             var xmlList:XMLList=e.category.items.catitem;
             xmlLength2=xmlList.length();
             var XPos:int=0;
             var myCatMain:CatItem = new CatItem();
             myCatMain.category_txt.htmlText=e.category.@main;
             myCatMain.category_txt.autoSize=TextFieldAutoSize.LEFT;
             myCatMain.category_txt.antiAliasType=AntiAliasType.ADVANCED;
             mainObject.categoryHolder_mc.addChild(myCatMain);
             var TextValue:int=myCatMain.width;
             for (var i:uint = 0; i < xmlLength2; i++) {
                var myCatItem:CatItem = new CatItem();
                myCatItem.category_txt.htmlText=xmlList[i].title;
                myCatItem.category_txt.autoSize=TextFieldAutoSize.LEFT;
                myCatItem.category_txt.antiAliasType=AntiAliasType.ADVANCED;
                myCatItem.btnClicked=xmlList[i].@setDefault;
                myCatItem.whatCategory=i;
                //trace(xmlList[i].@setState);
                myCatItem.x=TextValue;
                XPos=myCatItem.width;
                catButtonsArray.push(myCatItem);
                TextValue+=Number(spacer+XPos);
                mainObject.categoryHolder_mc.addChild(myCatItem);
                myCatItem.buttonMode=true;
                myCatItem.mouseChildren=false;
                myCatItem.addEventListener(MouseEvent.CLICK, catClick);
                myCatItem.addEventListener(MouseEvent.MOUSE_OVER, catOver);
                myCatItem.addEventListener(MouseEvent.MOUSE_OUT, catOut);
                if (catButtonsArray[i].btnClicked==true) {
                   catButtonsArray[i].buttonMode=false;
                   catButtonsArray[i].mouseEnabled=false;           
                   TweenMax.to(catButtonsArray[i], 1, {tint:tintColor, delay:0.45, ease:Strong.easeOut});
          private function catClick(e:MouseEvent):void {
             var myButton:MovieClip=MovieClip(e.currentTarget);
             if(projectsLoaded)
             projectsLoaded = false;
             myButton.buttonMode=false;
             myButton.mouseEnabled=false;
             TweenMax.to(myButton, 1, {tint:tintColor, ease:Strong.easeOut});
             categorySelector = myButton.whatCategory;
             removeItems();
             validateCategories();
             myButton.btnClicked=true;
             changeTitle(myButton.category_txt.text);
          public function removeItems():void {
             //trace("Remove items fired!");
             var setDynamicDelay:Number;
             for (var i:int = 0; i < xmlLength; i++)
             setDynamicDelay = Number("0."+ 1) * i;
             var myItem:MovieClip = imageTarget[i];
             //trace(myItem.name);
             //trace("RemoveItem count is: "+ i + " out of " + Number(xmlLength-1));
             TweenMax.to(myItem, 1, {blurFilter:{blurY:50},
             y:this.swfHeight - myItem.height,
             ease:Strong.easeOut,
             delay:setDynamicDelay,
             onComplete:removeTarget,
             ease:Strong.easeOut});
          public function removeTarget():void {
             increment++;
             //trace("Increment is: "+ increment);
             this.passContainer.removeChildAt(0);
             if (increment >= Number(xmlLength))
                increment = 0;
                //trace("Increment is: "+ increment);
                //trace("Increment is equal to: "+ Number(xmlLength-1));
                buildPortfolio(xml);
          private function validateCategories():void {
             for (var i:int = 0; i < xmlLength2; i++)
                if (catButtonsArray[i].btnClicked==true)
                   TweenMax.to(catButtonsArray[i], 1, {removeTint:true, ease:Strong.easeOut});
                   catButtonsArray[i].buttonMode=true;
                   catButtonsArray[i].mouseEnabled=true;
                   catButtonsArray[i].btnClicked=false;
          private function changeTitle(e:String):void {
             TweenMax.to(mainObject.mask_mc, 0.75, {scaleX:0, ease:Strong.easeOut, onComplete:loadTitle, onCompleteParams:[e]});
          private function loadTitle(e:String) {
             mainObject.title0_mc.title_txt.htmlText=e;
             if(e == "WEBSITES")
             TweenMax.to(mainObject.title0_mc, 0.75, {x:120, delay:0.45, ease:Strong.easeOut});
             TweenMax.to(mainObject.bar6_mc, 0.75, {x:550, delay:0.45, ease:Strong.easeOut});
             TweenMax.to(mainObject.mask_mc, 0.75, {scaleX:1, delay:0.45, ease:Strong.easeOut});
             }else{
             TweenMax.to(mainObject.title0_mc, 0.75, {x:226, delay:0.45, ease:Strong.easeOut});
             TweenMax.to(mainObject.bar6_mc, 0.75, {x:656, delay:0.45, ease:Strong.easeOut});
             TweenMax.to(mainObject.mask_mc, 0.75, {scaleX:1, delay:0.45, ease:Strong.easeOut});
          public function buildPortfolio(e:XML):void
             trace("Building Portfolio!");
             //trace("XML category is: " + categorySelector);
             var xmlList:XMLList=e.projectitem[categorySelector].item;
             xmlLength=xmlList.length();
             //trace("Length of section is: " + xmlLength);
             var itemGap:Number=20;
             var setDynamicDelay:Number;
             currentCount=0;
             passXMLength=Number(xmlLength);
             var imageRatio:uint=passXMLength/passXMLength;
             //trace("Image ratio is: " + imageRatio);
             imageTarget=[];
             projectItemURL=[];
             for (var i:uint = 0; i < xmlLength; i++)
                /*trace("-----------------------------------");
                trace("Client is: " + xmlList[i].client);
                trace("Description is: " + xmlList[i].description);
                trace("Platform is: " + xmlList[i].platform);
                trace("Launch is: " + xmlList[i].launch);
                trace("-----------------------------------");
                var myItem:ProjectItem = new ProjectItem();
                myItem.name="item"+i+"_mc";
                myItem.x=Number(myItem.width+itemGap)*i;
                myItem.y=Number(this.swfHeight/2 - myItem.height);
                projectImageWidth=Number(myItem.width+itemGap)*i;
                //trace("Project image width is: " + projectImageWidth);
                this.passContainer.addChild(myItem);
                imageTarget.push(myItem);
                //trace(imageTarget[i].name);
                myItem.text_mc.description_txt.htmlText = xmlList[i].description.toString();
                myItem.text_mc.description_txt.wordWrap = true;
                myItem.text_mc.description_txt.autoSize = TextFieldAutoSize.LEFT;
                myItem.text_mc.description_txt.antiAliasType = AntiAliasType.ADVANCED;
                projectItemURL.push(imageDirectory + xmlList[i].attributes());
                setDynamicDelay = Number("0."+1)*i;
                TweenMax.to(myItem, 0.75, {blurFilter:{blurY:50}});
                TweenMax.to(myItem, 0.75, {blurFilter:{blurY:0}, y:0, delay:setDynamicDelay, ease:Strong.easeOut});
                if (i == xmlLength-1) {
                   trace("Preloading images!");
                   //preloadImages(projectItemURL,imageTarget);
                   preloadImages();
                   timedProcess = setTimeout(initRevealDropDown, 10000);
                   this.passScrollBar.width=Number(myItem.width+itemGap/imageRatio);
          public function initRevealDropDown():void
             clearTimeout(timedProcess);
             someInterface = new Interface();
             someInterface.revealDropDown();
          private function preloadImages() {
             var loaderURLRequest:URLRequest=new URLRequest(projectItemURL[currentCount]);
             var loader:Loader = new Loader();
             loader.contentLoaderInfo.addEventListener(Event.OPEN, _onOpen);
             loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, _onProgress);
             loader.contentLoaderInfo.addEventListener(Event.COMPLETE, _handleImageLoaded);
             loader.load(loaderURLRequest);
          private function _onOpen(e:Event):void {
             //trace("loading started!");
             imageTarget[currentCount].preloader_mc.gotoAndPlay("play");
          private function _onProgress(e:ProgressEvent):void {
             var loadBytes:Number=e.target.bytesLoaded;
             var totalBytes:Number=e.target.bytesTotal;
             var percent:Number=Math.ceil(loadBytes/totalBytes*100);
             //trace("BytesLoaded: " + loadBytes + " out of " + totalBytes + " Percentage: " + percent);
             imageTarget[currentCount].preloader_mc.percent_mc.pct_txt.text=Math.ceil(loadBytes/totalBytes*10).toString();
          private function _handleImageLoaded(e:Event):void {
             //trace("Finished loading: " + e.target.url);
             imageTarget[currentCount].preloader_mc.percent_mc.pct_txt.text="";
             imageTarget[currentCount].container_mc.alpha=0;
             imageTarget[currentCount].container_mc.addChild(Bitmap(e.target.content));
             imageTarget[currentCount].preloader_mc.stop();
             TweenMax.to(imageTarget[currentCount].preloader_mc, 0.75, {alpha:0, ease:Strong.easeOut});
             TweenMax.to(imageTarget[currentCount].container_mc, 0.75, {alpha:1, ease:Strong.easeOut});
          if (currentCount<passXMLength-1)
                currentCount++;
                preloadImages();
             }else if(currentCount >= passXMLength-1)
                //trace("Current count is equal to xmlLength!");
                projectsLoaded = true;
                //trace("ProjectsLoaded is: "+ projectsLoaded);
          private function catOver(e:MouseEvent):void {
             var myButton:MovieClip=MovieClip(e.currentTarget);
             TweenMax.to(myButton, 1, {tint:tintColor, ease:Strong.easeOut});
          private function catOut(e:MouseEvent):void {
             var myButton:MovieClip=MovieClip(e.currentTarget);
             if (myButton.btnClicked!=true) {
                TweenMax.to(myButton, 1, {removeTint:true, ease:Strong.easeOut});
          public function get selectCategory():uint {
             return this.categorySelector;
          public function set selectCategory(e:uint):void {
             this.categorySelector=e;
          public function get getState():Boolean {
             return this.whatState;
          public function set getState(setState:Boolean):void {
             this.whatState=setState;
          public function get setStageHeight():int
             return swfHeight;
          public function set setStageHeight(whatHeight:int):void
             swfHeight = whatHeight;
          public function get setStageWidth():int
             return swfWidth;
          public function set setStageWidth(whatWidth:int):void
             swfWidth = whatWidth;
    Please anybody, it would be very helpful since i'm still trying to tackle as3 classes.
    thanks
    abe

    so, movDropDownContainer (which i know is myContainer.container_mc) doesn't exist WHEN revealDropDown() is called (and that error message is displayed).
    we already know it does exist and movDropDownContainer is defined correctly when your constructor is called so some time after that the timeline that contains myContainer.container_mc must move and it no longer exists or actionscript is used to remove the movieclip.
    the most subtle way that can happen is with a timeline created instance (ie, created in the ide).  there are lots of ways this can happen.  obviously, if you see that your timeline moves to or through a frame where myContainer.container_mc doesn't exist, it should be clear why you're seeing that error message.  but this error can be caused by more difficult to understand situations.
    for example, if it appears that movieclip is in every frame but it's in a layer with more than 1 keyframe, then you can have identically named instances (and that all look the same) that are not the same instance.  in fact, the only sure way to know that movieclip exists in keyframes where it appears to exist is to clear all the keyframes in its layer (after the first keyframe where it appears) and then create all the additional keyframes.  at that point, if you do not remove the movieclip from the stage, in any keyframes, all the instances will be the same.  if you do anything else or you've done anything else, you're going to run into this problem.

  • TypeError: Error #1009: No se puede acceder a una propiedad o a un método de una referencia a un obj

    Hi,
    I have a flash file named "the_good_one.swf" with a code to load another flash file "DynamicSlideshow.swf", and I have this Error when I publish the file "TypeError: Error #1009: No se puede acceder a una propiedad o a un método de una referencia a un objeto nulo.
        at DynamicSlideshow()", how can I fix it?
    here's the code of the_good_one.swf:
    import flash.net.URLRequest;
    import flash.display.Loader;
    import flash.events.Event;
    import flash.events.ProgressEvent;
    import flash.display.Sprite;
    import flash.display.MovieClip;
    import flash.display.StageScaleMode;
    import flash.display.StageAlign;
    import flash.display.StageDisplayState;
    import SlideEngine;
    import DynamicSlideshow;
    var galeria:Galeria = new Galeria();
    var contacto:Contacto = new Contacto();
    var fullscreen:FullScreen = new FullScreen();
    var musicOff:MusicOff = new MusicOff();
    var musicOn:Music = new Music();
    addChild(galeria);
    galeria.x=stage.stageWidth-140;
    galeria.y=5;
    galeria.buttonMode=true;
    galeria.alpha=1;
    //galeria.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
    addChild(contacto);
    contacto.y=5;
    contacto.buttonMode=true;
    contacto.alpha=1;
    contacto.x=stage.stageWidth-100;
    addChild(fullscreen);
    fullscreen.y=5;
    fullscreen.buttonMode=true;
    fullscreen.alpha=1;
    fullscreen.x=stage.stageWidth-60;
    var wrapContainer:Sprite = new Sprite();
    wrapContainer.x=0;
    wrapContainer.y=25;
    wrapContainer.height=575;
    wrapContainer.width=980;
    addChild(wrapContainer);
    var container:Sprite = new Sprite();
    container.height=575;
    container.width=980;
    function startLoad() {
        var mLoader:Loader = new Loader();
        var mRequest:URLRequest=new URLRequest("DynamicSlideshow.swf");
        mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
        mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
        mLoader.load(mRequest);
    function onCompleteHandler(loadEvent:Event) {
        addChild(loadEvent.currentTarget.content);
    function onProgressHandler(mProgress:ProgressEvent) {
        var percent:Number=mProgress.bytesLoaded/mProgress.bytesTotal;
    startLoad();
    "DynamicSlideshow.swf", has a class asociated to it "DynamicSlideshow.as" and from inside that class another class is called "SlideEngine.as" here's the code of both:
    ************ here's the code of the class DYNAMIC SLIDESHOW **************
    package {
        import flash.display.Sprite;
        import flash.display.MovieClip;
        import flash.display.StageScaleMode;
        import flash.display.StageAlign;
        import flash.display.StageDisplayState;
        import flash.net.URLRequest;
        import flash.events.*;
        public class DynamicSlideshow extends Sprite
            public function DynamicSlideshow()
                stage.scaleMode = StageScaleMode.NO_SCALE;
                stage.align = StageAlign.TOP_LEFT;
                var slidesfile:URLRequest = new URLRequest("data/slides.xml");
                var delaytime:Number = 4000;
                var tweentime:Number = 2;
                this.addEventListener(Event.ADDED, init);
                /*var slidesfile:URLRequest = new URLRequest(root.loaderInfo.parameters["slidesfile"]);
                var delaytime:Number = root.loaderInfo.parameters["delaytime"];
                var tweentime:Number = root.loaderInfo.parameters["tweentime"];*/
                if(delaytime < 1000)
                    delaytime = 1000;
                if(tweentime < 0.1)
                    tweentime = 0.1;
                if(tweentime > (delaytime/10000))
                    tweentime = (delaytime/10000);
                trace("heere");
                var slideengine:SlideEngine = new SlideEngine(stage, slidesfile, delaytime, tweentime);
            public function init(e:Event):void{
                    trace("yeah");
    ************ here's the code of the class  SLIDE ENGINE **************
    package
        import flash.display.Loader;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.TimerEvent;
        import flash.net.URLLoader;
        import flash.net.URLRequest;
        import flash.utils.Timer;
        import gs.TweenLite;
        public class SlideEngine extends Sprite
            private var _stage:Object;
            private var _images:Array;
            private var _container:Sprite;
            private var _loader:Loader;
            private var _request:URLRequest;
            private var _currentImage:int = 0;
            private var _totalImages:int;
            private var _timer:Timer;
            private var _delay:Number;
            private var _tweentime:Number;
            public function SlideEngine(container:Object, req:URLRequest, delaytime:Number, tweentime:Number)
                super();
                _stage        = container;
                _delay        = delaytime;
                _tweentime    = tweentime;
                var ulLoader:URLLoader = new URLLoader();
                ulLoader.load(req);
                ulLoader.addEventListener(Event.COMPLETE, xmlLoaded);
                //stage.addEventListener(Event.RESIZE, stageResize);
                //addEventListener(Event.ENTER_FRAME, onFrame);
            private function xmlLoaded(e:Event):void
                var ldr:URLLoader = e.target as URLLoader;
                ldr.removeEventListener(Event.COMPLETE, xmlLoaded);
                var xml:XML = new XML(e.target.data);
                var imageList:XMLList = xml.slide;
                _totalImages = imageList.length();
                setupImages(imageList);
            private function setupImages(list:XMLList):void
                _images = new Array();
                var _item:XML;
                for each(_item in list)
                    _images.push(_item.image);
                initGraphics();
            private function initGraphics():void
                _container = new Sprite();
                _stage.addChild(_container);
                _container.y = 25;
                _loader    = new Loader();
                _request = new URLRequest(_images[_currentImage]);
                _container.addChild(_loader);
                startSlideshow();
            private function startSlideshow():void
                _loader.load(_request);
                _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
                _timer = new Timer(_delay);
                _timer.addEventListener(TimerEvent.TIMER, loadNewImage);
                _timer.start();
            private function loadNewImage(e:TimerEvent):void
                _request = new URLRequest(_images[_currentImage]);
                _loader.load(_request);
                _timer.stop();
            private function imageLoaded(e:Event):void
                _currentImage ++
                if(_currentImage == _totalImages)
                    _currentImage = 0;
                _stage.addEventListener(Event.RESIZE, stageResize);
                addEventListener(Event.ENTER_FRAME, onFrame);
                TweenLite.from(_loader, _tweentime, {alpha:0});
                _timer.start();
            private function stageResize(e:Event):void{
                _loader.x = _stage.stageWidth/2 - _container.width/2;
                _loader.y = _stage.stageHeight/2 - _container.height/2 + 20;
                //_loader.scaleX = _stage.stageWidth/980;
                //_loader.scaleY = _stage.stageHeight/600;
            private function onFrame(e:Event):void{
                _loader.x = _stage.stageWidth/2 - _container.width/2;
                _loader.y = _stage.stageHeight/2 - _container.height/2 + 20;
                //_loader.scaleX = _stage.stageWidth/980;
                //_loader.scaleY = _stage.stageHeight/600;

    Well, I think I found the cause,inside the initGraphics function, I do a trace line by line from the top, scanning every element in the code, and I found that the _stage, if I run the slideshow.swf is traced like [object Stage], but when I run the_good_one.swf file (who load the other swf files) the error appears instead of [object Stage]. Of course the stage of the slideshow.swf is only for that file, and I'm importing this file into the_good_one.swf file, who has it's own stage... uuuuffff!!!
    private function initGraphics():void
                _container = new Sprite();
                _stage.addChild(_container);
                _container.y = 25;
                _loader    = new Loader();
                _request = new URLRequest(_images[_currentImage]);
                _container.addChild(_loader);
                startSlideshow();
    So, the question of the million dollars is... how do I fix that? I remember that I've read something about that in a post blog that talks about the DisplayList, do you know how to fix it?

  • Help! TypeError: Error #1009: Cannot access a property or method of a null object reference.

    I'am the just start learning actionscript 3, follow is my code, when i lauch the code, it still report the error in frame 36 but did not locate the error in which line. please help me debug them.... TypeError: Error #1009: Cannot access a property or method of a null object reference.
    stop();
    fm_button.visible = false;
    import caurina.transitions.*;
    var menu_label_North:Array = new Array("Animals Collection", 
                                                                                     "Flowers Collection",
                                                                                     "Leaves Collection",
                                                                                     "Mixed Collection",
                                                                                     "Extra Collection",
                                                                                     "Special Awards",
                                                                                     "Company Background",
                                                                                     "Contact Information");
    var total_north:Number = menu_label_North.length;
    var i_north:Number = 0;
    var page_north:Number;
    var main_menu_North:MovieClip = new MovieClip();
    stage.addChild(main_menu_North);
    for (i_north = 0; i_north < total_north; i_north++)
              var btn_north = new flashmo_button();
              btn_north.name = "btn" + i_north;
              btn_north.x = fm_button.x + i_north * ( fm_button.width + 12 );
              btn_north.y = fm_button.y;
              btn_north.buttonMode = true;
              btn_north.item_no = i_north;
              btn_north.flashmo_click_area.addEventListener( Event.ENTER_FRAME, btn_enter_north );
              var each_substring_north:Array = menu_label_North[i_north].split("|");
              btn_north.flashmo_button_label.fm_label.text = each_substring[0];
              btn_north.item_url = each_substring[1];
              main_menu_North.addChild(btn_north);
    function btn_over_north(e:MouseEvent):void
              e.target.parent.over = true;
    function btn_out_north(e:MouseEvent):void
              e.target.parent.over = false;
    function btn_click_north(e:MouseEvent):void
              var mc= e.target.parent;
              if ( mc.item_url != undefined )
                        navigateToURL( new URLRequest( mc.item_url ), "_parent" );
              else
                        change_page_north(mc.item_no);
    function btn_enter_north(e:Event):void
              var mc_north = e.target.parent;
              if ( mc_north.over == true )
                        mc_north.nextFrame();
              else
                        mc_north.prevFrame();
    function change_page_north(no:Number):void
              for (var i:Number = 0; i < main_menu_North.numChildren; i++)
                        var mc = MovieClip( main_menu_North.getChildAt(i) );
                        mc.over = false;
                        mc.flashmo_click_area.visible = true;
                        mc.flashmo_click_area.addEventListener( MouseEvent.ROLL_OVER, btn_over_north );
                        mc.flashmo_click_area.addEventListener( MouseEvent.ROLL_OUT, btn_out_north );
                        mc.flashmo_click_area.addEventListener( MouseEvent.CLICK, btn_click_north );
              var mc_selected = MovieClip( main_menu_North.getChildAt(no) );
              mc_selected.over = true;
              mc_selected.flashmo_click_area.visible = false;
              mc_selected.flashmo_click_area.removeEventListener( MouseEvent.ROLL_OVER, btn_over_north );
              mc_selected.flashmo_click_area.removeEventListener( MouseEvent.ROLL_OUT, btn_out_north );
              mc_selected.flashmo_click_area.removeEventListener( MouseEvent.CLICK, btn_click_north );
              page_north = no + 1;
              play();
    change_page_north(0);// default page on load
    flashmo_credit.addEventListener( MouseEvent.CLICK, goto_fm_north );
    function goto_fm_north(e:MouseEvent):void
              navigateToURL( new URLRequest( "http://www.flashmo.com" ), "_parent" );
    music_credit.addEventListener( MouseEvent.CLICK, goto_music_north );
    function goto_music_north(e:MouseEvent):void
              navigateToURL( new URLRequest(
              "http://www.premiumbeat.com/royalty_free_music/byPiece.php?id=2614" ),
              "_blank" );

    click file>publish settings>swf and tick "permit debugging".  retest.
    the line number of the code that contains that non-existant object you're trying to reference will be in the error message.  indicate that line of code if you're not sure which object that is.

  • Throwing TypeError: Error #1009

    Here is the zipped flash file, including necessary XMLs. ~30kb
    Currently working on a game... and it's functioning as a game as it is.
    But it's throwing some errors and cancels the creation of the words on occassion, more regularly as more words are on screen.
    Here it is in it's current (but accellerated) state...
    http://www.x1.ltd.uk/brooks_website/flashstuff/output/TextType2.3.1.swf
    Looking at the bottom left hand corner after the game is started, you can see how many words are on screen.
    As the word count gets higher, the speed the words are created at should also increase.
    But, due to the errors, the opposite is currently true.
    I believe that this is the code that is throwing the errors, as the more words that are on screen, the more likely that the random word has a letter currently already on screen, and so the loop will have to try again.
    Any help on why the errors are being thrown would be appreciated.
    Here is the zipped flash file, including necessary XMLs. ~30kb

    It only throws every now and again... not every time.
    More often the moer words there are on the screen..
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at TextType2_fla::MainTimeline/testWord()[TextType2_fla.MainTimeline::frame1:215]
    at TextType2_fla::MainTimeline/newWord()[TextType2_fla.MainTimeline::frame1:209]
    at TextType2_fla::MainTimeline/countFrames()[TextType2_fla.MainTimeline::frame1:162]
    line 215 - chooseWord = Math.random()*fromXML.word.length();
    Setting chooseWord, an integer variable created at run-time.
    The XML was also loaded before the game is allowed to start.
    line 209 - testWord();
    Calling a function
    line 162 - newWord();
    Calling a function

  • Adobe Air + Box2D.swc = TypeError: Error #1009 // New way to handle .swc files in Flash for iOS Apps?

    Hi,
    I need your help please - I have to update one of my iOS Apps. In this App I use Box2d for a simple maze game (it's an app for kids). When I publish & test this game on my Mac it works fine. I can drag my Hero (fish) through this Maze and all collision detections, gravity etc. work perfect.
    When I test it on my iPad it doesn't work. The device debugger shows this error message:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at global$init()
      at global$init()
      at Box2DAS.Common::b2Base$/initialize()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_ Retina/src/com/Box2DAS/Common/b2Base.as:31]
      at wck::WCK/create()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Retina/src/com/wck/ WCK.as:26]
      at misc::Entity/ensureCreated()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Retina/s rc/com/misc/Entity.as:50]
      at misc::Entity/handleAddedToStage()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Ret ina/src/com/misc/Entity.as:100]
      at misc::Entity/handleAddedToStage()
    Line 31: loader = new CLibInit();
    I guess "CLibInit" should come from the .swc file.
    The thing is:
    I didn't change anything in this maze game - it seems this has to do something with the new Flash and/or Adobe Air version. Box2D.swc file is included:
    It always worked like this - and it works when testing it on my Mac - but it is no longer working on my current system.
    So I started my Mac from an older system (10.9.5 on an external HD) and published the App from Flash CS6 and Adobe Air 13.0 - then it suddenly worked on my iPad as before. I was able to tap an the fish and drag it arround.
    The same project / app published from my current OS X 10.10 + Flash CC 2014 + Adobe Air 15.0.0.302 is not working. I always receive this Error Message - I can not drag the fish - nothing happens. And I have no idea why this happens and what else I could do. I searched the whole day for a solution but didn't find anything.
    So did anything change by the way Flash and/or Air handles .swc files? Is there an other way to include: import cmodule.Box2D.* / CLibInit ?
    Please - if anyone has a clue - please let me know!!
    Best regards
    Jan

    Update:
    There is also an Android Version of this App. I just published and tested a new version of it on my kindle fire & Samsung Galaxy Tab 2. On both Tablets the maze works perfect. I'm able to drag the fish around etc.
    Then I published this Android Version for iOS and tested it on my iPad. Again I'm getting the Error message:
    TypeError: Error #1009: Cannot access a property or method of a null object reference. 
      at global$init() 
      at global$init() 
      at Box2DAS.Common::b2Base$/initialize()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_ Retina/src/com/Box2DAS/Common/b2Base.as:31] 
      at wck::WCK/create()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Retina/src/com/wck/ WCK.as:26] 
      at misc::Entity/ensureCreated()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Retina/s rc/com/misc/Entity.as:50] 
      at misc::Entity/handleAddedToStage()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Ret ina/src/com/misc/Entity.as:100] 
      at misc::Entity/handleAddedToStage
    ...and the fish is stuck - I can't drag it - nothing happens. So this error only occurs when I publish the App for iOS - as an .ipa. Did anything change in the way Air handles .swc files?
    I'm totally confused
    If anybody has an idea what I could try - PLEASE LET ME KNOW!!

  • TypeError: Error #1009: How do I find the exact line of the error?

    I got the following error when testing a project:
    [SWF] ProjectZ_iOS.swf - 12154544 bytes after decompression
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
                    at ProjectZ_iOS_fla::MainTimeline/goButtons()[ProjectZ_iOS_fla.MainTimeline::frame71:54]
    I'm not sure how to read this as there is no "frame 71." Also, what does this mean, "MainTimeline::frame71:54"?  

    flash is detecting code on frame 71 of your main timeline in ProjectZ_iOS.fla.
    if you have scenes, the timeline in each scene is laid end-to-end and the frames are numbered sequentially.  so, while you may not think you have a frame 71, flash does.

  • ActionScript TypeError: Error #1009?

    Okay, so I was on this website earlier, www.peterdavid.net and tried to view a video that Vevo was hosting directly on the site's homepage, when it loaded up till about 56% an ActionScript error came up saying basicallly something like:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at com.vevo.mx::MenuScreenContainer/setModelInfo()
        at EmbeddedPlayer/bootstrapCompleteHandler()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at org.swizframework::Swiz$/dispatchEvent()
        at com.vevo.controller::BootstrapController/checkAsyncCalls()
        at com.vevo.controller::BootstrapController/youTubeReadyHandler()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at org.swizframework::Swiz$/dispatchEvent()
        at EmbeddedPlayer/playerReadyHandler()
        at EmbeddedPlayer/__corePlayer_playerReady()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::UIComponent/dispatchEvent()
        at com.vevo.view.controls::CorePlayer/playerReadyHandler()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::UIComponent/dispatchEvent()
        at com.vevo.view.controls::AS3YouTubePlayer/onPlayerReady()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at com.google.youtube.application::SwfProxy/onExternalEvent()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at com.google.youtube.model::YouTubeEnvironment/broadcastExternal()
        at com.google.youtube.application::VideoApplication/build()
        at com.google.youtube.application::Application/onInited()
        at com.google.youtube.application::VideoApplication/onInited()
        at com.google.youtube.application::Application/initData()
        at com.google.youtube.application::VideoApplication/initData()
        at com.google.youtube.application::Application/init()
        at com.google.youtube.application::VideoApplication/init()
        at com.google.youtube.application::Application/onInit()
    Now my question is really, first of all, is this a problem with the website or with my computer, second, how do I fix this, and yeah I don't know anything about ActionScript, I was not trying to write one at all I simply came across a website and this happened during the video playing. Any thoughts?
    EDIT: not sure if it would help, but the options I had were to Dismiss All and Continue.
    Thanks in advance.

    Usually this type of error is caused by the website, rather than your Flash Player installation.  If you tell us what video on the website is causing it, someone here can test it.
    What OS and browser are you using?
    Also, is 'third-party content' checked on the Flash Player Settings Manager at http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager.html ?

  • TypeError: Error #1009 - (Null reference error) With Flash.

    I am not an expert in flash, but i do work with AS and tweak Flash projects , though not having deep expertise in it. Currently i need to revamp a flash website done by one another guy, and the code base given to me, upon execution is throwing the following error.
    "--- TypeError: Error #1009: Cannot access a property or method of a null object reference. at NewSite_fla::MainTimeline/__setProp_ContactOutP1_ContactOut_Contents_0() at NewSite_fla::MainTimeline/frame1() --"
    The structure of the project is like, it has the different sections split into different movie clips. There is no single main timeline, but click actions on different areas of seperate movie clips will take them between one another. All the AS logic of event handling are written inline in FLA , no seperate Document class exists.
    Preloader Movie clip is the first one getting loaded. As i understood the error is getting thrown initially itself, and it is not happening due to any Action script logic written inline, because it is throwing error even before hitting the first inline AS code.
    I am not able to figure Out what exactly it causing the problem, or where to resolve it. I setup the stuff online, for reference if anybody want to take a look at it, and here is the link.You need to have flash debugger turned ON in your browser, if need to see the exception getting triggered.
    http://tinyurl.com/2alvlfx
    I really got stuck at this point. Any help will be great.I had not seen the particular solution i am looking for anywhere yet, though Error #1009 is common.

    Thanks, for putting effort in helping me. I debugged the movie.The line of code being shown is this >>
    if(__setPropDict[ContactOutP1]== undefined ||  ! ((int(__setPropDict[ContactOutP1]) >= 1 && int(__setPropDict[ContactOutP1]) <=5))){
          __setPropDict[ContactOutP1] = currentFrame;
         __setProp_ContactOutP1_ContactOut_Contents_0();
    And i think this third line of code is where the exception is being thrown. But as i understood, this code is not written by the developer. I had nto seen this code, anywhere in the actions. Hopefully this will give you hint about what is exactly causing the issue and what can be done to resolve it.

  • Error 1009 / Using swf in Flex

    Hi all.
    I am creating a small Flex Application which will include a swf.
    The application consists of two panels, with the left being a Flash app. As the user moves the mouse over the Flash, it should trigger different messages on the right panel.
    A screenshot is attached to get an idea of what I'm aiming for.
    This is the error I'm getting:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at flash_component_fla::MainTimeline/frame1()
    Additionally, I'm struggling with two things:
    How do I get the output panel to display in the Rockwell font
    How do I get the Flash part to send the mouse position to the Flex?
    So this is what I have:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
         xmlns:mx="http://www.adobe.com/2006/mxml"
         layout="absolute"
         height="610" width="750"
         creationComplete="showCursor()" backgroundColor="white" cornerRadius="10" borderStyle="solid">
         <mx:Style>
         .boxClass {
            fontFamily: Rockwell, Trebuchet MS, Helvetica, "_sans";
            color: Red;
            fontSize: 12;
            fontWeight: bold;
        </mx:Style>
        <mx:Script>
        <![CDATA[
        [Bindable] public var clickText:XMLList;
        private var panelText:XML =
                     <textDetails>
                          <bodyPart>
                                  <partName>throat</partName>
                                  <partNo>You cannot donate when you have a sore throat or a throat infection</partNo>
                                  <partYes>Once the sore throat has cleared, or a week after any antibiotics have finished, you can donate.</partYes>
                             </bodyPart>
                             <bodyPart>
                                  <partName>pregnancy</partName>
                                  <partNo>You cannot donate wwhile you are pregnant</partNo>
                                  <partYes>You can donate when the expected baby iis nine months old</partYes>
                             </bodyPart>
                             <bodyPart>
                                  <partName>hayfever</partName>
                                  <partNo>Only restricted iif you are feeling unwell</partNo>
                                  <partYes>You can donate iif you are feeling well, even iif you are taking medication</partYes>
                             </bodyPart>
                             <bodyPart>
                                  <partName>dentist</partName>
                                  <partNo>Wait seven days after complicated dental work, such aas tooth extractions</partNo>
                                  <partYes>You can donate after simple inspections, or after 24hrs after fillings.</partYes>
                             </bodyPart>
                             <bodyPart>
                                  <partName>asthma</partName>
                                  <partNo>If you having the effects of the asthma</partNo>
                                  <partYes>You can donate iif you are feeling well, even iif you uuse a preventative inhaler</partYes>
                             </bodyPart>
                             <bodyPart>
                                  <partName>Surgery</partName>
                                  <partNo>Major Surgery: Please call the helpline</partNo>
                                  <partYes>Minor Surgery: As long aas there were no complications and the donor has recovered.</partYes>
                             </bodyPart>
                        </textDetails>
              import mx.managers.CursorManagerPriority;
               import mx.managers.CursorManager;
               import flash.events.Event;
               private function functions():void     {
                             throat.addEventListener(MouseEvent.CLICK, changeText);
              private function changeText(event:Event):void {
                             clickText = panelText.bodyPart[0].partYes;
                             output.text= clickText;
         [Embed("nbs1.gif")]
          private var customCursor:Class;
         private function showCursor():void
            CursorManager.setCursor(
              customCursor,
              CursorManagerPriority.HIGH,
              -1,
              -1);
         ]]>
           </mx:Script>
         <mx:Panel x="481" y="69" width="250" height="516" layout="absolute" id="rt">
              <mx:Text x="10" y="10" text="Other Considerations..."/>
              <mx:Accordion x="8" y="36" width="212" height="277">
                   <mx:Canvas label="Blood Transfusions" width="100%" height="100%" dropShadowEnabled="true" dropShadowColor="#F50B0B">
                        <mx:Text x="10" y="10" width="190">
                             <mx:htmlText>If you have recieved a blood transfusion since the beginning of 1980, you cannot currently donate.</mx:htmlText>
                        </mx:Text>
                   </mx:Canvas>
                   <mx:Canvas label="Travel" width="100%" height="100%">
                   <mx:Text x="10" y="10" width="190">
                             <mx:htmlText>Travellers to malarial areas and countries with West Nile Virus should contact the helpline for more details.</mx:htmlText>
                        </mx:Text>
                   </mx:Canvas>
                   <mx:Canvas label="Weight" width="100%" height="100%">
                   <mx:Text x="10" y="10" width="190">
                             <mx:htmlText>You need to weigh 50kg, or 7st 12lb to donate.</mx:htmlText>
                        </mx:Text>
                   </mx:Canvas>
                   <mx:Canvas label="Tattoos and piercings" width="100%" height="100%">
                        <mx:Text x="10" y="10" width="190">
                             <mx:htmlText>Any new piercings or tattoos, or acupuncture? You now have to wait just four months before being eligible to donate.</mx:htmlText>
                        </mx:Text>
                   </mx:Canvas>
                   <mx:Canvas label="Age Limits" width="100%" height="100%">
                        <mx:Text x="10" y="10" width="190">
                             <mx:htmlText>
                                  Under 16: Too young. Sorry!
                                  16 - 17: You can register, but not donate 17 - 65: Please register! 66 - 70: If you have ever donated, you can donate 70+: Only if you have donated in the last two years.
                             </mx:htmlText>
                        </mx:Text>
                   </mx:Canvas>
                   <mx:Canvas label="Antibiotics" width="100%" height="100%">
                        <mx:Text x="10" y="10" width="190">
                             <mx:htmlText>
                                  You can donate seven days after the antibiotics have finished, as long as the infection has cleared.
                             </mx:htmlText>
                        </mx:Text>
                   </mx:Canvas>
                   <mx:Canvas label="Common Cold" width="100%" height="100%">
                        <mx:Text x="10" y="10" width="190">
                             <mx:htmlText>
                                  You can donate when the cold has cleared and you are feeling well.
                             </mx:htmlText>
                        </mx:Text>
                   </mx:Canvas>
              </mx:Accordion>
              <mx:TextArea
                   id="output"
                   x="10" y="321"
                   text="Move the cursor over the bodies to find out more about how your health affects blood donation!"
                   width="210" color="#F21212" styleName="boxClass" height="68"/>
         </mx:Panel>
         <mx:Image x="667" y="35" source="NHS.jpg" width="65" height="26"/>
         <mx:Image x="10" y="22" source="headline.gif"/>
         <mx:SWFLoader x="10" y="69" source="flash_component.swf" id="throat"/>
    </mx:Application>

    Hmm, thanks Flex HarUI... IU I kinda think the boffins at Adobe are less likely than me to have the problems.
    I'm going to attach the swf and it's associated .fla if that is any more help.
    For the record this is the Error Message:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at flash_component_fla::MainTimeline/frame1()
    Any help would be hugely appreciated...

  • TypeError: Error #1009: Cannot access a property or method of a null object reference. at code::Game

    Hi, I’m doing a game for an assignment for college. Using Flash CS 5. I got this error
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at code::Game1()
    When I tried to go to the next page, I thought I linked correctly. Can anyone help me? Thanks
    you can find the coding here http://pastebin.com/iz8a6w6Z

    click file>publish settings>swf and tick "permit debugging".  retest.
    the problematic line number will be in the error message.  that will tell you which reference you're trying to use that is null.

  • Another TypeError: Error #1009 Problem

    Hey all,   I've searched the 'net and searched these forums but can't seem to figure out what I'm doing wrong.  I'm creating a flash based game for school that so far has ten frames on the timeline.  I have buttons on frame one, frame 5, and frame 10. I have actionscript code to control those buttons on frame 1, frame 5, and frame 10 respectively.  The code is worded identically on each frame with the exception that I've changed the button names and the function names that are called when the mouse button is pressed.   The code works fine on frame 1 and on frame 5, but when I click the button on frame 5 that sends me to frame 10, I get this error immediately:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at keys2BibleTest_fla::MainTimeline/frame10()
        at flash.display::MovieClip/gotoAndStop()
        at keys2BibleTest_fla::MainTimeline/stormBtnHandler1()
    I have verified that each instance of the buttons do indeed have the name of the button being listened for in the event handlers. I can change the type from button to movieclip and it works fine.  I can also remove frames 1 through 9 and the code works.
    Here's the code:
    Frame 1:
    stop();
    enterBtn.addEventListener(MouseEvent.MOUSE_DOWN, enterBtnHandler1);
    function enterBtnHandler1(event:MouseEvent):void {
        gotoAndStop(5, "Scene 1");
    Frame 5:
    import flash.events.MouseEvent;
    stormBtn.addEventListener(MouseEvent.MOUSE_DOWN, stormBtnHandler1);
    function stormBtnHandler1(event:MouseEvent):void {
        gotoAndStop(10, "Scene 1");
    chickenOutBtn.addEventListener(MouseEvent.MOUSE_DOWN, chickenOutBtnHandler1);
    function chickenOutBtnHandler1(event:MouseEvent):void {
        gotoAndStop(1, "Scene 1");
    Frame 10:
    import flash.events.MouseEvent;
    creationBtn.addEventListener(MouseEvent.MOUSE_DOWN, creation);
    function creation(event:MouseEvent):void {
        gotoAndStop(3, "Scene 1");
    lifeBtn.addEventListener(MouseEvent.MOUSE_DOWN, lifeOfChrist);
    function lifeOfChrist(event:MouseEvent):void {
        navigateToURL(new URLRequest("http://www.ceoutreach.org"));
    I can't for the life of me figure out what's wrong.  Can anyone help?
    Thank you,
    Mike

    Ned,
    thank you for your reply. Unfortunately, my buttons are on separate layers and separated by blank keyframes to boot.  When I posted originally, the buttons were all on the same layer BUT separated by blank keyframes. After doing some research on the web, I moved the buttons to their own separate layers (one button per layer) and kept the blank keyframes as well.
    Currently, my only filled keyframes are one, five, and ten. All other keyframes are blank except for my labels and actionscript code. I'm using separate layers for labels and actions, too. I attempted to attach the file with my original post but received the message that .fla files are not allowed.  I don't know about your window, but mine says Max size 5.0 MB (my file is 2), All files types allowed except.... .fla is not one of those in the exception list so I expected it to go.
    It's got something to do with the two buttons on frame 10.... I just went into the actionscript and bypassed frame 5, going directly to frame 10 when the Enter button is depressed, and got the same error message.   There's something in the code I'm just not seeing.... when I comment out the code for the buttons, no error message.  Put the code back in, error message comes back.  Delete the buttons and the code and insert new ones, the error message comes back.
    It's got me totally stumped.
    Thank you for trying,
    Mike
    Edit: I forgot to mention, frame ten is the only place on the timeline where instances of these particular buttons are being used. The other frames are populated with different buttons.  Also, when I change the type to movieclip, everything works.  Weird, huh?

  • New to action script and getting: TypeError: Error #1009: Cannot access a property or method of a nu

    I am getting this message in the output tab for buttons that I am trying to create.  Here's the code:
    import flash.events.MouseEvent;
    stop();
    function goHome(myEvent:MouseEvent):void {
    gotoAndStop("home");
    SoundMixer.stopAll();
    function goAbout(myEvent:MouseEvent):void {
    gotoAndStop("about");
    SoundMixer.stopAll();
    function goBusiness(myEvent:MouseEvent):void {
    gotoAndStop("business");
    SoundMixer.stopAll();
    function goContact(myEvent:MouseEvent):void {
    gotoAndStop("contact");
    SoundMixer.stopAll();
    function goArchives(myEvent:MouseEvent):void {
    gotoAndStop("archives");
    SoundMixer.stopAll();
    function goBioTech(myEvent:MouseEvent):void {
    gotoAndStop("bioTech");
    SoundMixer.stopAll();
    function goRealEstate(myEvent:MouseEvent):void {
    gotoAndStop("realEstate");
    SoundMixer.stopAll();
    function goTechnology(myEvent:MouseEvent):void {
    gotoAndStop("technology");
    SoundMixer.stopAll();
    function goEnergy(myEvent:MouseEvent):void {
    gotoAndStop("energy");
    SoundMixer.stopAll();
    home_btn.addEventListener(MouseEvent.CLICK, goHome);
    about_btn.addEventListener(MouseEvent.CLICK, goAbout);
    business_btn.addEventListener(MouseEvent.CLICK, goBusiness);
    contact_btn.addEventListener(MouseEvent.CLICK, goContact);
    archives_btn.addEventListener(MouseEvent.CLICK, goArchives);
    bioTech_btn.addEventListener(MouseEvent.CLICK, goBioTech);
    realEstate_btn.addEventListener(MouseEvent.CLICK, goRealEstate);
    technology_btn.addEventListener(MouseEvent.CLICK, goTechnology);
    energy_btn.addEventListener(MouseEvent.CLICK, goEnergy);
    I ran the debugger and got this:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at peakInsights_fla::MainTimeline/frame1()[peakInsights_fla.MainTimeline::frame1:48]
    I guess it's telling me there's a problem with line 48 but what?
    The home, about, business, contact, and archives button works. On the business page there are the remaining buttons biotech, technology, real estate, and energy. when i test it; i get the finger but the buttons don't work. this is my first flash site so I'am new, new.

    I followed the steps and read some of your comments on the same top topic in another thread. When I put it on the first frame it was okay but the next button on that page had the same problem.  So what I am guessing is that I have to either create a document class or put the actions where the buttons are.  Am I understanding that correctly?  In the other thread in which you helped someone else; there was so comments about document class.  I found a tutorial on it and the way I understand it is that it you can put you actions in an external document.  But you have to include in the event listener the frame in which you want that action to happen.
    Thaks for your help.  And patience.

Maybe you are looking for