Jump to content

Search the Community

Showing results for tags 'null object'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 3 results

  1. Hello, I'm kind of new to Greensock (and Flash in general), so sorry if it's a stupid mistake. I'm trying to create a textbox (like in games). I fumbled around with the code until it runs properly. However, once I move onto the third frame, the Output panel gives me an error. Error: Cannot tween a null object. Duration: 0.3, data: undefined at com.greensock::TweenLite() at com.greensock::TweenMax() at com.greensock::TweenMax$/to() at textbox_fla::MainTimeline/myKeyDown() TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.greensock::TweenMax/render() at com.greensock.core::SimpleTimeline/render() at com.greensock.core::Animation$/_updateRoot() This is strange, since the function "myKeyDown" is in frame 1. I do not understand why Greensock would throw me an error, since the function is not a functionality of Greensock (it's just a regular AS3 code) . Anyways, here is the code on frame 1. import com.greensock.*; import flash.events.KeyboardEvent; stop(); TweenMax.from(instruc,1,{alpha:0}); TweenMax.from(char1,0.3,{x:"-400"}); TweenMax.from(box, 0.5, {x:"-100", alpha:0}); textbox.visible = false; TweenMax.delayedCall(0.5, myFunctionL); function myFunctionL():void{ textbox.visible = true; TweenMax.from(textbox, 0.3, {x:"-10", alpha:0}); } stage.addEventListener(KeyboardEvent.KEY_DOWN, myKeyDown); function myKeyDown(e:KeyboardEvent):void{ if(e.keyCode == 32){ TweenMax.to(textbox,0.3,{x:"10",alpha:0}); TweenMax.to(char1,0.3,{x:"-400"}); TweenMax.delayedCall(0.3,frame); function frame():void{ nextFrame(); } } }
  2. Hello all, Just recently got TweenLite/Max and am still new to it. So this may be an oversight on my part. I am creating a movie clip and using it as a button. When the button is clicked it creates a box(movie clip), inside the box is a series of bars(each one a movie clip). The box is then tween down in a simple animation. If the button is clicked again, it raises the box. If the button is clicked again it lowers the box. There is a check when the button is clicked to see if the box has already been created. If it has, then it skips that part and either raises or lowers it based on its current state. The button creates fine, it will create the box and bars, and lower it all just fine. But when i click the button again, to raise the box, i get: TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.greensock::TweenLite/render() at com.greensock.core::SimpleTimeline/render() at com.greensock.core::Animation$/_updateRoot() It will continuously create this error as if it stuck in a loop. I ran the debugger and got: Error: Cannot tween a null object. Duration: 1, data: undefined at com.greensock::TweenLite()[C:\...\com\greensock\TweenLite.as:448] at com.greensock::TweenLite$/to()[C:\...\com\greensock\TweenLite.as:910] at TrainingModulev2_fla::MainTimeline/Index_Drop()[TrainingModulev2_fla.MainTimeline::frame1:146] Frame1:146 is the 4th from last line in my code below.( TweenLite.to(IndexBox, 1, {delay:0, y:58}); ) My code: function Index_Button() { var IndexButton:MC_IndexButton = new MC_IndexButton ; addChild(IndexButton); IndexButton.x = -50; IndexButton.y = 110; IndexButton.alpha = 0; TweenLite.to(IndexButton, 1, {x:1, alpha:1}); IndexButton.addEventListener(MouseEvent.CLICK, Index_Drop); } function Index_Drop(e:MouseEvent) { if (IndexDown==true) { TweenLite.to(IndexBox, 1, {y:"-58"}); IndexDown = false; } else if (IndexCreated == false) { var IndexBox:MC_IndexBox = new MC_IndexBox ; addChild(IndexBox); IndexBox.x = 0; IndexBox.y = -184.5; var IndexBarArray:Array = []; for (i=1; i<8; i++) { IndexBarArray[i] = new MC_IndexBar ; IndexBarArray[i].name = "IndexBar" + i; IndexBox.addChild(IndexBarArray[i]); IndexBarArray[i].x = 14; IndexBarArray[i].y = i * 27 + 72; IndexBarArray[i].addEventListener(MouseEvent.MOUSE_OVER, IndexBar_Over); IndexBarArray[i].addEventListener(MouseEvent.MOUSE_OUT, IndexBar_Out); } setChildIndex(IndexBox, 2); IndexCreated = true; TweenLite.to(IndexBox, 1, {delay:0, y:58}); } else { TweenLite.to(IndexBox, 1, {delay:0, y:58}); IndexDown = true; } } I cant figure out what im doin wrong. From what i am understanding, That line isnt ran until after IndexBox is created. I know its there, I've targeted it a few times in the code. I can see it when i run a test. thanks
  3. Hi, I have often stumbled on errors pointing to Greensock classes, on a certain misterious line that has appearantly nothing to do with the real problem, usually a missing/null object or an unknown property. Is there a way to handle errors (try-catch) caused by tweens? I'd like to know about a missing object before crashing into a GSAP class.