Jump to content
Search Community

Random Play! tween problem

Laur3nt1u test
Moderator Tag

Recommended Posts

I have some problems with this Download EDIT : http://www.box.net/shared/73k2v3zrgmqd6g3mp9vg

 

I want to make 3 movie clips to play random but I have some problems

 

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

at com.greensock::TweenLite/init()

at com.greensock::TweenMax/init()

at com.greensock::TweenMax/renderTime()

at com.greensock.core::SimpleTimeline/renderTime()

at com.greensock::TweenLite$/updateAll()

 

can you please look at the code.....

 

thx

Link to comment
Share on other sites

when running your swf and clicking on something I got this error:

 

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

at pjt_fla::cap_3/dow2()

I hunted down dow2() in cap_3.

 

I got as far as looking at the cap_3 movie clip with 4 frames that contained up to 60 lines of very similar code.

 

inside that 60 lines of code I found dow2 with a bunch of functions nested inside of each other that contain many objects.

 

function dow2():void {

cap_nu11.addEventListener(MouseEvent.CLICK, lovit2);

function lovit2(event:MouseEvent):void{

	var mySound:Sound = new punch();
	var myChannel:SoundChannel = mySound.play();
	cap_nu12.visible = true;
	cap_nu11.visible = false;
	splat2.visible = true;
	//var vi = MovieClip(parent).viata;
	//MovieClip(parent).viata = vi + 1;
	tl2.insert(TweenMax.to(splat2, speed2 + 0.2, {alpha:0, visible:0, onComplete: do2}));

	function do2():void{
		tl2.insert(TweenMax.to(cap_nu12, speed2 + 0.1, {y:220.80, delay: speed2 + .3, onComplete: goto2}));
	}
}

var rade2:Number = random2(2,4);

tl2.insert(TweenMax.to(cap_nu11, 0.4 , {y:229.25, delay:rade2, onComplete: goto2}));
}

in short, it would take someone like me hours to figure out what exactly the null object is.

 

i also see that the error you got is different than mine.

 

All I can tell you is that these 1009 null object reference errors simply mean that you are trying to run some sort of operation on something that doesn't exist.

 

most of the time it is because a symbol has the wrong instance name or you mis-typed something.

 

In your case it may be that there is a scope issue because so many functions are living inside each other.

 

 

Sorry I can't be of more help.

 

The swf did seem to run ok until I started clicking on things.

Link to comment
Share on other sites

I've edit the code is working a while but after few clicks it crash I think

 

http://www.box.net/shared/73k2v3zrgmqd6g3mp9vg

 

 

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

at com.greensock::TweenLite/init()

at com.greensock::TweenMax/init()

at com.greensock::TweenMax/renderTime()

at com.greensock.core::SimpleTimeline/renderTime()

at com.greensock::TweenLite$/updateAll()

 

I've check the code.. I don't have null objects and I use TweenMax no TweenLite... what is wrong?! it can't handle the animations and crash?!

Link to comment
Share on other sites

I hate to say it, but I doubt the compiler is wrong.

 

What you can do to find the null object is try to trace out every element that you are tweening right before the tween takes place.

 

for instance:

 

function do2():void{

trace(cap_nu12);

tl2.insert(TweenMax.to(cap_nu12, speed2 + 0.1, {y:220.80, delay: speed2 + .3, onComplete: goto2}));

}

 

do this for every tween in the script that is causing the error

when you test your movie you will get a trace of null for the object that isn't found.

Link to comment
Share on other sites

I've check all and there are no null obj... but I think I found the problem

 

this are in the same function

 

TweenMax.to(splat1, 0.3, {alpha:0, visible:0});

TweenMax.to(cap_bun12, speed1 + 0.1, {y:220.80, delay: speed1 + 0.2, onComplete: goto1});

 

and I have to set a delay for cap_bun12 to complete after splat1 if cap_bun12 completes will goto1 and goto1 is a function that change the keyframe so the tween for splash1 can be done....

 

till now is good... will see tomorrow

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...