TypeError: Error #1009 on FLVPlayback

I've been struggling with this error for a few days now, I can't seem to figure out what is actually going wrong.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
     at fl.video::UIManager/http://www.adobe.com/2007/flash/flvplayback/internal::hookUpCustomComponents()
     at fl.video::FLVPlayback/http://www.adobe.com/2007/flash/flvplayback/internal::handleVideoEvent()
     at flash.events::EventDispatcher/dispatchEventFunction()
     at flash.events::EventDispatcher/dispatchEvent()
     at fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::setState()
     at fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::finishAutoResize()
     at flash.utils::Timer/_timerDispatch()
     at flash.utils::Timer/tick()
The app is one for a tourist centre, with an intro video that can be skipped by being clicked, which leads to a four options menu, of which two options lead you to frames with intro videos which can also be bypassed by a simple click. All three intro videos use the FLVPlayback 2.5 component. The app runs without any issues, even playing the videos with no problem, until, seemingly at random intervals, this error will occur. It does, however, only occur at the start or end of a video. I have had trouble tracing the error. It causes the program to become unresponsive at seemingly random intervals while the program is being used, or even if it's just running looping video. If I dismiss the error, the program will continue to run without any further issues, except for this error, which can be in turn dismissed, etc... However, when it is installed on the system it simply becomes unresponsive since dismissing it is not an option. I have not been able to catch or trace this error or its source. Any ideas? I'll attatch the code from one of my frames with the FLVPlayback, since that seems to be where the error is.
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
import fl.video.FLVPlayback;
import fl.video.*;
var heritageVideo:FLVPlayback = heritage_sequence;
stage.addEventListener(MouseEvent.CLICK, gotoHeritageHistory);
stop();
heritageVideo.addEventListener(VideoEvent.COMPLETE, gotoHeritageTwo);
function gotoHeritageHistory(evt:MouseEvent):void
     gotoAndStop(6);
     stage.removeEventListener(MouseEvent.CLICK, gotoHeritageHistory);
     heritageVideo.removeEventListener(VideoEvent.COMPLETE, gotoHeritageTwo);
     heritageVideo.stop();
     heritageVideo.visible = false;
function gotoHeritageTwo(evt:VideoEvent):void
     gotoAndStop(6);
     stage.removeEventListener(MouseEvent.CLICK, gotoHeritageHistory);
     heritageVideo.removeEventListener(VideoEvent.COMPLETE, gotoHeritageTwo);
     heritageVideo.visible = false;
This is my first real as3 work, so I wouldn't be surprised if I'm missing something obvious, and I do hope that's the case. Let me know if you have any ideas!

Hi,
From the error, it looks like you're trying to manipulate something that isn't initialized yet.  I'm not very familiar with Flash professional (I do my work using Flash Builder), would you mind posting this over on the Flash forums?  You'll probably get a much better response over there.
Thanks,
Chris

Similar Messages

  • Component on Scene 2 causes TypeError: Error #1009??

    This one should be easy to explain because I'm sure a lot of
    you have noticed it. Just create a Scene 2 and put any component
    (EDIT: Try FLVPlayback since removing and re-adding the other
    components seemed to work for me) on the stage and compile. You'll
    get this error:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at
    Untitled_fla::MainTimeline/__setProp___id1__Scene2_Layer1_0()
    at Untitled_fla::MainTimeline/frame1()
    where id1 is the instance name if you assigned one.
    My original project worked fine in CS3 (actionscript 3, Flash
    9 project) but after upgrading to CS4 I got this error when
    compiling. I thought it had to do with not having a
    addEventListener(Event.ADDED_TO_STAGE, onAddedToStage); but once I
    narrowed it down to the issue with Scenes and Components I figured
    it must not.
    What is causing this and how do I fix it?
    Thank you!

    I'm on a plain 10.0 but I don't think it is a Flash issue as
    you are trying to do something that is not possible. I jumped
    directly from 8 to CS4 so I cannot tell about how CS3 handles
    things, but you will not be able to access a component from within
    a scene that does not contain the instance.
    Or will you also get the error on a plain Scene 1 and Scene 2
    containing only a simple button component? As said, I don't.

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

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

    Hi all,
    I am new to ActionScript and Flash, and I am getting this error: TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at jessicaclucas_fla::MainTimeline/stopResumescroll()
    I have several different clips in one movie that have scrolling content. When I click a button to move to a different clip that doesn’t have a certain scroll, it gives me this error. I cannot figure out how to fix this. You can see the site I am working on: http://www.jessicaclucas.com. I would really appreciate some help! Thank you in advance. Here is the code:
    //Import TweenMax and the plugin for the blur filter
    import gs.TweenMax;
    import gs.plugins.BlurFilterPlugin;
    //Save the content’s and mask’s height.
    //Assign your own content height here!!
    var RESUMECONTENT_HEIGHT:Number = 1500;
    var RESUME_HEIGHT:Number = 450;
    //We want to know what was the previous y coordinate of the content (for the animation)
    var oldResumeY:Number = myResumecontent.y;
    //Position the content on the top left corner of the mask
    myResumecontent.x = myResume.x;
    myResumecontent.y = myResume.y;
    //Set the mask to our content
    myResumecontent.mask = myResume;
    //Create a rectangle that will act as the Resumebounds to the scrollMC.
    //This way the scrollMC can only be dragged along the line.
    var Resumebounds:Rectangle = new Rectangle(resumescrollMC.x,resumescrollMC.y,0,450);
    //We want to know when the user is Resumescrolling
    var Resumescrolling:Boolean = false;
    //Listen when the user is holding the mouse down on the scrollMC
    resumescrollMC.addEventListener(MouseEvent.MOUSE_DOWN, startResumescroll);
    //Listen when the user releases the mouse button
    stage.addEventListener(MouseEvent.MOUSE_UP, stopResumescroll);
    //This function is called when the user is dragging the scrollMC
    function startResumescroll(e:Event):void {
    //Set Resumescrolling to true
    Resumescrolling = true;
    //Start dragging the scrollMC
    resumescrollMC.startDrag(false,Resumebounds);
    //This function is called when the user stops dragging the scrollMC
    function stopResumescroll(e:Event):void {
    //Set Resumescrolling to false
    Resumescrolling = false;
    //Stop the drag
    resumescrollMC.stopDrag();
    //Add ENTER_FRAME to animate the scroll
    addEventListener(Event.ENTER_FRAME, enterResumeHandler);
    //This function is called in each frame
    function enterResumeHandler(e:Event):void {
    //Check if we are Resumescrolling
    if (Resumescrolling == true) {
    //Calculate the distance how far the scrollMC is from the top
    var distance:Number = Math.round(resumescrollMC.y - Resumebounds.y);
    //Calculate the percentage of the distance from the line height.
    //So when the scrollMC is on top, percentage is 0 and when its
    //at the bottom the percentage is 1.
    var percentage:Number = distance / RESUME_HEIGHT;
    //Save the old y coordinate
    oldResumeY = myResumecontent.y;
    //Calculate a new y target coordinate for the content.
    //We subtract the mask’s height from the contentHeight.
    //Otherwise the content would move too far up when we scroll down.
    //Remove the subraction to see for yourself!
    var targetY:Number = -((RESUMECONTENT_HEIGHT - RESUME_HEIGHT) * percentage) + myResume.y;
    //We only want to animate the scroll if the old y is different from the new y.
    //In our movie we animate the scroll if the difference is bigger than 5 pixels.
    if (Math.abs(oldResumeY - targetY) > 5) {
    //Tween the content to the new location.
    //Call the function ResumetweenFinished() when the tween is complete.
    TweenMax.to(myResumecontent, 0.3, {y: targetY, blurFilter:{blurX:22, blurY:22}, onComplete: ResumetweenFinished});
    //This function is called when the tween is finished
    function ResumetweenFinished():void {
    //Tween the content back to “normal” (= remove blur)
    TweenMax.to(myResumecontent, 0.3, {blurFilter:{blurX:0, blurY:0}});

    Hi again,
    Thank you for helping. I really appreciate it! Would it be easier to say, if resumescrollMC exists, then execute these functions? I was not able to figure out the null statement from your post. Here is what I am trying (though I am not sure it is possible). I declared the var resumescrollMC, and then I tried to put pretty much the entire code into an if (resumescrollMC == true) since this code only needs to be completed when resumescrollMC is on the stage. It is not working the way I have tried, but I am assuming I am setting up the code incorrectly. Or, an if statement is not supposed to be issued to an object:
    //Import TweenMax and the plugin for the blur filter
    import gs.TweenMax2;
    import gs.plugins.BlurFilterPlugin2;
    //Save the content's and mask's height.
    //Assign your own content height here!!
    var RESUMECONTENT_HEIGHT:Number = 1500;
    var RESUME_HEIGHT:Number = 450;
    var resumescrollMC:MovieClip;
    if (resumescrollMC == true) {
    //We want to know what was the previous y coordinate of the content (for the animation)
    var oldResumeY:Number = myResumecontent.y;
    //Position the content on the top left corner of the mask
    myResumecontent.x = myResume.x;
    myResumecontent.y = myResume.y;
    //Set the mask to our content
    myResumecontent.mask = myResume;
    //Create a rectangle that will act as the Resumebounds to the scrollMC.
    //This way the scrollMC can only be dragged along the line.
    var Resumebounds:Rectangle = new Rectangle(resumescrollMC.x,resumescrollMC.y,0,450);
    //We want to know when the user is Resumescrolling
    var Resumescrolling:Boolean = false;
    //Listen when the user is holding the mouse down on the scrollMC
    resumescrollMC.addEventListener(MouseEvent.MOUSE_DOWN, startResumescroll);
    //Listen when the user releases the mouse button
    stage.addEventListener(MouseEvent.MOUSE_UP, stopResumescroll);
    //This function is called when the user is dragging the scrollMC
    function startResumescroll(e:Event):void {
    //Set Resumescrolling to true
    Resumescrolling = true;
    //Start dragging the scrollMC
    resumescrollMC.startDrag(false,Resumebounds);
    //This function is called when the user stops dragging the scrollMC
    function stopResumescroll(e:Event):void {
    //Set Resumescrolling to false
    Resumescrolling = false;
    //Stop the drag
    resumescrollMC.stopDrag();
    //Add ENTER_FRAME to animate the scroll
    addEventListener(Event.ENTER_FRAME, enterResumeHandler);
    //This function is called in each frame
    function enterResumeHandler(e:Event):void {
    //Check if we are Resumescrolling
    if (Resumescrolling == true) {
    //Calculate the distance how far the scrollMC is from the top
    var distance:Number = Math.round(resumescrollMC.y - Resumebounds.y);
    //Calculate the percentage of the distance from the line height.
    //So when the scrollMC is on top, percentage is 0 and when its
    //at the bottom the percentage is 1.
    var percentage:Number = distance / RESUME_HEIGHT;
    //Save the old y coordinate
    oldResumeY = myResumecontent.y;
    //Calculate a new y target coordinate for the content.
    //We subtract the mask's height from the contentHeight.
    //Otherwise the content would move too far up when we scroll down.
    //Remove the subraction to see for yourself!
    var targetY:Number = -((RESUMECONTENT_HEIGHT - RESUME_HEIGHT) * percentage) + myResume.y;
    //We only want to animate the scroll if the old y is different from the new y.
    //In our movie we animate the scroll if the difference is bigger than 5 pixels.
    if (Math.abs(oldResumeY - targetY) > 5) {
    //Tween the content to the new location.
    //Call the function ResumetweenFinished() when the tween is complete.
    TweenMax.to(myResumecontent, 0.3, {y: targetY, blurFilter:{blurX:22, blurY:22}, onComplete: ResumetweenFinished});
    //This function is called when the tween is finished
    function ResumetweenFinished():void {
    //Tween the content back to "normal" (= remove blur)
    TweenMax.to(myResumecontent, 0.3, {blurFilter:{blurX:0, blurY:0}});

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

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

  • Using papervision in flash builder and getting TypeError: Error #1009: when using object.pitch(5)

    When i use papervision in flash builder and i am doing a test, when i render a sphere using papervision with the following code it renders me the sphere.
    When i add a line sphere.pitch(2);      ||
    sphere.yaw(2);
    sphere.roll(2);
    i get the following error,
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at PvTest/onRenderTick()[D:\Android 3D\PvTest\src\PvTest.as:39]
    Can anyone help me figure out the error
    For additional Info, these are the imports i am doing:
    import org.papervision3d.objects.primitives.Sphere;
    import org.papervision3d.view.BasicView;

    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.

  • TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.controls::AdvancedDataGrid/findHeaderRenderer()

    Can anyone throw any light on this obscure Flex error?...
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at mx.controls::AdvancedDataGrid/findHeaderRenderer()[...path...\projects\datavisualisation\ src\mx\controls\AdvancedDataGrid.as:1350]
    at mx.controls::AdvancedDataGrid/mouseEventToItemRenderer()[...path...\projects\datavisualis ation\src\mx\controls\AdvancedDataGrid.as:1315]
    at mx.controls.listClasses::AdvancedListBase/mouseMoveHandler()[...path...\projects\datavisu alisation\src\mx\controls\listClasses\AdvancedListBase.as:8091]
    I found a related bug reported on Jira: https://bugs.adobe.com/jira/browse/FLEXDMV-1631
    But in our case, we have no zoom effect.  It may be timing related, as there is a lot of computation going on when this page, and the ADG is first initialised.
    Please?... Any suggestions or workarounds?  We don't want this falling over in the hands of our customers.
    <rant> And people wonder why I hate Flex!?  These obscure instabilities never happen when I develop Pure ActionScript.  The Flash platform is wonderfully stable.  But as soon as you bring Flex into play, things take longer to develop, it's a struggle to extend or change the behaviour of the bloated components, and everything falls apart as these bugs begin to surface.</rant>

    facing the same problem... sdk 4.1. no solution for about 2 years ????

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

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

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

  • TypeError: Error #1009 with hit test plz help

    //-----Actions and Events -----
    stage.addEventListener(MouseEvent.MOUSE_MOVE,charMove);
    function charMove(evt:MouseEvent)
    addEventListener(Event.ENTER_FRAME, checkcharCollision);
    function checkcharCollision(event:Event)
    for (var i:uint=0; i<char.length; i++)
    if (char[i].hitTestObject(cur))
    char.splice(i,1);
    lalLChannel = lalL.play();
    lalL_transform.volume = 1;
    lalLChannel.soundTransform = lalL_transform;
    lalBtn.gotoAndStop("ful");
    lalLChannel.addEventListener(Event.SOUND_COMPLETE, lalLComplete);
    and it gives me this error  as soon as i move the mouse:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at INDEX_fla::MainTimeline/checkcharCollision()
    ny ideas?
    thx pavel

    stage.addEventListener(MouseEvent.MOUSE_MOVE,charMove);
    function charMove(evt:MouseEvent)
    addEventListener(Event.ENTER_FRAME, checkcharCollision);
    function checkcharCollision(event:Event)
    if (char[0].hitTestObject(cur))
    trace("ok");
    and this?
    After such an error you sould minimize your codes and then add line by line your codes.
    At some point you will find the error.

Maybe you are looking for

  • How can I get rid of multiple versions of the iTunes Folder

    I am using Windows 7 and iTunes 12.1.1.4.  Multiple iTunes folders have been created on my computer (on both my C: drive and my D: drive under Users and My Documents) and they all have different content.  Some albums show up in one instance of the iT

  • Customizing a web gallery

    I am designing a website for a friend.  There will be a gallery page. Can I create a web gallery in lightroom that allows me to use my own background images? I don't want the gallery portion of the site to look so diffferent from the rest of the site

  • Synchronous SOAP: Get fault message on ABAP side

    Hi, I've a synchronous ABAP Proxy => PI 7.11 => SOAP scenario. The SOAP receiver is a third party application using AXIS 1.4. When I call the SOAP receiver with bad input via SOAP UI I receive an error message like that: <soapenv:Envelope xmlns:soape

  • Two ways to get dynamic text into my s:RichEditableText

    font styling doesnt work with.. textFlow="{TextConverter.importToFlow( articleText, TextConverter.TEXT_FIELD_HTML_FORMAT )}" images dont work with.. textFlow="{TextFlowUtil.importFromString(articleTe  xt)} the problem is one way shows the images i ha

  • Ipod sync lost photos

    I have iphoto 2 from when I bought my G4. I wanted to import my 1300 photos from iphoto to my ipod video, but it said my iphoto was too outdated. So i chose what i thought was my only other option, to synchronize photos from my 'albums' section. But