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.

Similar Messages

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

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

  • 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

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

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

  • Another TypeError: Error #1009 Problem

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

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

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

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

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

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

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

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

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

    Dear Sir,
    I really need your valuable assistance i was about to finish a project but at very last moment i am stuck. Here is the explanation below...
    I have two files called "holder.swf" and "slide.swf" i want to improt the "slide.swf" using this action below
    var myLoader:Loader = new Loader();
    var url:URLRequest = new URLRequest("slide.swf");
    myLoader.load(url);
    addChild(myLoader);
    myLoader.x = 2;
    myLoader.y = 2;
    Also i have attached the flash file of "holder.swf". My concern is the moment i am calling the "slide.swf" inside the "holder.swf" it is showing the following error...
    " TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at FC_Home_Ads_Holder_v2_fla::MainTimeline() "
    Here are the files uploaded for your reference, please download this file http://www.touchpixl.com/ForumsAdobecom.zip
    This error is being occured from "MainTimeline.as" file here is the code been use inside of this file below....
    package FC_Home_Ads_Holder_v2_fla
        import __AS3__.vec.*;
        import adobe.utils.*;
        import com.danehansen.*;
        import com.greensock.*;
        import com.greensock.easing.*;
        import com.greensock.plugins.*;
        import flash.accessibility.*;
        import flash.desktop.*;
        import flash.display.*;
        import flash.errors.*;
        import flash.events.*;
        import flash.external.*;
        import flash.filters.*;
        import flash.geom.*;
        import flash.globalization.*;
        import flash.media.*;
        import flash.net.*;
        import flash.net.drm.*;
        import flash.printing.*;
        import flash.profiler.*;
        import flash.sampler.*;
        import flash.sensors.*;
        import flash.system.*;
        import flash.text.*;
        import flash.text.engine.*;
        import flash.text.ime.*;
        import flash.ui.*;
        import flash.utils.*;
        import flash.xml.*;
        public dynamic class MainTimeline extends flash.display.MovieClip
            public function MainTimeline()
                new Vector.<String>(6)[0] = "Productivity";
                new Vector.<String>(6)[1] = "Leadership";
                new Vector.<String>(6)[2] = "Execution";
                new Vector.<String>(6)[3] = "Education";
                new Vector.<String>(6)[4] = "Speed of Trust";
                new Vector.<String>(6)[5] = "Sales";
                super();
                addFrameScript(0, this.frame1);
                return;
            public function init():void
                var loc1:*=null;
                com.greensock.plugins.TweenPlugin.activate([com.greensock.plugins.Aut oAlphaPlugin]);
                loc1 = new flash.net.URLLoader(new flash.net.URLRequest(this.XML_LOC));
                var loc2:*;
                this.next_mc.buttonMode = loc2 = true;
                this.prev_mc.buttonMode = loc2;
                stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
                stage.align = flash.display.StageAlign.TOP_LEFT;
                loc1.addEventListener(flash.events.Event.COMPLETE, this.xmlLoaded, false, 0, true);
                this.prev_mc.addEventListener(flash.events.MouseEvent.CLICK, this.minusClick, false, 0, true);
                this.next_mc.addEventListener(flash.events.MouseEvent.CLICK, this.plusClick, false, 0, true);
                return;
            public function xmlLoaded(arg1:flash.events.Event):void
                var loc1:*=null;
                var loc2:*=0;
                this.xmlData = new XML(arg1.target.data);
                loc2 = 0;
                while (loc2 < this.LABELS.length)
                    loc1 = new Btn(this.LABELS[loc2], loc2);
                    this.btnHolder_mc.addChild(loc1);
                    this.BTNS.push(loc1);
                    trace(this.LABELS[loc2]);
                    ++loc2;
                this.current = uint(this.xmlData.@firstPick);
                trace("-----width-----");
                trace(this.contentMask.width);
                var loc3:*=this.contentMask.width / this.LABELS.length;
                trace(loc3);
                loc2 = 0;
                while (loc2 < this.BTNS.length)
                    this.BTNS[loc2].width = loc3;
                    this.BTNS[loc2].x = loc3 * loc2;
                    ++loc2;
                this.btnHolder_mc.addEventListener(flash.events.MouseEvent.CLICK, this.numClick, false, 0, true);
                this.selectMovie();
                return;
            public function numClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                this.current = arg1.target.i;
                this.selectMovie();
                return;
            public function killTimer():void
                this.timerGoing = false;
                if (this.timer)
                    this.timer.reset();
                    this.timer.addEventListener(flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);
                    this.timer = null;
                return;
            public function selectMovie():void
                if (this.timerGoing)
                    this.timer = new flash.utils.Timer(uint(this.xmlData.ad[com.danehansen.MyMath.modulo(t his.current, this.xmlData.ad.length())].@delay), 1);
                    this.timer.start();
                    this.timer.addEventListener(flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);
                while (this.holder_mc.numChildren > 0)
                    this.holder_mc.removeChild(this.holder_mc.getChildAt(0));
                var loc1:*=new flash.display.Loader();
                loc1.load(new flash.net.URLRequest(this.xmlData.ad[com.danehansen.MyMath.modulo(thi s.current, this.xmlData.ad.length())].@loc));
                this.holder_mc.addChild(loc1);
                var loc2:*=0;
                while (loc2 < this.BTNS.length)
                    this.BTNS[loc2].deselect();
                    ++loc2;
                this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].select();
                var loc3:*=this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].x + this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].width / 2 + this.btnHolder_mc.x;
                trace("addLength:" + this.xmlData.ad.length());
                trace(loc3, com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length()));
                com.greensock.TweenLite.to(this.indicator_mc, 0.3, {"x":loc3, "ease":com.greensock.easing.Cubic.easeOut});
                loc1.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, this.adLoaded, false, 0, true);
                return;
            public function adLoaded(arg1:flash.events.Event):void
                var evt:flash.events.Event;
                var loc1:*;
                evt = arg1;
                try
                    evt.target.content.xmlData = this.xmlData.ad[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())];
                catch (er:Error)
                return;
            public function minusClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current - 1);
                loc1.current = loc2;
                this.selectMovie();
                return;
            public function plusClick(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function ENDED(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function STARTED(arg1:flash.events.Event):void
                this.killTimer();
                return;
            function frame1():*
                this.timerGoing = true;
                addEventListener("endNow", this.ENDED, false, 0, true);
                addEventListener("startNow", this.STARTED, false, 0, true);
                this.init();
                return;
            public const XML_LOC:String=stage.loaderInfo.parameters.xmlLoc ? stage.loaderInfo.parameters.xmlLoc : "home_ads.xml";
            public const LABELS:__AS3__.vec.Vector.<String>=new Vector.<String>(6);
            public const BTNS:__AS3__.vec.Vector.<Btn>=new Vector.<Btn>();
            public const TRANSITION_TIME:Number=0.2;
            public var contentMask:flash.display.MovieClip;
            public var btnHolder_mc:flash.display.MovieClip;
            public var holder_mc:flash.display.MovieClip;
            public var indicator_mc:flash.display.MovieClip;
            public var prev_mc:flash.display.MovieClip;
            public var next_mc:flash.display.MovieClip;
            public var current:int;
            public var xmlData:XML;
            public var timer:flash.utils.Timer;
            public var timerGoing:Boolean;
    Here is the folder uploaded on the server for you to get clear picture, please click on this link to download the entire folder. http://www.touchpixl.com/ForumsAdobecom.zip
    I am not being able to resolve the issue, it needs a master to get the proper solution. I would request you to help me.
    Thanks & Regards
    Sanjib Das

    Here is the entire code of MainTimeline.as below, please correct it.
    package FC_Home_Ads_Holder_v2_fla
        import __AS3__.vec.*;
        import adobe.utils.*;
        import com.danehansen.*;
        import com.greensock.*;
        import com.greensock.easing.*;
        import com.greensock.plugins.*;
        import flash.accessibility.*;
        import flash.desktop.*;
        import flash.display.*;
        import flash.errors.*;
        import flash.events.*;
        import flash.external.*;
        import flash.filters.*;
        import flash.geom.*;
        import flash.globalization.*;
        import flash.media.*;
        import flash.net.*;
        import flash.net.drm.*;
        import flash.printing.*;
        import flash.profiler.*;
        import flash.sampler.*;
        import flash.sensors.*;
        import flash.system.*;
        import flash.text.*;
        import flash.text.engine.*;
        import flash.text.ime.*;
        import flash.ui.*;
        import flash.utils.*;
        import flash.xml.*;
        public dynamic class MainTimeline extends flash.display.MovieClip
            public function MainTimeline()
                new Vector.<String>(6)[0] = "Productivity";
                new Vector.<String>(6)[1] = "Leadership";
                new Vector.<String>(6)[2] = "Execution";
                new Vector.<String>(6)[3] = "Education";
                new Vector.<String>(6)[4] = "Speed of Trust";
                new Vector.<String>(6)[5] = "Sales";
                super();
                addFrameScript(0, this.frame1);
                return;
            public function init():void
                var loc1:*=null;
                com.greensock.plugins.TweenPlugin.activate([com.greensock.plugins.AutoAlphaPlugin]);
                loc1 = new flash.net.URLLoader(new flash.net.URLRequest(this.XML_LOC));
                var loc2:*;
                this.next_mc.buttonMode = loc2 = true;
                this.prev_mc.buttonMode = loc2 = true;
                stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
                stage.align = flash.display.StageAlign.TOP_LEFT;
                loc1.addEventListener(flash.events.Event.COMPLETE, this.xmlLoaded, false, 0, true);
                this.prev_mc.addEventListener(flash.events.MouseEvent.CLICK, this.minusClick, false, 0, true);
                this.next_mc.addEventListener(flash.events.MouseEvent.CLICK, this.plusClick, false, 0, true);
                return;
            public function xmlLoaded(arg1:flash.events.Event):void
                var loc1:*=null;
                var loc2:*=0;
                this.xmlData = new XML(arg1.target.data);
                loc2 = 0;
                while (loc2 < this.LABELS.length)
                    loc1 = new Btn(this.LABELS[loc2], loc2);
                    this.btnHolder_mc.addChild(loc1);
                    this.BTNS.push(loc1);
                    trace(this.LABELS[loc2]);
                    ++loc2;
                this.current = uint(this.xmlData.@firstPick);
                trace("-----width-----");
                trace(this.contentMask.width);
                var loc3:*=this.contentMask.width / this.LABELS.length;
                trace(loc3);
                loc2 = 0;
                while (loc2 < this.BTNS.length)
                    this.BTNS[loc2].width = loc3;
                    this.BTNS[loc2].x = loc3 * loc2;
                    ++loc2;
                this.btnHolder_mc.addEventListener(flash.events.MouseEvent.CLICK, this.numClick, false, 0, true);
                this.selectMovie();
                return;
            public function numClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                this.current = arg1.target.i;
                this.selectMovie();
                return;
            public function killTimer():void
                this.timerGoing = false;
                if (this.timer)
                    this.timer.reset();
                    this.timer.addEventListener(flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);
                    this.timer = null;
                return;
            public function selectMovie():void
                if (this.timerGoing)
                    this.timer = new flash.utils.Timer(uint(this.xmlData.ad[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].@delay), 1);
                    this.timer.start();
                    this.timer.addEventListener(flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);
                while (this.holder_mc.numChildren > 0)
                    this.holder_mc.removeChild(this.holder_mc.getChildAt(0));
                var loc1:*=new flash.display.Loader();
                loc1.load(new flash.net.URLRequest(this.xmlData.ad[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].@loc));
                this.holder_mc.addChild(loc1);
                var loc2:*=0;
                while (loc2 < this.BTNS.length)
                    this.BTNS[loc2].deselect();
                    ++loc2;
                this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].select();
                var loc3:*=this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].x + this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].width / 2 + this.btnHolder_mc.x;
                trace("addLength:" + this.xmlData.ad.length());
                trace(loc3, com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length()));
                com.greensock.TweenLite.to(this.indicator_mc, 0.3, {"x":loc3, "ease":com.greensock.easing.Cubic.easeOut});
                loc1.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, this.adLoaded, false, 0, true);
                return;
            public function adLoaded(arg1:flash.events.Event):void
                var evt:flash.events.Event;
                var loc1:*;
                evt = arg1;
                try
                    evt.target.content.xmlData = this.xmlData.ad[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())];
                catch (er:Error)
                return;
            public function minusClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current - 1);
                loc1.current = loc2;
                this.selectMovie();
                return;
            public function plusClick(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function ENDED(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function STARTED(arg1:flash.events.Event):void
                this.killTimer();
                return;
            function frame1():*
                this.timerGoing = true;
                addEventListener("endNow", this.ENDED, false, 0, true);
                addEventListener("startNow", this.STARTED, false, 0, true);
                this.init();
                return;
            public const XML_LOC:String=stage.loaderInfo.parameters.xmlLoc ? stage.loaderInfo.parameters.xmlLoc : "home_ads.xml";
            public const LABELS:__AS3__.vec.Vector.<String>=new Vector.<String>(6);
            public const BTNS:__AS3__.vec.Vector.<Btn>=new Vector.<Btn>();
            public const TRANSITION_TIME:Number=0.2;
            public var contentMask:flash.display.MovieClip;
            public var btnHolder_mc:flash.display.MovieClip;
            public var holder_mc:flash.display.MovieClip;
            public var indicator_mc:flash.display.MovieClip;
            public var prev_mc:flash.display.MovieClip;
            public var next_mc:flash.display.MovieClip;
            public var current:int;
            public var xmlData:XML;
            public var timer:flash.utils.Timer;
            public var timerGoing:Boolean;

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

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

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

Maybe you are looking for

  • Can Automator run a workflow on many folders, one at a time?

    Hello, In a parent folder, I have a bunch of subfolders with image files (BMP, JPG or PNG). I want each of these subfolders to become a PDF combining the original image files. I also want the resulting PDFs to be named as the original subfolder. Is t

  • 5th gen iPod Classic not recognized

    Hi, I have a 5th gen iPod classic 30GB that my friend gave to me a few months ago. It was recognized on my computer and itunes at the start and I was able to sync and perform all the needed tasks. I recently had to reformat my computer and now the ip

  • File content conversion using SOAP adapter

    Hi,      I'm using a receiver SOAP adapter in my IDOC to file scenario and need to do file content conversion in the receiver side. Are any standard modules available for file content conversion in the SOAP adapter or do I need to write custom EJB mo

  • Avoid variance calculation on product order

    Hi experts, i have a question. We have a material with cost estimate with quantity structure, cost estimate is release. All cost components in cost component structure are in inventory valuation. On the product order are then target costs. When mater

  • NVIDIA Cuda driver 6.5.18 crashes OS X Yosemite

    Hello, I am getting erratic behaviour using RayTracing on CS6 11.0.4.2, sometimes it crashes the whole system, other times only AE itself. Anyone else experiencing this?