final^^ Posted June 11, 2012 Share Posted June 11, 2012 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 More sharing options...
GreenSock Posted June 11, 2012 Share Posted June 11, 2012 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 More sharing options...
final^^ Posted June 11, 2012 Author Share Posted June 11, 2012 Thank for replying to my problem^^ here is the trace value: [object information_44] and [object backbtn1_45] Both information and backbtn has instances and it name, I have checked Link to comment Share on other sites More sharing options...
GreenSock Posted June 11, 2012 Share Posted June 11, 2012 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 More sharing options...
final^^ Posted June 11, 2012 Author Share Posted June 11, 2012 umm I not really good in AS3.Would you mind to tell me where to trace??In my fla there are alot of TweenMax.from() >< Link to comment Share on other sites More sharing options...
pixeldroid Posted June 11, 2012 Share Posted June 11, 2012 Could you upload the file? Link to comment Share on other sites More sharing options...
final^^ Posted June 11, 2012 Author Share Posted June 11, 2012 the max upload here was only 500k mine was around 1.14mb.. Okay here is mediafire link: http://www.mediafire.com/?pdtf74ko8y4y5sz Link to comment Share on other sites More sharing options...
pixeldroid Posted June 11, 2012 Share Posted June 11, 2012 Okay here is mediafire link: http://www.mediafire...pdtf74ko8y4y5sz This file is currently set to private. When a file is set to private by its owner only the owner of the file can access it. If you are the owner of the file please log into your account to access this file. Link to comment Share on other sites More sharing options...
GreenSock Posted June 11, 2012 Share Posted June 11, 2012 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 More sharing options...
final^^ Posted June 11, 2012 Author Share Posted June 11, 2012 opps...i set it to public already. ops..i will try it now thanks!! Link to comment Share on other sites More sharing options...
final^^ Posted June 11, 2012 Author Share Posted June 11, 2012 As i do what you have told me, i comment all tween and try out again.Currently there are no error but the main title is gone same as the old problem.>< Link to comment Share on other sites More sharing options...
pixeldroid Posted June 11, 2012 Share Posted June 11, 2012 I clicked all 5 buttons on the home screen and the back button worked after each one. If you are still getting the error, tell us the steps to reproduce. Link to comment Share on other sites More sharing options...
final^^ Posted June 11, 2012 Author Share Posted June 11, 2012 All other are working fine except for the center IS back button.When you clicked it, it will return to the main but the title was gone.If there are tween(greensock) it will appear error. this is the image link: http://www.mediafire.com/?7f5g4zrp9xwwjdd -1 is back button from first booth -2 is back button from IS Link to comment Share on other sites More sharing options...
pixeldroid Posted June 11, 2012 Share Posted June 11, 2012 I clicked 'Is', then 'Back', then the title drops down on the home screen. No errors: the button is being click! [object backbtn1_45] Are u using V12 of Greensock? Also, you might want to organize your Flash Library with folders Link to comment Share on other sites More sharing options...
final^^ Posted June 11, 2012 Author Share Posted June 11, 2012 Really!!? I think mine was 1 year ago??which greensock i should download??Can you give me the link please? I downloaded tweenlite and it still has the same problem. Link to comment Share on other sites More sharing options...
pixeldroid Posted June 11, 2012 Share Posted June 11, 2012 http://www.greensock.com/v12/ Uppr right corner Link to comment Share on other sites More sharing options...
final^^ Posted June 12, 2012 Author Share Posted June 12, 2012 I have downloaded the V12 and it still has the problem.I using CS5 to do it. Link to comment Share on other sites More sharing options...
pixeldroid Posted June 12, 2012 Share Posted June 12, 2012 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. 1 Link to comment Share on other sites More sharing options...
final^^ Posted June 12, 2012 Author Share Posted June 12, 2012 it trace backbtn1 and then continue with error.Thank for helping me alot.I does not know why my IS back button will have problem going frame1 Link to comment Share on other sites More sharing options...
Carl Posted June 12, 2012 Share Posted June 12, 2012 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 More sharing options...
final^^ Posted June 12, 2012 Author Share Posted June 12, 2012 (edited) Ohh okay,there it is. http://www.mediafire.com/?rh51x27dql1d6zg in this forum it says unsupported upload,cant upload this kind of file Edited June 12, 2012 by final^^ Link to comment Share on other sites More sharing options...
pixeldroid Posted June 12, 2012 Share Posted June 12, 2012 You've still got me stumped - works fine here. Try this for your Frame 25 function: function onClick4(evt:MouseEvent):void{ trace("the button is being click!") trace(backbtn1) MovieClip(root).gotoAndPlay(1); } Link to comment Share on other sites More sharing options...
final^^ Posted June 12, 2012 Author Share Posted June 12, 2012 It is still same error for me though. There is an attachment to show the demo.fla,swf and the errors.Maybe is CS5 bug? Link to comment Share on other sites More sharing options...
pixeldroid Posted June 12, 2012 Share Posted June 12, 2012 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 More sharing options...
Carl Posted June 12, 2012 Share Posted June 12, 2012 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now