TypeError: #1009 Issues

Okay. I'm trying to make a popup alert modal window thing with an external class. I have a simple swf set up with just some random sample text, a rectangle, and a button (just so I can tell if it's working or not). What I want to happen is for the "alert" class to initialize upon startup of the swf and then when I click the button (instance: btn), the alert will show up. If I get rid of all AS in the swf and set alert as the document class, it shows up just fine, so I think it should be working, but for some reason I get this instead when I try the button function:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at alert$cinit()
at global$init()
at alertTester_fla::MainTimeline/frame1()
Here's the code in my alertTester swf:
import alert;
alert.msgAlert = "This is me testing stuff out.";
btn.addEventListener(MouseEvent.CLICK, displayAlert);
function displayAlert(e:MouseEvent):void
     alert.showAlert();
And here's the code in alert.as:
package  {
     import flash.display.MovieClip;
     import flash.display.*;
     import flash.events.*;
     import flashx.textLayout.formats.Float;
     import flash.text.TextField;
     import flash.geom.Matrix;
     import flash.text.*;
     public class alert extends MovieClip {
          private static var stage:Stage = null;
          private static var bkgd:Sprite;
          private static var msgBox:Sprite;
          private static var msg:TextField;
          public static var msgAlert:String = "Test.";
          //for alert box itself
          public static var rectW:int = 200;
          public static var rectH:int = 150;
          private static var rectX:Number = (stage.stageWidth/2) - (rectW/2);
          private static var rectY:Number = (stage.stageHeight/2) - (rectH/2);
          public function alert() {
            addEventListener(Event.ADDED_TO_STAGE, added);
        private function added(event:Event):void {
            init(stage);
          private function init(stageRef:Stage):void
               stage = stageRef;
               trace("Initialized!");
          public static function showAlert():void {
               if (stage == null) {
                    trace("Alert class has not been initialized!");
                    return;
               //initialize
               bkgd = new Sprite();
               msgBox = new MovieClip();
               msg = new TextField();
               //assign content
               bkgd = createBkgd();
               msgBox = createBox();
               msgText(msgAlert);
               //add children
               msgBox.addChild(msg);
               bkgd.addChild(msgBox);
               stage.addChild(bkgd);
          private static function createBkgd() : Sprite
               //setup/initialize
               var overlay:Sprite = new Sprite();
               //make rectangle/cover stage
               overlay.graphics.beginFill(0x929292);
               overlay.graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
               overlay.graphics.endFill();
               overlay.alpha = .85;
               //return
               return overlay;
          private static function createBox() : Sprite
               //setup/initialize necessary variables
               var box:Sprite = new Sprite();
               var colors:Array = new Array(0xFFFFFF, 0xE1E1E1);
               var alphas:Array = new Array(1, 1);
               var ratios:Array = new Array(0,125);
               var mat:Matrix = new Matrix();
               //make rectangle/alert box
               mat.createGradientBox(rectW,rectH,(Math.PI/2),rectX,rectY);
               box.graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, mat);
               box.graphics.drawRoundRect(rectX,rectY,rectW,rectH,25,25);
               box.graphics.endFill();
               //return
               return box;
          private static function msgText(alertMsg:String):void
               //create formatter and font
               var myFormat:TextFormat = new TextFormat();
               var myFont = new Font();
               //format formatter
               myFormat.size = 14;
               myFormat.align = TextFormatAlign.CENTER;
               myFormat.font = "Arial";
               //declare and assign message variable
               var msgWords:String = alertMsg;
               //set text field properties
               msg.autoSize = TextFieldAutoSize.CENTER;
               msg.defaultTextFormat = myFormat;
               msg.background = false;
               msg.border = false;
               msg.selectable = false;
               msg.type = TextFieldType.DYNAMIC;
               msg.textColor = 0x000000;
               msg.antiAliasType = AntiAliasType.ADVANCED;
               msg.embedFonts = true;
               msg.text = msgWords;
               //set position
               msg.x = rectX + rectW/2 - msg.width/2;
               msg.y = rectY + rectH/5;
I originally had the "init" function as a public static function so I could do "alert.init(stage);" from the swf, but it gave me this same error.
Thanks in advance for any help you can offer. =\

First, you cannot do that in the class header. stage is available ONLY when object is added to display list. This, I believe, is the cause for the error.
private static var rectX:Number = (stage.stageWidth/2) - (rectW/2);
private static var rectY:Number = (stage.stageHeight/2) - (rectH/2);
Second, stage is a property of MovieClip, so the following line at least unnecessary:
private static var stage:Stage = null;

Similar Messages

  • TypeError 1009 - help! [AS3]

    Salutations!
    I am brand spankin' new to Flash, and I have been making some pretty respectable progress over the last couple days on a Flash game I am working on. That is, until I attempted to implement a dynamic timer, decided against it, and removed the code, leaving what I thought I had before.
    Unfortunately, I was mistaken.
    Before, I could run my game just fine and dandy. Now, something must have changed because I'm getting this: "TypeError: Error #1009: Cannot access a property or method of a null object reference."
    My understanding is that this happens when you attempt to reference an object in the code that does not exist yet.
    I did a little bit of research, and a little bit of playing in the Debug mode, and I have discovered that the "null objects" are in fact instances of movie clips that already exist on the stage. This puzzles me to no end, as the actionscript had no problem referencing these exact same instances before.
    I don't have a previously saved working version (shame on me), and I couldn't tell you exactly what I changed about it. I can only ask that perhaps one of you could take a look at it from the eyes of a more experienced ActionScript programmer and hopefully spot what the problem is.
    Here is the .as file download:
    http://www.mediafire.com/file/15s1724i187y262/GameEngine.as
    The error starts with line 54, referencing the movie clip instance "me". Every subsequent reference to "me", and the movie clip instance "enemy", causes the error. The instances named "me" and "enemy" are both present in Frame 1 of the main timeline of the .fla file. Earlier today the actionscript referenced both "me" and "enemy" with no issues.
    If there is any more information I need to provide, please let me know, and thank you for your time!
    Respectfully,
    Cody

    Greetings again,
    I solved the problem myself -- it seems that the problem was not with the .as but with the .fla itself.
    It seems that somewhere along the line, my .fla got corrupted, and thus was having trouble communicating with the .as file. Who knows how it happened, but making a fresh .fla, importing the old library, setting up the stage as before and moving the .as to the new .fla's location has made the TypeError go away. Works like a charm as before. =)
    Hopefully this will help someone having a similar problem -- though I'm unsure how common it is for an .fla to become corrupted like that. Cheers!
    -Cody

  • TypeError#1009 Want to have a listener on a chart.

    TypeError: Error #1009: It is not possible to get a zero
    pointer object.
    I want to have a listener on a chart. When I click on it, a
    number appears in a box.
    I marked the coding which makes the TypeError with X below.
    I just wonder, it works in a small programm, but in mine not?
    Somebody can tell why?
    Thanks a lot!
    Ezachiael
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="668" height="600"
    creationComplete="send_data()" alpha="1.0"
    backgroundGradientAlphas="[1.0, 1.0]" cornerRadius="5"
    backgroundGradientColors="[#FFFFFF, #FFFFFF]" borderColor="#FFFFFF"
    >
    <mx:Script>
    <![CDATA[
    import mx.charts.events.ChartEvent;
    import mx.charts.events.ChartItemEvent;
    private function send_data():void {
    // blogday.send();
    // blogweek.send();
    blogmonth.send();
    // proj1.send();
    // intensity7.send();
    // intensity1.send();
    // intensity30.send();
    X init2();
    private function send_day():void {
    columnchart1.dataProvider=blogday.lastResult.TAGE.DAYS.TAG;
    dg.dataProvider=blogday.lastResult.TAGE.DAYS.TAG;
    private function send_week():void {
    columnchart1.dataProvider=blogweek.lastResult.TAGE.DAYS.TAG;
    dg.dataProvider=blogweek.lastResult.TAGE.DAYS.TAG;
    private function send_month():void {
    columnchart1.dataProvider=blogmonth.lastResult.TAGE.DAYS.TAG;
    dg.dataProvider=blogmonth.lastResult.TAGE.TAG;
    private function proj_day():void {
    pc2.dataProvider=proj1.lastResult.TAGE.DAYS.TAG;
    private function int7():void {
    lc.dataProvider=intensity7.lastResult.TAGE.DAYS;
    lcca.dataProvider=intensity7.lastResult.TAGE.DAYS;
    wb.dataProvider=intensity7.lastResult.TAGE.DAYS;
    wbca.dataProvider=intensity7.lastResult.TAGE.DAYS;
    private function int30():void {
    lc.dataProvider=intensity30.lastResult.TAGE.DAYS;
    lcca.dataProvider=intensity30.lastResult.TAGE.DAYS;
    wb.dataProvider=intensity30.lastResult.TAGE.DAYS;
    wbca.dataProvider=intensity30.lastResult.TAGE.DAYS;
    private function int1():void {
    lc.dataProvider=intensity1.lastResult.TAGE.DAYS;
    lcca.dataProvider=intensity1.lastResult.TAGE.DAYS;
    wb.dataProvider=intensity1.lastResult.TAGE.DAYS;
    wbca.dataProvider=intensity1.lastResult.TAGE.DAYS;
    // Define event listeners when the application initializes.
    X public function init2():void {
    X
    columnchart1.addEventListener(ChartItemEvent.ITEM_DOUBLE_CLICK,
    myListener);
    // Define the event handler.
    X public function myListener(e:ChartItemEvent):void {
    X ti1.text = "Test";
    ]]>
    X <mx:Form>
    X <!--Define a form to display the event
    information.-->
    X <mx:FormItem label="Expenses:">
    X <mx:TextInput id="ti1"/>
    X </mx:FormItem>
    X </mx:Form>
    ...

    Almost nothing in InDesign happens "automatically" ...
    To get a footer, you have to draw it yourself, preferable on a master page. If you want different footers for odd and even, make sure your document is set up using Facing Pages, so you get TWO master pages. That's right: one for Left (even!) and one for Right.

  • TypeError #1009

    Muse Beta version 0.8.842
    Message window :
    Muse encountered an unexpected error and will have to terminated. TypeError: Error #1009: Cannot acces a proprety or method of a null object reference.
    I just created a new site with all the stuff in default
    On a second window :
    An ActionScript error occured
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at com.adobe.pash.air::AIRMenuManager/deleteDictionaryReferences()
    at com.adobe.pash.air::AIRMenuManager/deleteDictionaryReferences()
    at com.adobe.pash.air::AIRMenuManager/onMenuShow()
    Choice : dimiss all or continue
    For both Muse Exit !

    Hi guy__l,
    We need more information to suggest you further.
    Please provide us with the replicating steps if possible. Also, elaborate what you mean by "created a new site with all the stuff in default".
    What were you trying to do when you got the error ?
    Is this happening to a particular .muse file? Can you try to re-create the error on a new .muse file and tell us if you were able to?
    Regards,

  • Bug? - HaloBorder TypeError #1009 (null) with border side style

    Hello Adobe,
    running my application, which was developed for 3.5, with Flex SDK 4.1, using the Halo theme, and with Flex 3 compatibility turned on, I get the following error message:
    Main Thread (Suspended: TypeError: Error #1009: Der Zugriff auf eine Eigenschaft oder eine Methode eines null-Objektverweises ist nicht möglich.)
    mx.skins.halo::HaloBorder/get borderMetrics
    mx.core::Container/get borderMetrics
    mx.core::Container/get viewMetrics
    mx.core::Container/get viewMetricsAndPadding
    mx.containers.utilityClasses::BoxLayout/http://www.adobe.com/2006/flex/mx/internal::widthPadding
    mx.containers.utilityClasses::BoxLayout/measure
    mx.containers::Box/measure
    mx.core::UIComponent/measureSizes
    mx.core::UIComponent/validateSize
    mx.core::Container/validateSize
    mx.managers::LayoutManager/validateSize
    mx.managers::LayoutManager/doPhasedInstantiation
    mx.managers::LayoutManager/doPhasedInstantiationCallback
    I could track it down to an HBox with style "TopAndBottomShadow", which I define in my CSS file as:
    .TopAndBottomShadow {
    background-color: #cdced0;
    background-alpha: 1;
    background-image: Embed("images/bg-shadowTopAndBottom2.png", scaleGridTop="14", scaleGridBottom="16", scaleGridLeft="1", scaleGridRight="29");
    background-size: "100%";
    padding-left: 20;
    padding-right: 17;
    padding-top: 7;
    padding-bottom: 7;
    border-sides: bottom;
    border-style: solid;
    border-color: #999999;
    When removing or commenting the "border-sides: bottom;" line, the error does not happen.

    It can't be that hard to fix...
    HaloBorder.as  line 162 does this:
    var borderSides:String = getStyle("borderSides");  
    if (borderSides != "left top right bottom") 
    but the style is returned as null...
    a) the code should handle null gracefully.
    b) is there anything I c an do to work around it in my css or similar?

  • Typeerror #1009 drawcolumnbackground() in advanceddatagridbaseex.as:3966

    I have implemented an extension to the advanced datagrid class that would read its column design through a web service call, would then dynamically add the advanced columns as required and when ready with that, read the grid data again through a web service call. In a final step the in memory data grid object would be added to a UI container.
    Somewhere after assigning the dataprovider and the following adding of the grid to the UI container, a rendering event takes place that would try to display the column backgrounds before the internal data structure has been created (through setting the dataprovider).
    The drawcolumnbackground() method is referencing row information that isn't available at this point and hence the error exception.
    The following code is taken out from the current advanceddatagridbaseex.as (SDK 4.5.1)
        protected function drawColumnBackground(s:Sprite, columnIndex:int,
                                                 color:uint, column:AdvancedDataGridColumn):void
             var background:Shape;
             background = Shape(s.getChildByName(columnIndex.toString()));
             if (!background)
                 background = new FlexShape();
                 s.addChild(background);
                 background.name = columnIndex.toString();
             var g:Graphics = background.graphics;
             g.clear();
             if(columnIndex >= lockedColumnCount &&
                columnIndex < lockedColumnCount + horizontalScrollPosition)
                 return;
             g.beginFill(color);
             var lastRow:Object = rowInfo[listItems.length - 1];
             var headerInfo:AdvancedDataGridHeaderInfo = getHeaderInfo(getOptimumColumns()[columnIndex]);
             var xx:Number = headerInfo.headerItem.x;
             if(columnIndex >= lockedColumnCount)
                 xx = getAdjustedXPos(xx);
             var yy:Number = headerRowInfo[0].y;
              if (headerVisible)
                 yy += headerRowInfo[0].height;
              // Height is usually as tall is the items in the row, but not if
             // it would extend below the bottom of listContent
             var height:Number = Math.min(lastRow.y + lastRow.height,
                                          listContent.height - yy);
             g.drawRect(xx, yy, headerInfo.headerItem.width,
                        listContent.height - yy);
             g.endFill();
    The line numbers above in bold red are the culprits. There are two aspects to this problem:
    1) The rendering event takes place at the wrong point in time
    2) The two line numbers are redundent. They effectively do nothing, except for throwing an error.
    I have solved the problem by writing my own FdnAdvancedDataGrid class extending the AdvancedDateGrid class simply overriding the function drawcolumnbackground()...
    package packages.FdnClasses
        import mx.controls.AdvancedDataGrid;
        import flash.display.Sprite;   
        import mx.controls.AdvancedDataGridBaseEx;
        import mx.controls.advancedDataGridClasses.AdvancedDataGridBase;
        import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
        [Bindable]
        public class FdnAdvancedDateGrid extends AdvancedDataGrid
            public function FdnAdvancedDateGrid()
                super();
            override protected function drawColumnBackground(s:Sprite, columnIndex:int,
                                                             color:uint, column:AdvancedDataGridColumn):void
                if (this.rowInfo.length==0) return;
                if (this.listItems.length==0) return;
                var lastRow:Object = rowInfo[listItems.length - 1];   
                if (lastRow) super.drawColumnBackground(s, columnIndex,    color, column);

    Yes, that was also my workaround.

  • ProgressBar TypeError #1009 on updateDisplayList()

    Hello,
    I have a progress bar on a component which is declared as follows:
                        <mx:ProgressBar id="pbRequestStatus"
                                                  indeterminate="true"
                                                  labelPlacement="top"
                                                  visible="{SessionModel.getInstance().alarmRequestPending}"
                                                  label="{pbStatusText}"/>
    Whenever the component which holds the progressBar is removed from the stage I am getting the null reference error and I don't understand why. It looks like the updateDisplayList method of the ProgressBar is trying to retrieve the metrics on the bar while it is not visible, but I don't understand why it would do that if the component is not visible.
    Sorry to be so cryptic, but that's the best way I can explain what is happening. Any thoughts ?

    It's not actually wrong for an INVALID TextLine to be displayed.  There's line virtualization code that does that intentionally.
    I did fix a variation on this bug.  Check out build 500 or greater.  Note that our build naming and numbering is changing a bit.  The builds will still be posted inside of Gumbo.
    Thanks,
    Richard

  • Loading external swf files in a swf - Error#1009

    I have been having trouble using a swf file within a swf file.   The external swf files all work as expected.  However when used within another swf file I get the standard TypeError #1009 for some of my swfs.   The external swf files are mainly actionscript 3 files.  A typical swf file will have an object (or objects) in the library which has an export for ActionScipt property enabled and an addEventListener(Event.ENTERFRAME, somefunction).   About four years ago when I had to do some work with AS2 I seemed to get around a similar issue with the _lockroot method but this is no longer part of AS3. I have searched various forums and note that I am not the only one with this issue but did not find any relevant solutions.   If anyone could give me any ideas on how to get around this it would be appreciated.
    Regards
    Norman

    Hi,
    I have added a download to rapidshare and its link is:
    Download link: http://rapidshare.com/files/380202712/ExtSwfs.zip
    The main file Training01.fla has been set up with links to download several swf's.   The links that do not work properly are those labelled :  Module6 and Module 8.   The first Module 6 connects to a function that is a variation of how I was trying to load external swfs using Application Domain, while Module 8 is a link to a swf that uses and external class.  Module 8 is supposed to load with rotating stars, while Module 6 loads the same file as the link called Module 1.   As soon as I use the two links Module 6 or Module 8 the whole lot ceases to work properly.  I did also follow through the examples on the Adobe site.  The examples for Module 6 and Module 8 are tutorials I have used from the Internet as part of my training from the site FlashMyMind.com but they replicate the type of work we have been doing with respect to using ActionScript3.
    Re my background, at this stage I am self-taught using tutorials on the web and whatever books I can lay my hands on here.  There is no structured training available where I live as there is insufficient demand and no books available on Flash or ActionScript at the local book stores or libraries so the books are ones I have ordered via the Internet.  The one I am currently using apart from Adobe Classroom in a Book Flash CS4 is O'Reilly's Learning ActionScript 3.0 a Beginners Guide.
    The other problem I have been trying to solve and still researching is why one loses sound in the flash player when playing flv files, if the user has selected or restarted a video (or videos) many times eg 25 to 30 times as we create video training files and serve them to the user within the flash environment using Flash Player 9 and IE6.
    Regards
    Norman

  • Presentatsion with videos, can't get it working on fullscreen.

    Hi
    Happy new year guys:)
    I made a flash presentatsion and because i'm using FlashEff components it has to be in as3. I'm a total newbie in coding, particularly in as3. I have made my presentatsion in as3 before and got everything working fine. This time my presentation contains videos. And this becomes a problem when going on fullscreen mode. My project size is 1024x768, I made a html and use a brauser to open it. I wan't my project to go fullscreen so that there aren't borders.
    If the stage goes fullscreen i don't want my movies to go fullscreen. When playing a video on fullscreen mode everything just goes black. Soo finally i figured out that i have to tell the videos not to scale.
    My project is set up as follows:
    1. MAIN TIMELINE
    On the first layer i have all the frames converted to movieclips and inside each movieclip is the content.
    On the as layers first frame i have this code. This is for navicating on the presentatsion slides with arrow keys.
    stage.addEventListener(KeyboardEvent.KEY_UP, goNextFrame);
    function goNextFrame(event:KeyboardEvent):void
    if (event.keyCode == Keyboard.UP)
    this.nextFrame();
    stage.addEventListener(KeyboardEvent.KEY_DOWN, goPrevFrame);
    function goPrevFrame(event:KeyboardEvent):void
    if (event.keyCode == Keyboard.DOWN)
    this.prevFrame();
    2. INSIDE THE MOVIECLIP
    On each slide there is some content that is called with a mouse click.
    //On the fist frame
    bg_mc2.addEventListener(MouseEvent.CLICK, playSlide);
    bg_mc2.buttonMode = true;
    function playSlide(event:Event):void
    play();
    //On the last frame
    stop();
    bg_mc2.mouseEnabled = false;
    I have tried so many fullscreenmode - don't scale the video codes.
    I have tried so many ways but every time i play a video i get the typeerror 1009 Can't access a property of method.
    What does this mean?
    Is there a

    Hi
    Happy new year guys
    I managed to get the flvs on fullscreen and running. This code prevents it from taking over the screen: myPlayer.fullScreenTakeOver = false;. But when i try to move this code(keyframe) along with the flv(keyframe) farther, the code doesn't work anymore. Why is that? This is really a problem, beacause i have some animation before the video starts to play.
    For going fullscreen i found this toggle on/off button code
    function toggleFullScreen(event:MouseEvent):void
    if (this.stage.displayState == StageDisplayState.FULL_SCREEN)
    this.stage.displayState=StageDisplayState.NORMAL;
    else
    this.stage.displayState=StageDisplayState.FULL_SCREEN;
    myButton.addEventListener(MouseEvent.CLICK, toggleFullScreen);
    function onFullScreen(fullScreenEvent:FullScreenEvent):void
      var bFullScreen=fullScreenEvent.fullScreen;
      if (bFullScreen)
      else
      this.textField.text=this.stage.displayState;
    myButton.stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullScreen);
    But i get this error
    TypeError: Error #1010: A term is undefined and has no properties.
        at PRESENTATSIOOn_fla::MainTimeline/onFullScreen()
        at flash.display::Stage/set displayState()
        at PRESENTATSIOOn_fla::MainTimeline/toggleFullScreen()

  • Problems with Flash Player on a Mac

        I recently installed the latest version of Flash Player on my Mac.  Now, it's broken.  Every site I go that uses Flash Player either displays a message "Missing plug-in" or "Typeerror: #1009"  (I think that last is correct - the message disappears from the screen after seconds and there's no way to capture it.
        I'm on a Mac running 10.6.8 and the latest Flash Player downloaded today.  I've checked the preferences to make sure everything is set correctly (i.e. plug-ins enabled and Javascript enabled), I've gone into storage and deleted all the stored data in case something in there was corrupt.  I don't know what else I can do.
       This version of Flash Player appears broken somehow.
        Anyone know where I can download older versions that work?

    Look at it this way: The websites that incorporate Flash on their sites wrote their code to follow the specs provided by Adobe.  If the new version doesn't work on those sites (where it worked before) then either Adobe changed the specs and didn't tell anyone, or the code they wrote is not backwards compatible.  Yes, I know there's an argument to be made for the sites writing bad code but that would account for a small number of sites, not dozens like I'm seeing.
    Either way you look at it, whether I'm running the old version of Flash Player or the new version of Flash Player, there is a subset of websites (different in each case) that I cannot access content on, and that's Adobe's fault for the most part.  I now have to choose which subset of sites I can't access - the ones that won't work with the old version of the software or the ones that won't work with the latest version.
    I've always been unhappy with Adobe.  This just makes me more so.  It's one of the reasons why I've vowed NEVER to buy an Adobe product and never to recommend Adobe products to anyone.  I only tolerate Flash and Adobe Reader because they're somewhat necessary.  If there was an alternative to them, I'd use it.  For the most part, I use Preview instead of Adobe Reader on my Mac and get along just fine.  But, I haven't found a good replacement for Flash.
    If there's anyone out there from Adobe reading this thread: Fix your damn software!!

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

  • 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

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

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

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

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

Maybe you are looking for

  • HI BW ABAP

    hi all FORM routine_9998 TABLES DATA_PACKAGE TYPE tyt_SC_1_full CHANGING ABORT LIKE sy-subrc RAISING cx_sy_arithmetic_error cx_sy_conversion_error. Perform routine_9998 TABLES SOURCE_PACKAGE CHANGING l_abort. In inventory management , they r doing on

  • Hyperlinks in tagged text

    Good morning, I'm building tables of contents programmatically and save them as tagged text for importing into InDesign (CS3) for later export to PDF. That works fine for bookmarks and hyperlinks to web sites but not for links to other PDF documents.

  • I want to delete all music from my library and then re-download everything

    The music part of my library is a mess and needs to be cleaned up.  I am using a PC with iTunes version 11 point something.  I want to delete my library and re-download all of my purchases.

  • Why is my internet sharing greyed out?

    I have a powerbook g4 running 10.5.8 and when I go into the sharing prefs for internet sharing everything is greyed out.  I can't choose where to share from or where to share to. Let alone being able to turn on the internet sharing.  I just want to s

  • Billing address and bank account details

    I need to change my billing address and bank account details from New Zealand to UK. Please let me know how to do this.