Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 25th, 2012  |  syntax: None  |  size: 2.33 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. as3 - TypeError: Error #1009: Cannot access a property or method of a null object reference
  2. import com.greensock.TweenLite;
  3. import com.greensock.easing.Back;
  4. import com.greensock.easing.Elastic;
  5. import com.greensock.plugins.TweenPlugin;
  6. import com.greensock.plugins.BlurFilterPlugin;
  7.  
  8. var panelContainer:Sprite = new Sprite;
  9. addChild(panelContainer);
  10.  
  11. for(var i:Number=0;i<3; i++) {
  12.  
  13.     var projectPanel:ProjectPanel = new ProjectPanel;
  14.     projectPanel.x = i*(projectPanel.width+10);
  15.     panelContainer.addChild(projectPanel);
  16.  
  17.     projectPanel.addEventListener(MouseEvent.CLICK, onClick);
  18.  
  19. }
  20.  
  21. function onClick(evt:MouseEvent):void {
  22.  
  23.     TweenLite.to(panelContainer, 0.5, {y:stage.stageHeight, ease:Back.easeIn});
  24.     MovieClip(this.parent).addFullPanel(Number(evt.currentTarget.name));
  25.  
  26. }
  27.  
  28. function slideUp():void {
  29.  
  30.     TweenLite.to(panelContainer, 0.5, {y:0, ease:Back.easeOut});
  31.  
  32. }
  33.  
  34. stage.addEventListener(MouseEvent.MOUSE_MOVE, onMove);
  35.  
  36. function onMove(evt:MouseEvent):void {
  37.  
  38.     if(MovieClip(this.parent).fullProjectPanelUp==false){
  39.     TweenLite.to(panelContainer,0.3, {x:-        (stage.mouseX/1225)*panelContainer.width+stage.stageWidth/2.65});
  40.     }
  41.  
  42. }
  43.  
  44. stop();
  45.        
  46. import com.greensock.TweenLite;
  47. import com.greensock.easing.Back;
  48. import com.greensock.easing.Elastic;
  49. import com.greensock.plugins.TweenPlugin;
  50. import com.greensock.plugins.BlurFilterPlugin;
  51.  
  52. var lessonContainer:Sprite = new Sprite;
  53. addChild(lessonContainer);
  54.  
  55. for(var p:Number=0;p<8; p++) {
  56.  
  57.     var lessonPanel:LessonPanel = new LessonPanel;
  58.     lessonPanel.x = p*(lessonPanel.width+10);
  59.     lessonContainer.addChild(lessonPanel);
  60.  
  61.     lessonPanel.addEventListener(MouseEvent.CLICK, onClick);
  62.  
  63. }
  64.  
  65. function onClickLesson(evt:MouseEvent):void {
  66.  
  67.     TweenLite.to(lessonContainer, 0.5, {y:stage.stageHeight, ease:Back.easeIn});
  68.     MovieClip(this.parent).addfullLessonPanel(Number(evt.currentTarget.name));
  69.  
  70. }
  71.  
  72. function slideLessonUp():void {
  73.  
  74.     TweenLite.to(lessonContainer, 0.5, {y:0, ease:Back.easeOut});
  75.  
  76. }
  77.  
  78. stage.addEventListener(MouseEvent.MOUSE_MOVE, onMove);
  79.  
  80. function onLessonMove(evt:MouseEvent):void {
  81.  
  82.     if(MovieClip(this.parent).fullLessonPanelUp==false){
  83.     TweenLite.to(lessonContainer,0.3, {x:-(stage.mouseX/1225)*lessonContainer.width+stage.stageWidth/2.65});
  84.     }
  85.  
  86. }
  87.  
  88. stop();
  89.        
  90. import com.greensock.plugins.*;
  91. TweenPlugin.activate([FrameLabelPlugin, ColorTransformPlugin]);