Full Browser in AS3 - Error #1009

Please Help...
I'm learning AS3 and Flash CS4 right now and I'm trying to do what I have been doing in AS2 for years and I'm having some problems.  I'm trying to make a Full-Browser Flash site and upon resizing the screen I get an error #1009.
I am able to to resize the mc's on the screen without a problem, but once I add simple interactivity, I get an error upon resizing the window.
To duplicate this problem,
1.  Test the movie
2.  Click on either circle
3.  Then click on the opposite circle.
4.  Then either resize or maximize the window and you will see the "Output window" with the Error #1009
I'm sure I'm doing something very stupid, but I just don't know what I'm doing wrong.
Here's a link to the fla file: http://plusonedesigngroup.com/test/nosaletest.fla
Please Help!
Thanks in advance,
Mike.

doghouse.
Yes, I was able to download your file and Thank You for trying to help.  The problem for me is I have no idea where to begin with your file...  There are 35 ".as" files controlling this movie and I'm very new to AS3.
Isn't there a simple way to control the timeline of a flash movie while using the full browser?
Thanks,
Mike.

Similar Messages

  • Error #1009 - the most stupid AS3 loader issue ever !!!

    Hi,
    (It's about AS3 / Flash CS4)
    As a developer I often have no controll what is the content of a movie being runtime-loaded. I must presume I have no control on it at all - movie clips are marketed and sold and the only thing expected is that they play nice. And they are supposed to be runtime-loaded by a simple "progress-bar" style loader.
    The loader movie itself is fine. Though it's not sort of these tricky "no timeline, document-class only" it used to do the job.
    The main code is as folllows:
    FRAME 2:
    var thisRequest:URLRequest = new URLRequest("movie.swf");
    var thisLoader:Loader = new Loader();
    var newContent:MovieClip;
    thisLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, doneLoading);
    function doneLoading(evt:Event):void{
        newContent = MovieClip(thisLoader.content);
            //stage.addChild(newContent); -- please notice I commented this line !!!
    FRAME 3:
    thisLoader.load(thisRequest);
    As you may see, it's nothing special - just regular loader stuff here...
    But the issue is that it throws errors just in case of some loaded SWFs.
    Another words - the content and structure of movie.swf impact the loader performance!
    Too often I notice this kind of error being thrown right after "thisLoader.load(thisRequest);" is execuded:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at movie_fla::MainTimeline/frame8()
    Right after - that means BEFORE adding loaded movie to the Stage childlist etc.
    I said - right after movie.swf is invoked by the "load" command !
    This is really rediculous!
    I do not expect this sort of behavior! I expect the loaded movie to be quiet unless explicitly added to stage with:
    stage.addChild(newContent);
    But in a contrary - it seems the loaded movie becomes somewhat active right after being loaded - even before being added to stage. And in some cases this prematured activity leads to hard-to-controll errors! Please notice the error is thrown despite line where loaded content is added to stage is commented!
    I said what I wanted to say - now dear Flash AS3 experts and mastahakas please - give me some advice what to do in this situation.
    I am really, really confused as I want to write clean, error-free code and I get run out of ideas how to deal with this nasty issue.
    Rgs,
    Ziggi

    Yeap,
    I found the solution:
    thisLoader.contentLoaderInfo.addEventListener(Event.INIT, initLoading);
    function initLoading(e:Event){
        newContent = MovieClip(thisLoader.content);
        newContent.stop();
    So, stopping the loaded movie in this handler do the job...
    Stupid anyway!

  • Error #1009 in as3 code to install an Air application from an embedded swf.

    Hi, I am getting error #1009 in my code when i try to install the application. I am new to action script and below is the code for my installer.
    var airSWF:Object; // This is the reference to the main class of air.swf
    var airSWFLoader:Loader = new Loader(); // Used to load the SWF
    var loaderContext:LoaderContext = new LoaderContext(); 
                                    // Used to set the application domain 
    var paramObjAppid:Object = LoaderInfo(this.root.loaderInfo).parameters.appid;
    //var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
    loaderContext.applicationDomain = ApplicationDomain.currentDomain;
    airSWFLoader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
    airSWFLoader.load(new URLRequest("http://airdownload.adobe.com/air/browserapi/air.swf"), 
                        loaderContext);
    function onInit(e:Event):void 
        airSWF = e.target.content;
    var url = '';
    var qty = '';
    var appID = '';
    var pubID = "";
    var runtimeVersion = "3";
    var tf:TextField = new TextField();       // create a TextField names tf for debugging
    tf.autoSize = TextFieldAutoSize.LEFT;
    //tf.size = 4;
    tf.wordWrap = true;
    tf.border = true;
    addChild(tf);        
    try
        var keyStr:String;
        var valueStr:String;
        var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;   //set the paramObj variable to the parameters property of the LoaderInfo object
        for (keyStr in paramObj)
            valueStr = String(paramObj[keyStr]);
            if ( keyStr == 'qty' ) {
                qty = Number(valueStr);
            if ( keyStr == 'url' ) {
                url = escape(valueStr);
            if ( keyStr == 'appid') {
                appID = valueStr;
    catch (error:Error)
    var arguments:Array = [qty];
    launchBtn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
    function fl_MouseClickHandler_2(event:MouseEvent):void
        airSWF.getApplicationVersion(appID, pubID, versionDetectCallback);    
    function versionDetectCallback(version:String):void
        if (version == null)
            trace("Not installed.");
            tf.appendText('Not Installed');
            try {
                   airSWF.installApplication(url, runtimeVersion, arguments);
                catch (error:Error){
                    tf.appendText(error.toString());
        else
            trace("Version", version, "installed.");
            tf.appendText("appID="+appID);
            try {
                airSWF.launchApplication(appID, pubID );
            catch(error:Error) {
                tf.appendText(error.toString());

    I managed to figure out what was causing the issue, I had a particular png image in my projects assets folder that seemed to be the culprit. Once I removed it the app installs just fine? Really weird?
    Adam

  • Error #1009: Cannot access a property or method

    Here's the context of the problem, in which I will try to include as much information as possible while keeping the explanation brief.
    I am trying to make a portfolio website (architectural design + concept art).  Flash / programing are not my focus and this is my first go at learning the software.  Due to the nature of the content and my (lack) of ability in AS3, I want the the coding to be really simple and still let the site look good.  The way the site is currently structured:
    1) Basic menu buttons that navigate to sections of the site (brings up a new page).
    2) Example, clicking on <Graphics> takes you to a new page and a sub-menu animates in (simple motion tween for the buttons to cascade down).  This animation is a movie clip placed on the main timeline.
    3) On the screen is also a slideshow for all the images within <Graphics>.  Instead of multiple small slideshows, I combined them all into one, so as to avoid complications with add / remove from stage.  There are prev / next buttons that keep images within their sub section (ie 1->2->3->1).  The sub-menu buttons are suppose to link to the start of each sub section, much like chapters on a DVD.  (The slideshow is a movieclip sub-nested in the menu movieclip).
    Main menu buttons work.
    Sub-menu animation works.
    Slideshow works.
    Can't get the sub-menu buttons to access the slideshow chapters.
    I have created and solved about half a dozen errors, and each time I fix something, it just causes another point to break.  I've gone around in circles for days, and not sure which was is up anymore.  So, while the slideshow works independently of the rest of the content, and I think I have the parent referencing correct, the problem I am currently facing is thus:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at 03graphics_fla::MainTimeline/frame1()
    I've browsed some other threads, and I think I know what the problem is.  Since the sub-menu is animated, the buttons do not appear on frame 1 of the nested timeline, while the actionscript is on frame 1 of the main timeline - thus the code doesn't exist yet when I click the button.
    Is this indeed the problem?  If so, how do I go about fixing it?
    Additionally, does the structure makes sense on how my site is organized?  Is there an easier / cleaner way to code it?
    (This thing is completely ghetto-rigged, I just need it to function - it's like my own little Millenium Falcon...)
    Cheers,
    Andy

    Try following this posting, which is just a posting or two away from your own in the forum...
    http://forums.adobe.com/thread/748542?tstart=0

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

  • What is the best practice for full browser video to achieve the highest quality?

    I'd like to get your thoughts on the best way to deliver full-browser (scale to the size of the browser window) video. I'm skilled in the creation of the content but learning to make the most out of Flash CS5 and would love to hear what you would suggest.
    Most of the tutorials I can find on full browser/scalable video are for earlier versions of Flash; what is the best practice today? Best resolution/format for the video?
    If there is an Adobe guide to this I'm happy to eat humble pie if someone can redirect me to it; I'm using CS5 Production Premium.
    I like the full screen video effect they have on the "Sounds of pertussis" web-site; this is exactly what I'm trying to create but I'm not sure what is the best way to approach it - any hints/tips you can offer would be great?
    Thanks in advance!

    Use the little squares over your video to mask the quality. Sounds of Pertussis is not full screen video, but rather full stage. Which is easier to work with since all the controls and other assets stay on screen. You set up your html file to allow full screen. Then bring in your video (netstream or flvPlayback component) and scale that to the full size of your stage  (since in this case it's basically the background) . I made a quickie demo here. (The video is from a cheapo SD consumer camera, so pretty poor quality to start.)
    In AS3 is would look something like
    import flash.display.Loader;
    import flash.net.URLRequest;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.ui.Mouse;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.display.StageDisplayState;
    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;
    // determine current stage size
    var sw:int = int(stage.stageWidth);
    var sh:int = int(stage.stageHeight);
    // load video
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    var vid:Video = new Video(656, 480); // size off video
    this.addChildAt(vid, 0);
    vid.attachNetStream(ns);
    //path to your video_file
    ns.play("content/GS.f4v"); 
    var netClient:Object = new Object();
    ns.client = netClient;
    // add listener for resizing of the stage so we can scale our assets
    stage.addEventListener(Event.RESIZE, resizeHandler);
    stage.dispatchEvent(new Event(Event.RESIZE));
    function resizeHandler(e:Event = null):void
    // determine current stage size
        var sw:int = stage.stageWidth;
        var sh:int = stage.stageHeight;
    // scale video size depending on stage size
        vid.width = sw;
        vid.height = sh;
    // Don't scale video smaller than certain size
        if (vid.height < 480)
        vid.height = 480;
        if (vid.width < 656)
        vid.width = 656;
    // choose the smaller scale property (x or y) and match the other to it so the size is proportional;
        (vid.scaleX > vid.scaleY) ? vid.scaleY = vid.scaleX : vid.scaleX = vid.scaleY;
    // add event listener for full screen button
    fullScreenStage_mc.buttonMode = true;
    fullScreenStage_mc.mouseChildren = false;
    fullScreenStage_mc.addEventListener(MouseEvent.CLICK, goFullStage, false, 0, true);
    function goFullStage(event:MouseEvent):void
        //vid.fullScreenTakeOver = false; // keeps flvPlayer component from becoming full screen if you use it instead  
        if (stage.displayState == StageDisplayState.NORMAL)
            stage.displayState=StageDisplayState.FULL_SCREEN;
        else
            stage.displayState=StageDisplayState.NORMAL;

  • Error#1009. Actionscript error in Flash Game I'm making...

    Hi,
    I'm making a Flash game and rather than putting all the AS3 on a seperate .as file, I'm throwing it on the timeline, which may or may not be a mistake since this game is getting really big, really fast and messy.
    And so I'm getting this error when I test:
    TypeError: Error #1009: Cannot access a property or method of a null object reference at GameBeta_MainTimeline_fla::MainTimeline/frame1()
    From what I've read on this error, it refers to something that isn't instantiated yet, like something that's out of order? Like I'm referring to something that doesn't exist at the point in time that I'm referring to it? So I'm looking at my AS3 and have NO idea. Here is what I have written:
    stop();
    //TITLE PAGE
    play_game.addEventListener(MouseEvent.CLICK, startgame)
    function startgame(evt:MouseEvent):void
        gotoAndStop("Name Input");
    //Name and Gender input page
    var userName:String;
    inputField.addEventListener(Event.CHANGE, onInput)
    function onInput(e:Event):void
         outputField.text = "So your name is " + inputField.text + " are you sure?";
         userName = inputField.text;
    confirm_input.addEventListener(MouseEvent.CLICK, toCreationpg)
    function toCreationpg(evt:MouseEvent):void
        gotoAndStop("Fem Creation");
        outputField.text = "So your name is "+ userName;
    //Character Creation Page
    readytostart.addEventListener(MouseEvent.CLICK, firstscene_plz)
    function firstscene_plz(evt:MouseEvent):void
        gotoAndStop("Day03");
        outputField.text = "Let's make your character, "+ userName;
    So, any ideas as to why I'm getting this error?
    Before I had each page with it's own Actionscript and buttons inside their own movieclips on the timeline. That was getting confusing so I took everything out of the movieclips to place everything on one timeline and have one layer of Actionscript hoping to simplify things and find the problem easier. No luck. It's supposed to have a Title page and a button that goes to the 2nd page where you input your name, and while you type, it shows your name before you confirm by hitting another button that finally goes to the Character Creation page. When I test, I just get that Error#1009, it'll get to the 2nd page for the name input, but the text fields act wacky and the button to proceed isn't working. I'm hoping that when I find the source of this error, the rest will be fixed as well.
    Thanks in advance for any advice offered! I'll greatly appreciate it.

    Yeah, that's what makes me even more confused. I have a seperate file where I'm testing the name input mechanics alone, just using this piece of actionscript, one input box with an instance inputField and a dynamic box outputField, a button, instance enter_name, that confirms and repeats the input on the next page. And it works.
    inputField.addEventListener(Event.CHANGE, onInput)
    var userName:String;
    function onInput(e:Event):void
         outputField.text = "You typed " + inputField.text;
         userName = inputField.text;
    enter_name.addEventListener(MouseEvent.CLICK, onClick)
    function onClick(evt:MouseEvent):void
        gotoAndStop("frame two");
        outputField.text = "So your name is "+ userName;
    So I don't get the error with that seperate file so could it be that other things are conflicting with this? Perhaps the order in which I've written my actionscript or the way I've organized my frames? In my other file, it says it's the inputField Event Listener but it'll work when I take out all the other frames and script...

  • Flash Error #1009 -- NEED HELP!

    Okay.  I am relatively new to AS3 and I have been working on creating a visual timer.  My code is very simple, and I can't figure out why Flash Pro CS6  is giving this error message in the Output:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at TMR_fla::MainTimeline/timer1hit()
    My code looks exactly like the following:
    import flash.events.Event;
    stop();
    function timer1move():void {
              timer1.x-= 8;
    var MyInterval1:uint = setInterval(timer1move, 50);
    timer1.addEventListener(Event.ENTER_FRAME, timer1hit);
    function timer1hit(e:Event) {
              if(timer1.hitTestObject(finish1)) {
                        gotoAndStop(2);
                        clearInterval(MyInterval1);
    I cannot figure out why FLash is giving me this error.  Mainly because my code works great!  It does exactly what I told it to do, it goes to Frame 2 and stops.  But in the Output the error message just keeps repeating forever.  I have looked all over this forum and found multiple topics on this problem but none of them help.  Few extra key notes:
    1.  My second frame has absolutely ZERO code.  Just some scribbles on stage to indicate that I've made it to the 2nd Frame.
    2.  My stage for frame 1 looks like this:
    The object on the right is my timer.  The rectangle on the left is my finish.
    Rectangle has an instance name of finish1
    Timer has an instance name of timer1
    I have triple checked the instance names, I know that they are all spelled right.  Can somone help me? 

    If the error is repeating forever, it is probably because you have tha ENTER_FRAME listener continuing on.  If you are in frame 2 and any of the objects that the ENTER_FRAME event handler function is targeting are only in frame 1, then that will be the source of the error.  In your event handler you should remove that listener before you change frames.
    timer1.addEventListener(Event.ENTER_FRAME, timer1hit);
    function timer1hit(e:Event) {
              if(timer1.hitTestObject(finish1)) {
                        timer1.removeEventListener(Event.ENTER_FRAME, timer1hit);
                        clearInterval(MyInterval1);
                        gotoAndStop(2);

  • Runtime Error 1009 After Converting from Flex 3.6 to 4.5.1

    I am in the process of converting my application from SDK 3.6 to 4.5.1.  The process is going smoothly thanks to the many resources out there including Greg Lafrance's series http://www.adobe.com/devnet/flex/articles/migrating-flex-apps-part1.html
    I am now getting an error while the application is loading in the browser.  The error text is:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at main/initApp()...
    The error occurs in the AS code where I am attempting to get the URL from the player using the mx.utils.URLUtil library.  In particular, I am setting a global variable in my app to the URL of the visitor.  The specific code for this is:
    this.stServerName=URLUtil.getServerName(mainApp.url);
    Is URLUtil still in use in Flex 4.5.1?  If not, is there another way to get the server name from the host?
    Thanks!
    Lee

    URLUtil still exists.  I would verify what is null.

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

  • 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

  • Chart causing error 1009 when enabling compatibility mode in Flash Builder 4

    Hello.
    I'm trying to use the chart components in Flash Builder 4. I'm using Flex SDK 4, but had to turn on the "Flex 3 compatibility mode" for some off-topic reasons.
    I simply created a new application and copied the code from the DateTimeAxis class example: http://www.codigoactionscript.org/langref/as3/mx/charts/DateTimeAxis.html#includeExamplesS ummary
    When running the example, the following error is reported (sorry, it is in italian: it's simply the "null object" error):
    TypeError: Error #1009: Impossibile accedere a una proprietà o a un metodo di un riferimento oggetto null.
    at mx.charts.chartClasses::CartesianChart/updateMultipleAxesStyles()[E:\dev\4.0.0\frameworks \projects\datavisualization\src\mx\charts\chartClasses\CartesianChart.as:2598]
    at mx.charts.chartClasses::CartesianChart/commitProperties()[E:\dev\4.0.0\frameworks\project s\datavisualization\src\mx\charts\chartClasses\CartesianChart.as:1360]
    at mx.core::UIComponent/validateProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\UIComponent.as:7772]
    at mx.managers::LayoutManager/validateProperties()[E:\dev\4.0.0\frameworks\projects\framewor k\src\mx\managers\LayoutManager.as:572]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:700]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1072]
    Is there a solution to this bug? We really need to use charts AND keep the Flex 3 compatibility mode.

    I use SDK 4.1 but I also get the error: (Flashbuilder 4.0.1 in Flex 3 compatibility mode)
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at mx.charts.chartClasses::CartesianChart/updateMultipleAxesStyles()[E:\dev\4.0.0\frameworks \projects\datavisualization\src\mx\charts\chartClasses\CartesianChart.as:2598]
        at mx.charts.chartClasses::CartesianChart/commitProperties()[E:\dev\4.0.0\frameworks\project s\datavisualization\src\mx\charts\chartClasses\CartesianChart.as:1360]
        at mx.core::UIComponent/validateProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\UIComponent.as:7772]
        at mx.managers::LayoutManager/validateProperties()[E:\dev\4.0.0\frameworks\projects\framewor k\src\mx\managers\LayoutManager.as:572]
        at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:700]
        at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1072]
    So I guess it is not solved....
    regards,

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

  • Error #1009 - don't know how to fix

    Hi everyone,
    I'm new to flash and specially to AS3 and I'm getting this error message:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at VIDEO_FINAL_02_fla::MainTimeline/frame1334()
    And strangely enough it works in mw SWF&FLV Player and in Safari or Firefox!!! The button just doesn't work with flash player - and I need it to work in this player.
    It's a simple educational video - it starts with a movie, then it stops and you have to click in a button that leeds you in to some text about a subject. then you click 'continue' and you continue watching tnhe second video - and so on (7 buttons and vídeos). - It's very linear.
    Here goes the the code of this frame:
    stop ();
    myLIVRO_BOTAO.addEventListener(MouseEvent.CLICK, livroPressz);
    function livroPressz(e:MouseEvent):void {
    gotoAndPlay("LIVROa");
    I can't understand... I gave this button (LIVRO_BOTAO) an instance name (myLIVRO_BOTAO) on the properties tab.

    Forget it..
    I just found the answer in another website.
    You shouldn't have movieclips inside buttons - and that was the problem...
    I've just tried and it worked!
    You just have to include a line before the rest of the code:
    myButton = SimpleButton(getChildByName(myButton))
    myButton - name of your button.
    Thank you anyway.

  • Need to fix Error 1009 for very simple task!

    Hi to all,
    I'm learning AS3 for the first time so that I can make a game, but I'm stuck on the most basic of tasks!
    What I want to do is be able to click on a button to take me to the next frame of the main timeline, which I've called "gameboard". The button is called "storymode".
    In the first frame of the main timeline, I have a movie clip that runs a short animation before the menu appears. My button that I want to click on is nested in this movie clip.
    This is the code I'm using on frame 95 of the movie clip (exactly where the button appears):
    stop();
    storymode.addEventListener(MouseEvent.MOUSE_UP, gotoGame);
    function gotoGame(evt:MouseEvent):void {
    evt.target.parent.gotoAndStop("gameboard");
    ...but it just gives me Error 1009 every time and won't work!
    I've read a few other forums for help on this error already and tried a few potential solutions, but nothing works - so I'm asking my own question! Also, I ran the debugging tool in Flash, and it tells me the error is specifically on Line 3 (beginning with the word 'storymode'). I've made sure that everything has a name, and double and triple-checked that I'm referring to the right names in the right places, so "storymode" does indeed refer to my button!
    One cause I read about was that the button may not have been loaded yet, but I've made sure that the code is on the same frame as the button. It appears in the exported file and changes colour when hovered over like a functional button, so it's definitely loaded! It just doesn't work when clicked! What could the problem be?!
    I am utterly bewildered by this and desperately need help, otherwise I will never be able to progress to more difficult tasks!

    Kglad, I did as you suggested, and that gives me not only another error (1120: Access of undefined property titlemenu (that's the name of the movieclip)), but it also negates all the "stop" commands I've put in the timeline actions, resulting in the export flickering uncontrollably between the first and second frames on the main timeline.
    I had this problem before I had the 1009 error, and managed to fix it on my own. Back then, it was Error 1061, and was caused by me using the wrong target in my code. I had:
    this.parent.gotoAndStop("gameboard")
    instead of
    evt.target.parent.gotoAndStop("gameboard")
    ...and changing it to the latter fixed Error 1061. However, this error 1120 causes the same problem again, so it's a targeting issue I'm not very willing to change, I think.
    I've tried about a dozen different targeting options as well, and none of them solve Error 1009.

Maybe you are looking for