Error #1009

I'm getting this error when I try to use a bitmap collision test:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at PlayerGroundCollisions/frameEvents()[/Users/Bill/Desktop/Lunar_Madness/PlayerGroundCollis ions.as:41]
at Lunar_Madness/onEnterFrame()[/Users/Bill/Desktop/GAME STUFF/Lunar_Madness/Lunar_Madness.as:61]
Here's the code,
PlayerGroundCollisions Class:
package {
import flash.display.MovieClip;
import flash.events.Event;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.geom.Point;
public class PlayerGroundCollisions extends MovieClip
private var groundObjects:Array;
static var _player:Bitmap;
static var _foreground:Bitmap;
public var _collisionSide:String;
public function PlayerGroundCollisions()
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
private function onAddedToStage(event:Event):void
//Initialize properties
_player = PlayerShip.Player;
_foreground = Lunar_Madness.Foreground;
//Add event listenters
addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
private function onRemovedFromStage(event:Event):void
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage)
public function frameEvents():void
{//Directives....
//var _foreground = MovieClip(parent).foreground;
var loopCounter:int = 0;
while (loopCounter++ != 10)
if(_player.bitmapData.hitTest(new Point(_player.x, _player.y), 255, _foreground, new Point (_foreground.x, _foreground.y), 255)) --------->THIS IS LINE 41 FROM ABOVE
//A collision was found.
//next teh code creates "collision boxes" on all
// four sides of the lander to
// find out on which side the collision is occurring
//Switch off gravity
PlayerShip.gravity = 0;
//1. Check for a collision on the bottom
if(_player.bitmapData.hitTest(new Point(_player.x, _player.y + 10), 255, _foreground, new Point(_foreground.x, _foreground.y), 255))
//Move teh lander out of the collision
PlayerShip.PlayerY = -1;
PlayerShip.VY = 0;
_collisionSide = "bottom";
//2. Check for a collision on the top
else if(_player.bitmapData.hitTest(new Point(_player.x, _player.y - 10), 255, _foreground, new Point(_foreground.x, _foreground.y), 255))
//Move teh lander out of the collision
PlayerShip.PlayerY = 1;
PlayerShip.VY = 0;
_collisionSide = "top";
//3. Check for a collision on the riht
else if(_player.bitmapData.hitTest(new Point(_player.x  + 10, _player.y), 255, _foreground, new Point(_foreground.x, _foreground.y), 255))
//Move teh lander out of the collision
PlayerShip.PlayerX = -1;
PlayerShip.VX = 0;
_collisionSide = "right";
//4. Check for a collision on the left
else if(_player.bitmapData.hitTest(new Point(_player.x  - 10, _player.y + 10), 255, _foreground, new Point(_foreground.x, _foreground.y), 255))
//Move teh lander out of the collision
PlayerShip.PlayerX = +1;
PlayerShip.VX = 0;
_collisionSide = "left";
else{
break;
//Switch gravity back on if there is no ground below the lander.
//Adding "+1+ to the lander;s y position in hte collision
//test is the key to making this work
if(!_player.bitmapData.hitTest(new Point(_player.x, _player.y), 255, _foreground, new Point(_foreground.x, _foreground.y), 255))
PlayerShip.gravity = .015;
LunarMadness Class:
package {
import flash.display.MovieClip;
import flash.events.Event;
import flash.display.Bitmap;
import flash.display.BitmapData;
public class Lunar_Madness extends MovieClip
private var _playerShip:PlayerShip;
private var _playerMissiles:PlayerMissiles;
public static var foreground:Bitmap;
private var _shipGroundCollide:PlayerGroundCollisions;
public var imageBitmapData:BitmapData;
public var foreground:Bitmap;
public function Lunar_Madness()
_playerShip = new PlayerShip();
_playerMissiles = new PlayerMissiles();
_shipGroundCollide = new PlayerGroundCollisions();
addEventListener(Event.ADDED_TO_STAGE,onAddedToStage);
private function onAddedToStage(event:Event):void
//Initialize properties
imageBitmapData = new Fg(1437, 376);
foreground = new Bitmap(imageBitmapData);
foreground.x = -26;
foreground.y = 216;
addChild(foreground);
addChild(_playerShip);
addChild(_playerMissiles);
addChild(_shipGroundCollide);
//Add event listenters
addEventListener(Event.ENTER_FRAME, onEnterFrame);
addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
private function onRemovedFromStage(event:Event):void
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage)
private function onEnterFrame(event:Event):void
{//Directives....
_playerShip.frameEvents();         - ---------------->LINE 61 FROM ABOVE
_playerMissiles.frameEvents();
_shipGroundCollide.frameEvents();
public static function get Foreground():Bitmap
return foreground;
CAN ANYONE CLUE ME IN AS TO WHAT THE PROBLEM IS?

Have you tried debugging it by placing a breakpoint on the line mentioned in the error and stepping through it? Try that if you haven't done so... that would help.

Similar Messages

  • Error #1009 in my Platform Game! Please Help!!!

    In my basic platform game I have a "hero" that can walk and jump on the "ground." There is also a door to the next scene, which is the next level.The first scene works fine, but "TypeError: Error #1006: value is not a function. at Charles3_fla::MainTimeline/frame1()" pops up once in the output. It works however, and I'm not worried about it. The second I go throught the door though, Scene 2 opens, but then starts flashing as "TypeError: Error #1009: Cannot access a property or method of a null object reference. at Charles3_fla::MainTimeline/onenter()" pops up A LOT in the output. I don't know how to fix it, and would like help. P.S. I am using Adobe CS5 with actionscript 3
    Here is the code for Scene 1:
    hero.gotoAndStop('still');
    var Key:KeyObject = new KeyObject(stage);
    var vy:Number=0;
    var gravity:Number=2;
    var jumped:Boolean = false;
    stage.addEventListener(Event.ENTER_FRAME,onenter)(true);
    function onenter(e:Event):void{
    vy+=gravity;
    if(! ground.hitTestPoint(hero.x,hero.y,true)) {
      hero.y+vy;
    if(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x-=13;
    if(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x+=13;
    if (vy>10) {
      vy=10;
    for (var i:int = 0; i<10; i++) {
      if (ground.hitTestPoint(hero.x,hero.y,true)) {
       hero.y--;
       vy=6;
       jumped=true;
    if(door.hitTestObject(hero)){
        gotoAndPlay(1,"Scene 2");
    if(hero.y>300){
      vy=6;
      jumped=true;
      if(Key.isDown(Key.UP) && jumped){
       vy=-13;
       jumped=false;
       hero.y+=vy;
    if(Key.isDown(Key.RIGHT)){
      hero.x+=10;
      hero.scaleX=1;
      hero.gotoAndStop('walking');
      }else if(Key.isDown(Key.LEFT)){
      hero.x-=10;
      hero.scaleX=-1;
      hero.gotoAndStop('walking');
      }else{
       hero.gotoAndStop('still');
    And for Scene 2...
    hero.gotoAndStop('still');
    var Key1:KeyObject =KeyObject(stage);
    var vy1:Number=0;
    var gravity1:Number=2;
    var jumped1:Boolean = false;
    stage.addEventListener(Event.ENTER_FRAME,onenter1)(true);
    function onenter1(e:Event):void{
    vy1+=gravity;
    if(! ground.hitTestPoint(hero.x,hero.y,true)) {
      hero.y+vy;
    if(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x-=13;
    if(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x+=13;
    if (vy1>10) {
      vy1=10;
    for (var i:int = 0; i<10; i++) {
      if (ground.hitTestPoint(hero.x,hero.y,true)) {
       hero.y--;
       vy1=6;
       jumped1=true;
    if(door.hitTestObject(hero)){
        gotoAndPlay(1,"Scene 2");
    if(hero.y>300){
      vy1=6;
      jumped1=true;
      if(Key.isDown(Key.UP) && jumped1){
       vy1=-13;
       jumped1=false;
       hero.y+=vy;
    if(Key.isDown(Key.RIGHT)){
      hero.x+=10;
      hero.scaleX=1;
      hero.gotoAndStop('walking');
      }else if(Key.isDown(Key.LEFT)){
      hero.x-=10;
      hero.scaleX=-1;
      hero.gotoAndStop('walking');
      }else{
       hero.gotoAndStop('still');
    Please reply as soon as possible, and thanks for your time
    swiatekalex555

    Ok sorry about my misunderstanding. Here's the code with the errors Highlighted. I also downloaded a "KeyObject.as" package, and the contents of that are on the bottom.
    hero.gotoAndStop('still');
    var Key:KeyObject = new KeyObject(stage);
    var vy:Number=0;
    var gravity:Number=2;
    var jumped:Boolean = false;
    stage.addEventListener(Event.ENTER_FRAME,onenter)(true);
    function onenter(e:Event):void{
    vy+=gravity;
    if(! ground.hitTestPoint(hero.x,hero.y,true)) {
      hero.y+vy;
    if(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x-=13;
    if(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x+=13;
    if (vy>10) {
      vy=10;
    for (var i:int = 0; i<10; i++) {
      if (ground.hitTestPoint(hero.x,hero.y,true)) {
       hero.y--;
       vy=6;
       jumped=true;
    if(door.hitTestObject(hero)){
        gotoAndPlay(1,"Scene 2");
    if(hero.y>300){
      vy=6;
      jumped=true;
      if(Key.isDown(Key.UP) && jumped){
       vy=-13;
       jumped=false;
       hero.y+=vy;
    if(Key.isDown(Key.RIGHT)){
      hero.x+=10;
      hero.scaleX=1;
      hero.gotoAndStop('walking');
      }else if(Key.isDown(Key.LEFT)){
      hero.x-=10;
      hero.scaleX=-1;
      hero.gotoAndStop('walking');
      }else{
       hero.gotoAndStop('still');
    And for Scene 2...
    hero.gotoAndStop('still');
    var Key1:KeyObject =KeyObject(stage);
    var vy1:Number=0;
    var gravity1:Number=2;
    var jumped1:Boolean = false;
    stage.addEventListener(Event.ENTER_FRAME,onenter1)(true);
    function onenter1(e:Event):void{
    vy1+=gravity;
    if(! ground.hitTestPoint(hero.x,hero.y,true)) {
      hero.y+vy;
    if(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x-=13;
    if(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x+=13;
    if (vy1>10) {
      vy1=10;
    for (var i:int = 0; i<10; i++) {
      if (ground.hitTestPoint(hero.x,hero.y,true)) {
       hero.y--;
       vy1=6;
       jumped1=true;
    if(door.hitTestObject(hero)){
        gotoAndPlay(1,"Scene 2");
    if(hero.y>300){
      vy1=6;
      jumped1=true;
      if(Key.isDown(Key.UP) && jumped1){
       vy1=-13;
       jumped1=false;
       hero.y+=vy;
    if(Key.isDown(Key.RIGHT)){
      hero.x+=10;
      hero.scaleX=1;
      hero.gotoAndStop('walking');
      }else if(Key.isDown(Key.LEFT)){
      hero.x-=10;
      hero.scaleX=-1;
      hero.gotoAndStop('walking');
      }else{
       hero.gotoAndStop('still');
    the KeyObject.as
    package {
    import flash.display.Stage;
    import flash.events.KeyboardEvent;
    import flash.ui.Keyboard;
    import flash.utils.Proxy;
    import flash.utils.flash_proxy;
      * The KeyObject class recreates functionality of
      * Key.isDown of ActionScript 1 and 2
      * Usage:
      * var key:KeyObject = new KeyObject(stage);
      * if (key.isDown(key.LEFT)) { ... }
    dynamic public class KeyObject extends Proxy {
      private static var stage:Stage;
      private static var keysDown:Object;
      public function KeyObject(stage:Stage) {
       construct(stage);
      public function construct(stage:Stage):void {
       KeyObject.stage = stage;
       keysDown = new Object();
       stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
       stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
      flash_proxy override function getProperty(name:*):* {
       return (name in Keyboard) ? Keyboard[name] : -1;
      public function isDown(keyCode:uint):Boolean {
       return Boolean(keyCode in keysDown);
      public function deconstruct():void {
       stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
       stage.removeEventListener(KeyboardEvent.KEY_UP, keyReleased);
       keysDown = new Object();
       KeyObject.stage = null;
      private function keyPressed(evt:KeyboardEvent):void {
       keysDown[evt.keyCode] = true;
      private function keyReleased(evt:KeyboardEvent):void {
       delete keysDown[evt.keyCode];
    Help if you can,
    swiatekalex555

  • Error #1009 - think it has to do with a movie file

    This error keeps on coming up when im trying to complete my flash website, the error seams to linked to a movie file that is interrupting something somewhere
    this is the complete error message,
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at wokringonsite_fla::MainTimeline/frame3()[wokringonsite_fla.MainTimeline::frame3:16]
              at flash.display::Sprite/constructChildren()
              at flash.display::Sprite()
              at flash.display::MovieClip()
              at flash.display::MovieClip/nextFrame()
              at wokringonsite_fla::MainTimeline/updatePreloader()[wokringonsite_fla.MainTimeline::frame1: 12]
    this is the code from the begining
    stop();
    //Preloader
    loaderInfo.addEventListener(ProgressEvent.PROGRESS, updatePreloader);
    function updatePreloader(evtObj:ProgressEvent):void
              //container for the progress of the site (download)
              var percent:Number = Math.floor((evtObj.bytesLoaded*100)/evtObj.bytesTotal);
              preloader_txt.text = percent+"%";
              if (percent==100){
                        nextFrame();
    next frame
    stop();
    //Animate in the home_mc from right to left, using the Tween class.
    //Flash - go get code that's going to make the tween work...
    import fl.transitions.Tween;
    import fl.transitions.TweenEvent;
    import fl.transitions.easing.*;
    //content_mc animation - animate in..
    var homeTween:Tween = new Tween(content_mc,"x",Regular.easeOut,content_mc.x,350,1,true);
    //Move the background into place
    new Tween(bkgd_mc,"x",Regular.easeOut,bkgd_mc.x,0,1,true);
    //handle events for buttons...
    home.addEventListener(MouseEvent.CLICK, clickSection);
    about.addEventListener(MouseEvent.CLICK, clickSection);
    portfolio.addEventListener(MouseEvent.CLICK, clickSection);
    contact.addEventListener(MouseEvent.CLICK, clickSection);
    AD5.addEventListener(MouseEvent.CLICK, clickSection);
    AD6.addEventListener(MouseEvent.CLICK, clickSection);
    AD7.addEventListener(MouseEvent.CLICK, clickSection);
    tvc.addEventListener(MouseEvent.CLICK, clickSection);
    function clickSection(evtObj:MouseEvent){
              //trace shows what's happening.. in the output window
              trace ("The "+evtObj.target.name+" button was clicked!")
              //go to the section clicked on...
              gotoAndStop(evtObj.target.name);
    var aboutTween:Tween = new Tween(content_mc,"x",Regular.easeOut,content_mc.x, 0,1,true);
    //Move the background into place
    new Tween(bkgd_mc,"x",Regular.easeOut,bkgd_mc.x,-166,1,true); ------- this basic code is used for all windows from home to tvc ,
    tvc code
    var tvcTween:Tween = new Tween(content_mc,"x",Regular.easeOut,content_mc.x,-2500,1,true);
    //Move the background into place
    new Tween(bkgd_mc,"x",Regular.easeOut,bkgd_mc.x,-1500,1,true);
    tvcTween.addEventListener(TweenEvent.MOTION_FINISH,donePlaying);
    function donePlaying(e:TweenEvent):void{
              trace ("done playing!");
              content_mc.tvc_mc.myvideo.play();
    I have absolutely no idea and right now it seams like a maze trapped in the puzzel trapped in pac man,
    any help would be fantastic
    cheers

    hey man this is a screen shot from frame 3, there is nothing in frame 16 which makes me wonder

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

  • Error #1009: Cannot access a property or method

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

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

  • First flexunit test is always failing with Error Error #1009: Cannot access a property or method of

    Hi,
    I have flexunit project which I am trying to run on linux server.
    1. I have Tests project.
    2. I am trying to compile it on linux server and creating Tests.swf file and then executing Tests.swf using ant on 64 bit linux server using standalone flash debug player.
    3. Tests project contains 4 tests and first tests always fail with following error,
        test:
         [flexunit] Validating task attributes ...
         [flexunit] Generating default values ...
         [flexunit] Using default working dir [/mnt/build/VinitFlexUnitBranch/workspace/src/Tests]
         [flexunit] Using the following settings for the test run:
         [flexunit] FLEX_HOME: [/var/lib/flex4.1sdk]
         [flexunit] haltonfailure: [true]
         [flexunit] headless: [false]
         [flexunit] display: [99]
         [flexunit] localTrusted: [true]
         [flexunit] player: [flash]
         [flexunit] port: [1024]
         [flexunit] swf: [/mnt/build/VinitFlexUnitBranch/workspace/bin/Tests.swf]
         [flexunit] timeout: [60000ms]
         [flexunit] toDir: [/mnt/build/VinitFlexUnitBranch/workspace/src/Tests/report]
         [flexunit] Setting up server process ...
         [flexunit] Entry [/mnt/build/VinitFlexUnitBranch/workspace/bin] already available in local trust file at [/home/deploy/.macromedia/Flash_Player/#Security/FlashPlayerTrust/flexUnit.cfg].
         [flexunit] Executing 'gflashplayer' with arguments:
         [flexunit] '/mnt/build/VinitFlexUnitBranch/workspace/bin/Tests.swf'
         [flexunit]
         [flexunit] The ' characters around the executable and arguments are
         [flexunit] not part of the command.
         [flexunit]
         [flexunit] Starting server ...
         [flexunit] Opening server socket on port [1024].
         [flexunit] Waiting for client connection ...
         [flexunit] Client connected.
         [flexunit] Setting inbound buffer size to [262144] bytes.
         [flexunit] Receiving data ...
         [flexunit] Sending acknowledgement to player to start sending test data ...
         [flexunit]
         [flexunit] FlexUnit test pause in suite Tests.Classes.DummyASyncTest had errors.
         [flexunit]
         [flexunit] Stopping server ...
         [flexunit] End of test data reached, sending acknowledgement to player ...
         [flexunit] Closing client connection ...
         [flexunit] Closing server on port [1024] ...
         [flexunit] <testcase classname="Tests.Classes::DummyASyncTest" name="pause" time="8" status="error"><error message="Error #1009: Cannot access a property or method of a null object reference." type="Tests.Classes::DummyASyncTest.pause" ><![CDATA[TypeError: Error #1009: Cannot access a property or method of a null object reference.
         [flexunit] at org.fluint.uiImpersonation.flex::FlexEnvironmentBuilder/buildVisualTestEnvironment()
         [flexunit] at org.fluint.uiImpersonation::VisualTestEnvironmentBuilder/buildVisualTestEnvironment()
         [flexunit] at org.flexunit.internals.runners.watcher::FrameWatcher/getStage()
         [flexunit] at org.flexunit.internals.runners.watcher::FrameWatcher()
         [flexunit] at org.flexunit.internals.runners.statements::StackAndFrameManagement()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/withStackManagement()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/withDecoration()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/methodBlock()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()
         [flexunit] at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
         [flexunit] at org.flexunit.runners::ParentRunner/run()
         [flexunit] at org.flexunit.runners::Suite/runChild()
         [flexunit] at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
         [flexunit] at org.flexunit.runners::ParentRunner/run()
         [flexunit] at org.flexunit.runners::Suite/runChild()
         [flexunit] at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
         [flexunit] at org.flexunit.runners::ParentRunner/run()
         [flexunit] at org.flexunit.runner::FlexUnitCore/beginRunnerExecution()
         [flexunit] at org.flexunit.runner::FlexUnitCore/verifyRunnerCanBegin()
         [flexunit] at org.flexunit.token::AsyncCoreStartupToken/sendReady()
         [flexunit] at org.flexunit.runner.notification.async::AsyncListenerWatcher/sendReadyNotification()
         [flexunit] at org.flexunit.runner.notification.async::AsyncListenerWatcher/handleListenerReady()
         [flexunit] at flash.events::EventDispatcher/dispatchEventFunction()
         [flexunit] at flash.events::EventDispatcher/dispatchEvent()
         [flexunit] at org.flexunit.listeners::CIListener/setStatusReady()
         [flexunit] at org.flexunit.listeners::CIListener/dataHandler()
         [flexunit] at flash.events::EventDispatcher/dispatchEventFunction()
         [flexunit] at flash.events::EventDispatcher/dispatchEvent()
         [flexunit] at flash.net::XMLSocket/scanAndSendEvent()]]></error></testcase>
         [flexunit] <endOfTestRun/>
         [flexunit] Analyzing reports ...
         [flexunit]
         [flexunit] Suite: Tests.Classes.DummyASyncTest
         [flexunit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.008 sec
         [flexunit]
         [flexunit] Results :
         [flexunit]
         [flexunit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.008 sec
         [flexunit]
        BUILD FAILED
        /mnt/build/VinitFlexUnitBranch/workspace/src/Tests/build.xml:26: FlexUnit tests failed during the test run.
        at org.flexunit.ant.tasks.TestRun.analyzeReports(Unknown Source)
        at org.flexunit.ant.tasks.TestRun.run(Unknown Source)
        at org.flexunit.ant.tasks.FlexUnitTask.execute(Unknown Source)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:809)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
        Total time: 1 second
    Exited with status 1
    [deploy]$
    4. Everytime I run this, any test which is run first will fail and all other tests will pass.
    My Tests.as file is as below:
    * Tests.as
    package
    import Tests.XTestSuite;
    import flash.display.Sprite;
    import mx.core.FlexSprite;
    import org.flexunit.listeners.CIListener;
    import org.flexunit.listeners.UIListener;
    import org.flexunit.runner.FlexUnitCore;
    public class Tests extends Sprite
    public var flexSprite:FlexSprite;
    public function Tests()
    onCreationComplete();
    public function onCreationComplete() : void {
    var core : FlexUnitCore = new FlexUnitCore();
    core.addListener(new CIListener());
    core.runClasses(Tests.XTestSuite);
    public function currentRunTestSuite():Array
    var testsToRun:Array = new Array();
    testsToRun.push(Tests.XTestSuite);
    return testsToRun;
    XTestSuite try to run 4 flexunit test classes.
    one of that flexunit test script class is as below:
    package Tests.Classes
    import flexunit.framework.Assert;
    import org.flexunit.Assert;
    import org.flexunit.asserts.assertEquals;
    public class DummyASyncTest
    [Test]
    public function pause() : void
    assertEquals(true, true);
    trace("I M in dummy");
    All other tests are dummy tests which just asserts(true, true).
    I am not sure if I doing something wrong or forgot to take care of something.

    Hi,
    I have flexunit project which I am trying to run on linux server.
    1. I have Tests project.
    2. I am trying to compile it on linux server and creating Tests.swf file and then executing Tests.swf using ant on 64 bit linux server using standalone flash debug player.
    3. Tests project contains 4 tests and first tests always fail with following error,
        test:
         [flexunit] Validating task attributes ...
         [flexunit] Generating default values ...
         [flexunit] Using default working dir [/mnt/build/VinitFlexUnitBranch/workspace/src/Tests]
         [flexunit] Using the following settings for the test run:
         [flexunit] FLEX_HOME: [/var/lib/flex4.1sdk]
         [flexunit] haltonfailure: [true]
         [flexunit] headless: [false]
         [flexunit] display: [99]
         [flexunit] localTrusted: [true]
         [flexunit] player: [flash]
         [flexunit] port: [1024]
         [flexunit] swf: [/mnt/build/VinitFlexUnitBranch/workspace/bin/Tests.swf]
         [flexunit] timeout: [60000ms]
         [flexunit] toDir: [/mnt/build/VinitFlexUnitBranch/workspace/src/Tests/report]
         [flexunit] Setting up server process ...
         [flexunit] Entry [/mnt/build/VinitFlexUnitBranch/workspace/bin] already available in local trust file at [/home/deploy/.macromedia/Flash_Player/#Security/FlashPlayerTrust/flexUnit.cfg].
         [flexunit] Executing 'gflashplayer' with arguments:
         [flexunit] '/mnt/build/VinitFlexUnitBranch/workspace/bin/Tests.swf'
         [flexunit]
         [flexunit] The ' characters around the executable and arguments are
         [flexunit] not part of the command.
         [flexunit]
         [flexunit] Starting server ...
         [flexunit] Opening server socket on port [1024].
         [flexunit] Waiting for client connection ...
         [flexunit] Client connected.
         [flexunit] Setting inbound buffer size to [262144] bytes.
         [flexunit] Receiving data ...
         [flexunit] Sending acknowledgement to player to start sending test data ...
         [flexunit]
         [flexunit] FlexUnit test pause in suite Tests.Classes.DummyASyncTest had errors.
         [flexunit]
         [flexunit] Stopping server ...
         [flexunit] End of test data reached, sending acknowledgement to player ...
         [flexunit] Closing client connection ...
         [flexunit] Closing server on port [1024] ...
         [flexunit] <testcase classname="Tests.Classes::DummyASyncTest" name="pause" time="8" status="error"><error message="Error #1009: Cannot access a property or method of a null object reference." type="Tests.Classes::DummyASyncTest.pause" ><![CDATA[TypeError: Error #1009: Cannot access a property or method of a null object reference.
         [flexunit] at org.fluint.uiImpersonation.flex::FlexEnvironmentBuilder/buildVisualTestEnvironment()
         [flexunit] at org.fluint.uiImpersonation::VisualTestEnvironmentBuilder/buildVisualTestEnvironment()
         [flexunit] at org.flexunit.internals.runners.watcher::FrameWatcher/getStage()
         [flexunit] at org.flexunit.internals.runners.watcher::FrameWatcher()
         [flexunit] at org.flexunit.internals.runners.statements::StackAndFrameManagement()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/withStackManagement()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/withDecoration()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/methodBlock()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()
         [flexunit] at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
         [flexunit] at org.flexunit.runners::ParentRunner/run()
         [flexunit] at org.flexunit.runners::Suite/runChild()
         [flexunit] at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
         [flexunit] at org.flexunit.runners::ParentRunner/run()
         [flexunit] at org.flexunit.runners::Suite/runChild()
         [flexunit] at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
         [flexunit] at org.flexunit.runners::ParentRunner/run()
         [flexunit] at org.flexunit.runner::FlexUnitCore/beginRunnerExecution()
         [flexunit] at org.flexunit.runner::FlexUnitCore/verifyRunnerCanBegin()
         [flexunit] at org.flexunit.token::AsyncCoreStartupToken/sendReady()
         [flexunit] at org.flexunit.runner.notification.async::AsyncListenerWatcher/sendReadyNotification()
         [flexunit] at org.flexunit.runner.notification.async::AsyncListenerWatcher/handleListenerReady()
         [flexunit] at flash.events::EventDispatcher/dispatchEventFunction()
         [flexunit] at flash.events::EventDispatcher/dispatchEvent()
         [flexunit] at org.flexunit.listeners::CIListener/setStatusReady()
         [flexunit] at org.flexunit.listeners::CIListener/dataHandler()
         [flexunit] at flash.events::EventDispatcher/dispatchEventFunction()
         [flexunit] at flash.events::EventDispatcher/dispatchEvent()
         [flexunit] at flash.net::XMLSocket/scanAndSendEvent()]]></error></testcase>
         [flexunit] <endOfTestRun/>
         [flexunit] Analyzing reports ...
         [flexunit]
         [flexunit] Suite: Tests.Classes.DummyASyncTest
         [flexunit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.008 sec
         [flexunit]
         [flexunit] Results :
         [flexunit]
         [flexunit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.008 sec
         [flexunit]
        BUILD FAILED
        /mnt/build/VinitFlexUnitBranch/workspace/src/Tests/build.xml:26: FlexUnit tests failed during the test run.
        at org.flexunit.ant.tasks.TestRun.analyzeReports(Unknown Source)
        at org.flexunit.ant.tasks.TestRun.run(Unknown Source)
        at org.flexunit.ant.tasks.FlexUnitTask.execute(Unknown Source)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:809)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
        Total time: 1 second
    Exited with status 1
    [deploy]$
    4. Everytime I run this, any test which is run first will fail and all other tests will pass.
    My Tests.as file is as below:
    * Tests.as
    package
    import Tests.XTestSuite;
    import flash.display.Sprite;
    import mx.core.FlexSprite;
    import org.flexunit.listeners.CIListener;
    import org.flexunit.listeners.UIListener;
    import org.flexunit.runner.FlexUnitCore;
    public class Tests extends Sprite
    public var flexSprite:FlexSprite;
    public function Tests()
    onCreationComplete();
    public function onCreationComplete() : void {
    var core : FlexUnitCore = new FlexUnitCore();
    core.addListener(new CIListener());
    core.runClasses(Tests.XTestSuite);
    public function currentRunTestSuite():Array
    var testsToRun:Array = new Array();
    testsToRun.push(Tests.XTestSuite);
    return testsToRun;
    XTestSuite try to run 4 flexunit test classes.
    one of that flexunit test script class is as below:
    package Tests.Classes
    import flexunit.framework.Assert;
    import org.flexunit.Assert;
    import org.flexunit.asserts.assertEquals;
    public class DummyASyncTest
    [Test]
    public function pause() : void
    assertEquals(true, true);
    trace("I M in dummy");
    All other tests are dummy tests which just asserts(true, true).
    I am not sure if I doing something wrong or forgot to take care of something.

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

  • Why iphone send me error 1009 i live in iran yeah i know but app store works for me until today that send me error 1009 please help me

    Why my iphone send me error 1009 , i know i live in iran and ... But appstore doesn't send me error until today that  i face with this error

    The 1009 error is normally associated with a blocked country. There are a list of countries that Apple is not allowed to sell their software to due to US restrictions. Iran and Syria come to mind but I believe there are about a dozen.

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

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

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

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

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

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

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

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

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

  • Flash Error #1009 -- NEED HELP!

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

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

  • Runtime Error 1009 After Converting from Flex 3.6 to 4.5.1

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

    URLUtil still exists.  I would verify what is null.

  • Could somebody explain why I am getting this Error #1009 message?

    Hi. I am following a tutorial on lynda.com in hopes of learning how to use actionscript 3.0 and my copy of flash CS4 to create games. I wrote my code exactly like it showed in the tutorial, but for some reason I will occasionally receive an error that says
    "TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at Monster/die()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at fl.motion::AnimatorBase/end()
    at fl.motion::AnimatorBase/handleLastFrame()
    at fl.motion::AnimatorBase/nextFrame()
    at fl.motion::AnimatorBase/handleEnterFrame()"
    It doesn't happen all the time but it will every once in a while. There doesn't really seem to be anything specifically that triggers it either. I also happened to notice that not all of the enemies respond to being clicked on. I don't know if these two things are related or not. I don't know if the error is caused by the code for the monster library item or the code for the main timeline. Thank you in advance for looking at my code.
    This is my code for the monster library item:
    import fl.motion.Animator;
    import fl.motion.MotionEvent;
    var this_xml:XML = <Motion duration="30" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
    <source>
      <Source frameRate="10" x="275" y="200" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" symbolName="monster">
       <dimensions>
        <geom:Rectangle left="-32.5" top="-32.95" width="65.05" height="65.95"/>
       </dimensions>
       <transformationPoint>
        <geom:Point x="0.49961568024596464" y="0.49962092494313876"/>
       </transformationPoint>
      </Source>
    </source>
    <Keyframe index="0" tweenSnap="true" tweenSync="true">
      <tweens>
       <SimpleEase ease="0"/>
      </tweens>
    </Keyframe>
    <Keyframe index="29" tweenSnap="true" tweenSync="true" scaleX="2.782" scaleY="2.697">
      <tweens>
       <SimpleEase ease="0"/>
      </tweens>
    </Keyframe>
    </Motion>;
    var this_animator:Animator = new Animator(this_xml, this);
    this_animator.play();
    this_animator.addEventListener(MotionEvent.MOTION_END, hurtPlayer);
    function hurtPlayer(MotionEvent):void
    var main:MovieClip = MovieClip(this.parent.parent);
    main.decreaseEnergy();
    this.parent.removeChild(this);
    this.addEventListener(MouseEvent.CLICK, killMonster);
    function killMonster(event:MouseEvent):void
    this_xml = <Motion duration="5" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
    <source>
      <Source frameRate="10" x="275" y="200" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" symbolName="monster" class="Monster">
       <dimensions>
        <geom:Rectangle left="-32.5" top="-32.95" width="65.05" height="65.95"/>
       </dimensions>
       <transformationPoint>
        <geom:Point x="0.49961568024596464" y="0.49962092494313876"/>
       </transformationPoint>
      </Source>
    </source>
    <Keyframe index="0" rotateDirection="cw" rotateTimes="1" tweenSnap="true" tweenSync="true">
      <tweens>
       <SimpleEase ease="0"/>
      </tweens>
    </Keyframe>
    <Keyframe index="4" rotateDirection="cw" rotateTimes="1" tweenSnap="true" tweenSync="true" scaleX="0.416" scaleY="0.378">
      <color>
       <Color alphaMultiplier="0"/>
      </color>
      <tweens>
       <SimpleEase ease="0"/>
      </tweens>
    </Keyframe>
    </Motion>;
    this_animator = new Animator(this_xml, this);
    this_animator.play();
    this_animator.addEventListener(MotionEvent.MOTION_END, die);
    function die(event:MotionEvent):void
    var main:MovieClip = MovieClip(this.parent.parent);
    main.increaseScore();
    this_animator.removeEventListener(MotionEvent.MOTION_END, hurtPlayer);
    this.parent.removeChild(this);
    This is my code for the main timeline:
    var monstersInGame:uint;
    var monsterMaker:Timer;
    var container_mc:MovieClip;
    var cursor:MovieClip;
    var score:int;
    var energy:int;
    function initializeGame():void
    monstersInGame = 10;
    monsterMaker = new Timer(1000, monstersInGame);
    container_mc = new MovieClip;
    addChild(container_mc);
    monsterMaker.addEventListener(TimerEvent.TIMER, createMonsters);
    monsterMaker.start();
    cursor = new Cursor();
    addChild(cursor);
    cursor.enabled = false;
    Mouse.hide();
    stage.addEventListener(MouseEvent.MOUSE_MOVE, dragCursor);
    score = 0;
    energy = energy_mc.totalFrames;
    energy_mc.gotoAndStop(energy);
    function dragCursor(event:MouseEvent):void
    cursor.x = this.mouseX;
    cursor.y = this.mouseY;
    function createMonsters(event:TimerEvent):void
    var monster:MovieClip;
    monster = new Monster();
    monster.x = Math.random() * stage.stageWidth;
    monster.y = Math.random() * stage.stageHeight;
    container_mc.addChild(monster);
    function increaseScore():void
    score ++;
    if(score >= monstersInGame)
      monsterMaker.stop();
    function decreaseEnergy():void
    energy --;
    if(energy <= 0)
      monsterMaker.stop();
    else
      energy_mc.gotoAndStop(energy);
    initializeGame();

    Ok. Apparently, I didn't test it enought times to get the error. I went back and tested it again to get the error. When I did this, the
    trace(this); revealed [object Monster]
    and
    trace(this.parent); revealed [object MovieClip].
    The only one that was different was the one that gave the error. For that one the
    trace(this); revealed [object Monster]
    and
    trace(this.parent); revealed null.
    Then it gave all of the error information.

Maybe you are looking for

  • How to run ABAP Function Module in Background Wchich Takes Long Time to Run

    How to run ABAP Function Module in Background FOR LONG TIME I am not that experienced with ABAP. I am on SAP BI 7.0. I WANT TO RUN A FUNCTION MODULE RSDRT_INFOCUBE_DATA_COPY. I used SE37 and then executed the module, I supplied  the parameters on the

  • Can we Have Authorisation in VC

    Hi , is it possible in VC to assign Authorisation such that particular user can see only particular Graphs and Particular data in the same model. Please Help. Thanks Tulsi Edited by: Thulasi ram on Jun 20, 2008 9:26 AM

  • Fill in forms.....different color??

    I am filling out tax forms for my business and then pr inting them off. Is there any way to change the color of the ink. It always comes up blue and p rints that way also. Can I get it to type and print in black?

  • Error 1935 during installation of Adobe XI Pro 11.0.07.

    Setup rolled back and failed. Running windows 8.1 on Lenovo laptop. Please advise.

  • IDOC errors Notify thru Workflow

    Hello Experts, I want to report an error notification; if an Idoc fails. What are the steps for this Configuration? Also if I want to sent some notification on success/fail status of Idoc, how do I configure workflow for the same. What are the steps