Jump to content
Search Community

Error button

final^^ test
Moderator Tag

Recommended Posts

In my AS3, all was working fine till one button make a problem.This is the error I have:

Error: Cannot tween a null object.
at com.greensock::TweenLite()
at com.greensock::TweenMax()
at com.greensock::TweenMax$/from()
at interactive_fla::MainTimeline/frame1()
at flash.display::MovieClip/gotoAndPlay()
at interactive_fla::MainTimeline/onClick4()
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()

 

As the typeError #1009:... is alot more after this error.

 

This is my code:

stop();
import com.greensock.*;
import com.greensock.easing.*;
TweenLite.from(information_mc,1,{y:-100,delay:1,ease:Back.easeOut});
TweenLite.from(backbtn1,1,{y:-100,delay:1,ease:Back.easeOut});
backbtn1.addEventListener(MouseEvent.CLICK,onClick4)
function onClick4(evt:MouseEvent):void{
trace("the button is being click!")
trace("value = " + backbtn1)
gotoAndPlay(1);
}

 

Anyone can help??

Link to comment
Share on other sites

That just means that you're passing a null target to the tween (don't do that) :) For example, if information_mc doesn't exist or backbtn1 is null, your tweens will break (as they should). To find out which one is null, you could use trace() in place of the tween. Like trace(information_mc +" and "+backbtn1); Maybe you misspelled one of your variables.

Link to comment
Share on other sites

I think you're looking at the wrong code then. The error indicates that the null object is originating in a TweenMax.from() call, not a TweenLite.from() call. Somewhere in your project, you're passing a bad (null) value into a TweenMax.from().

Link to comment
Share on other sites

Don't forget to zip your file before uploading.

 

One technique would be to comment-out ALL of your tweens (put "//" in front of each line so that the compiler ignores them) and then uncomment them (remove the "//") one-by-one and publish each time until you hit the error. Then you'll know which line is causing the error.

 

Thanks for jumping in, pixeldroid. Great having you around.

Link to comment
Share on other sites

Sorry, I can't reproduce the error. I've clicked each of the 5 buttons on the home screen, and then the back button - no errors. I'm using CS6, but that shouldn't matter.

Try this:

In your frame 25 script, make this change:

trace(backbtn1.name)

 

If you get the error, let me know if it traces the button name first.

  • Like 1
Link to comment
Share on other sites

Hi final^^,

 

it appears to me that your file is still set to private. If you still need to get this figured out please strip everything out of your files that isn't necessary to reproduce the error. Get rid of all code and assets that aren't related to your IS button not working. If buttons 1-4 work fine, please remove them and their actions.

 

To reproduce the error should be as simple as telling us "click button 5, then click IS button".

Once your file is streamlined it should be of a size that it can be uploaded here and Pixeldroid or I will have a much easier time of spotting the error.

 

Save your files as Flash CS5 FLa or lower, zip and attach to post.

 

-Carl

 

ps. Pixeldroid, thanks a bunch for so diligently trying to assist final^^

Link to comment
Share on other sites

I tested in CS5.5 and it works here.

Grasping at straws:

Do you have your 'com' directory in the same directory as your .fla?

I can't read the error message in the image you posted, copy and paste it into a post or an attached text file.

Link to comment
Share on other sites

I downloaded the file and it worked just fine. no errors at all. the traces worked and the animation went "back" to the beginning where the title screen gets shown.

 

I even tested with v11 and v12 Beta of the greensock code.

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