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?

Similar Messages

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

  • 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 - (Null reference error) With Flash.

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

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

  • TypeError: Error #1009- help needed

    Hi,
    I'm working on a school project, which is to say I'm still pretty new to AS3.
    I keep receiving error 1009 which seems to point to the  problematic "theory" section. I've checked my label & instance names  numerous times- everything looks fine. What else might it be?
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at Untitled_fla::MainTimeline/frame70()
    The buttons fade into view over the course of 5 frames.. so they are on the stage but invisible starting at frame 65, and by frame 70 they are in the same spot and fully visible & supposed to be functional.
    I have the actionscript on a separate layer on frame 70, this is what I have-
    stop();
    theory_btn.addEventListener(MouseEvent.CLICK,playtheory);
    function playtheory(event:MouseEvent):void{
        gotoAndPlay("theory");
    history_btn.addEventListener(MouseEvent.CLICK,playhistory);
    function playhistory(event:MouseEvent):void{
        gotoAndPlay("history");
    future_btn.addEventListener(MouseEvent.CLICK,playfuture);
    function playfuture(event:MouseEvent):void{
        gotoAndPlay("future");
    credits_btn.addEventListener(MouseEvent.CLICK,playcredits);
    function playcredits(event:MouseEvent):void{
        gotoAndPlay("credits");
    I've checked all of my labeling mulitple times- all names and instances are correct and in their proper places.. Unless it's a mindblowingly obvious mistake and I'm just not catching it.
    I'd like to upload my .fla, but it's too large of a file. I will happily email it if anyone is willing to take a peek.

    I may be wrong, but for the original problem I am guessing that the following of what I listed was the problem...
    - is animated into place but is not assigned instance names in every keyframe for it
    You mentioned frame 70 is where alpha = 1, which has me thinking you animated them into view but did not name them in the first frame(s).  That lack of a name will get inherited at the other end of the tween.
    For your new problem, if your home page is on frame 75, and your code for the home button is on frame 76, you have to stop at frame 76 for the code to be assigned, otherwise, going to another frame will leave it without that code getting assigned for the home button.
    What you can do is have the home button and its code in frame 75, but make it invisible there, and in your other function for the other buttons, turn it visible.
    I tried to show the code but the editor is playing games and deleting stuff on me as I add it. 

  • 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

  • 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

    I gave up on trying to export my Movie Clip like I was asking in my previous post. :'(   So i decided to make the the project interactive. My idea is based on a DVD menu with a scene selections button that leads to a screen on a different layer on a different frame. I put the .fla file on my website at     www.leetclanforall.com/flash/    If you download it and take a look at it it would help you to understand the following problems:
    1) This cryptic error message:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at Roof_Scene_fla::MainTimeline/frame1()
    2) My Scene Selection and Link buttons don't work.
    3) When I try to use gotoAndStop(2); in order to stop at the menu screen, it gives me a white screen and I can't fathom why.
    Just know that I am a beginner and my animation is very crappy. It doesn't have to be high quality animation, but the interactiveness and professional quality of the menu system is a project grade. My grade is currently a 93, but I'd like to get it higher with this project. The whole thing is worth twelve grades. :/   I need to do well on this. I have spent about 5 days of my life working on this...
    Any and all help is appreciated, thanks in advance,
    Darth Haxor

    roofScene_btn.addEventListener(MouseEvent.CLICK,click1);
    But I no longer needed that button so I just (like right before posting this) commented out that line. Now it says the same thing but for this line:
    main_screen_button_selections.addEventListener(MouseEvent.CLICK,click5);

  • ActionScript TypeError: Error #1009?

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

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

  • TypeError: Error #1009 - I know how to fix it. But I don't know whats going on!

    I have a project that I’m working on that includes working in different scenes and frames. It’s a book project with lots of pages (frames) and chapters (scenes) so I have can’t avoid working in a single frame (like a game). I get a runtime error (TypeError: Error #1009: Cannot access a property or method of a null object reference.) when accessing an object inside of a movieclip. However, I have identified the problem and know how to fix it. But when I fix it the functionality goes away. Here’s how it happens:
    On frame #1 of Scene 2 I click on a button to go to a frame #2.
    On frame #2 is the offending code:
         stage.addEventListener(MouseEvent.MOUSE_UP, moveChapters);
    //********************Navigation Bar code ********************//
    function moveChapters(event:MouseEvent):void
            if(event.target == bottomNav.Chapter_1)
            trace("Chapter #1 is working!");
    FYI, this code is part of a navigation bar the will take the user to different chapters. It is visible on stage. I haven't fully built it yet. For example, "if( event.target == bottomNav.Chapter_1)" will take the user to chapter 1, "bottomNav.Chapter_2," will take the user to chapter 2, so on and so forth. "bottomNav" is a movieclip and "Chapter_1" is a button inside it.
    When I go back to frame #1 of Scene 2 and then click on “Home” button to go back to the main page (Frame #1 of Scene #2) I get the Error #1009.
    When I comment out the “if(event.target == bottomNav.Chapter_1)” I don’t get the error but know I don’t have any functionality.
    Is there a better way to do this?

    Adding the event listener to the stage for this sort of functionality is a bad idea. Even though Flash can, apparently, resolve the objects inside the movieClip, you are making the connection between the object and the event that you want to capture more difficult than it should be. A better approach is to place all of the target objects into an array and then attach the event listener to each object in the array. Then you can easily extract the target from the event.
    Something like this might work for you:
    var chapterList:Array = new Array(bottomNav.Chapter_1,bottomNav.Chapter_2,bottomNav.Chapter_3);
    for(var i in chapterList) {
         chapterList[i].addEventListener(MouseEvent.MOUSE_UP,moveChapters);
    function moveChapters(event:MouseEvent):void {
         var thisChapter:Object = event.target;
               //  etc

  • Error in http dynamic streaming TypeError - Error #1009

    Hello everyone,
    I am making mutli-bitrate streaming in FMS and FFMPGE.
    In FFMPEG I create 4 bitrate of source video and publish it on the FMS through RTMP protocol (rtmp://my-server/livepkgr/mystreamName1?adbe-live-event=liveevent).
    Now all configurations are working currently but sometimes I get this error:
    1- TypeError - Error #1009
    This is my FFMPEG syntaxt to create multi-bitrate:
    ffmpeg -re -i j:\movie\warz.mkv
    -preset ultrafast -threads 1 -vcodec libx264 -b:v 720k -r 24 -g 24 -keyint_min 4 -x264opts "keyint=4:min-keyint=48:no-scenecut" -s 856*360 -acodec libmp3lame -b:a 16k -ac 1 -ar 44100 -f flv rtmp://12.11.1.2/livepkgr/relation720p?adbe-live-event=relation
    -preset ultrafast -threads 1 -vcodec libx264 -b:v 600k -r 24 -g 24 -keyint_min 4 -x264opts "keyint=4:min-keyint=48:no-scenecut" -s 856*360 -acodec libmp3lame -b:a 16k -ac 1 -ar 44100 -f flv rtmp://12.11.1.2/livepkgr/relation360p?adbe-live-event=relation
    -preset ultrafast -threads 1 -vcodec libx264 -b:v 350k -r 24 -g 24 -keyint_min 4 -x264opts "keyint=4:min-keyint=48:no-scenecut" -s 570*240 -acodec libmp3lame -b:a 16k -ac 1 -ar 44100 -f flv rtmp://12.11.1.2/livepkgr/relation240p?adbe-live-event=relation
    -preset ultrafast -threads 1 -vcodec libx264 -b:v 98k -r 24 -g 24 -keyint_min 4 -x264opts "keyint=4:min-keyint=48:no-scenecut" -s 342*144 -acodec libmp3lame -b:a 16k -ac 1 -ar 44100 -f flv rtmp://12.11.1.2/livepkgr/relation144p?adbe-live-event=relation
    -preset ultrafast -threads 1 -vcodec libx264 -b:v 98k -r 24 -g 24 -keyint_min 4 -x264opts "keyint=4:min-keyint=48:no-scenecut" -s 342*144 -acodec libmp3lame -b:a 16k -ac 1 -ar 44100 -f flv rtmp://12.11.1.2/livepkgr/relation98p?adbe-live-event=relation
    and this is my F4M file:
    [code]
    <manifest xmlns="http://ns.adobe.com/f4m/2.0">
    <dvrInfo beginOffset="0" endOffset="1800"></dvrInfo>
    <baseURL>http://12.11.1.2/hds-live/livepkgr/_definst_/relation</baseURL>
    <media href="relation360p.f4m" bitrate="600"/>
    <media href="relation240p.f4m" bitrate="350"/>
    <media href="relation144p.f4m" bitrate="128"/>
    <media href="relation720p.f4m" bitrate="1932"/>
    <media href="relation98p.f4m" bitrate="98"/>
    </manifest>
    [/code]
    Please advise me to fix this problem
    any help will be appreciated

    Unless you can reproduce the issue in Flash player, i am sorry i can not be of much help to you...

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

Maybe you are looking for

  • Passing select-options to class methods

    Hi, I want to pass a select-option filled in the selection screen by the user to a method of my class. Since select-options are hold as an internal table with fields sign option low high, and passing internal tables to methods require typing, what sh

  • XML Reading Using Java Servlet

    I need some help in reading xml file using java servlet. May i have some sample codes to read xml files? I would really appreciate your help. Thanks!!!

  • How make dynamic site with MUSE

    Howdy, i want ask how make dynamic site with muse, can it intergated with CMS like wordpress, joomla, drupal etc? Thanks, best regard, harles

  • Where can I find a list of application serial numbers in 10.8

    Where can I find a list of my installed applications serial numbers?

  • [Solved] DWM with w0ng' config

    Hi everyone, Im using dwm on archlinux, and i try to install w0ng' config. But it is not working, i cant press anykey, i try shift+alt+q, shift+alt+p, alt+1, alt+2..... my screen no change, i must switch to tty2 and recompile dwm to default. I upload