Announcement

Collapse

Game Loading Problems

First Check to make sure you have all the latest Plugins. They are free updates to your computer that allows you to play the games. They will not hurt your computer. They just allow you to play our games.

Here's what you need:

For Java: http://www.java.com/en/download/windows_ie.jsp

For Flash: http://www.adobe.com/products/flashplayer/

For Shockwave: http://sdc.shockwave.com/shockwave/download/download.cgi

We highly recommend you are up to date on all of them so you can play all the games here.

If you are still having problems please post what the problem is HERE
See more
See less

Can someone help me with this game in CS4?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can someone help me with this game in CS4?

    Okay, so I'm making this game and and it has 3 separate parts:

    1. The preloader for the menu
    2. The menu
    3. The actual game

    The menu is supposed to preload the game. It works fine except when it's finished, it returns this error:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at song1_fla::MainTimeline/frame1()

    an then the game wont work properly ( there are images that are should turn around and move randomly using Tweener but they don't. They also should leave a fading trail behind them.

    Here is the AS3 code for the menu ( I only have one button as of now)
    Frame 1:
    Code:
    stop();
    // make sure you have these imported.
    import flash.media.Sound;
    import flash.media.SoundChannel;
    
    // create your variables for your sound instance and one for a sound channel
    var Bgm:SSBBT = new SSBBT;
    var sndChannel:SoundChannel = Bgm.play();
    
    // then to stop your sound all you have to do is this.
    //sndChannel.stop();
    
    Song_text.text == "Choose your song"
    
    //Add Event Handler and add function to it.
    
    Song1.addEventListener( MouseEvent.CLICK, Song1_evt);
    
    function Song1_evt(evt:MouseEvent):void
    {
    sndChannel.stop();
    play();
    }
    Frame 2:

    Code:
    import flash.media.Sound;
    import flash.media.SoundChannel;
    
    
    stop();
    
    var l:Loader = new Loader();
    l.contentLoaderInfo.addEventListener(P...
    l.contentLoaderInfo.addEventListener(E... done);
    l.load(new URLRequest("song1.swf"));
    
    function loop(e:ProgressEvent):void
    {
    var perc:Number = e.bytesLoaded / e.bytesTotal;
    percent.text = Math.ceil(perc*100).toString();
    }
    
    function done(e:Event):void
    {
    removeChildAt(0);
    percent = null;
    addChild(l);
    }
    Now the game:

    Code:
    stop();
    import caurina.transitions.*;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    
    var bmd:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, true, 0x000000);
    var bm:Bitmap = new Bitmap(bmd);
    addChild(bm);
    
    var bf:BlurFilter = new BlurFilter(0, 0, 3); //R,G,B,A,?
    var cmf:ColorMatrixFilter = new ColorMatrixFilter([ 1,0,0,0,0,
    0,1,0,0,0,
    0,0,2,0,0,
    0,0,0,0.3,0]);
    
    var Bgm:Sou = new Sou;
    var sndChannel:SoundChannel = Bgm.play();
    
    var isDead:Boolean = false;
    
    
    function mover()
    {
    Tweener.addTween( red, {x:Math.random()*stage.stageWidth,
    y:Math.random()*stage.stageHeigh...
    time:1,
    rotation:Math.random()*300,
    onComplete:mover});
    Tweener.addTween( arches, {x:Math.random()*stage.stageWidth,
    y:Math.random()*stage.stageHeigh...
    time:1,
    rotation:Math.random()*300,
    onComplete:mover,
    transition:"easeInOutBounce"});
    Tweener.addTween( utah, {x:Math.random()*stage.stageWidth,
    y:Math.random()*stage.stageHeigh...
    time:1,
    rotation:Math.random()*300,
    onComplete:mover,
    transition:"easeOutQuad"});
    }
    mover();
    
    addEventListener(Event.ENTER_FRAME, loop)
    
    function loop(e:Event):void
    {
    bmd.draw(this);
    bmd.applyFilter(bmd, bmd.rect, new Point(0,0), bf);
    bmd.applyFilter(bmd, bmd.rect, new Point(0,0), cmf);
    
    if (isDead = true)
    {
    play();
    }
    
    }
Working...
X