Jump to content
Search Community

mularam

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by mularam

  1. awesome advice - thank you very much i'd actually stumbled upon the transparent rectangle accidentally just after posting this - i wanted to tween the red gel out once i selected 'close ad' and all of a sudden everything worked as i wanted - but thank you for confirming that this was actually a viable solution www.thejobgame.eu/ENG/JS_01.html As for the other suggestions - again, thanks alot...i was wondering why there wasn't much difference in the easing properties, now i know why and can make them look much better! I haven't used any mc tween on the timeline, except for the character animation movieclips but will have a look at timeline max for sure As for the array, i really wanted to do it this way - and tried but was stumped by how to call the different parameters for re-sizing the ad buttons, is there any way you can help me with this? if not, no biggie thanks again
  2. Hello there I am having a little trouble invalidating tweens which were created as functions using the transform matrix plugin. This is the code i am using (I am still quite new to flash to please be kind and if anyone has any suggestions as to how to improve it that would be most appreciated!) stop(); import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; OverwriteManager.init(2) TweenPlugin.activate([TransformMatrixPlugin]); job_1.addEventListener(MouseEvent.CLICK, overJ1); job_2.addEventListener(MouseEvent.CLICK, overJ2); job_3.addEventListener(MouseEvent.CLICK, overJ3); job_4.addEventListener(MouseEvent.CLICK, overJ4); job_5.addEventListener(MouseEvent.CLICK, overJ5); job_6.addEventListener(MouseEvent.CLICK, overJ6); function overJ1(event:MouseEvent):void { TweenMax.to(event.target, 0.25, {transformMatrix:{x:-875, y:0, scaleX:2.5, scaleY:2.5, ease:Elastic.easeOut}}); addChildAt(DisplayObject(event.target), numChildren-1); } function overJ2(event:MouseEvent):void { TweenMax.to(event.target, 0.25, {transformMatrix:{x:-875, y:0, scaleX:2.49, scaleY:2.49, ease:Elastic.easeOut}}); addChildAt(DisplayObject(event.target), numChildren-1); } function overJ3(event:MouseEvent):void { TweenMax.to(event.target, 0.25, {transformMatrix:{x:-300, y:50, scaleX:1.98, scaleY:1.98, ease:Elastic.easeOut}}); addChildAt(DisplayObject(event.target), numChildren-1); } function overJ4(event:MouseEvent):void { TweenMax.to(event.target, 0.25, {transformMatrix:{x:-700, y:50, scaleX:1.98, scaleY:1.98, ease:Elastic.easeOut}}); addChildAt(DisplayObject(event.target), numChildren-1); } function overJ5(event:MouseEvent):void { TweenMax.to(event.target, 0.25, {transformMatrix:{x:-930, y:50, scaleX:1.98, scaleY:1.98, ease:Elastic.easeOut}}); addChildAt(DisplayObject(event.target), numChildren-1); } function overJ6(event:MouseEvent):void { TweenMax.to(event.target, 0.25, {transformMatrix:{x:-800, y:0, scaleX:2.49, scaleY:2.49, ease:Elastic.easeOut}}); addChildAt(DisplayObject(event.target), numChildren-1); } btn_close1.addEventListener(MouseEvent.CLICK, outJ1); btn_close2.addEventListener(MouseEvent.CLICK, outJ2); btn_close3.addEventListener(MouseEvent.CLICK, outJ3); btn_close4.addEventListener(MouseEvent.CLICK, outJ4); btn_close5.addEventListener(MouseEvent.CLICK, outJ5); btn_close6.addEventListener(MouseEvent.CLICK, outJ6); function outJ1(event:MouseEvent):void { TweenMax.to(job_1, 0.25, {transformMatrix:{x:-1070.0, y:100, scaleX:1, scaleY:1, ease:Elastic.easeOut}}); gotoAndPlay("close_ad"); } function outJ2(event:MouseEvent):void { TweenMax.to(job_2, 0.25, {transformMatrix:{x:-235, y:100, scaleX:1, scaleY:1, ease:Elastic.easeOut}}); gotoAndPlay("close_ad"); } function outJ3(event:MouseEvent):void { TweenMax.to(job_3, 0.25, {transformMatrix:{x:-200, y:720, scaleX:1, scaleY:1, ease:Elastic.easeOut}}); gotoAndPlay("close_ad"); } function outJ4(event:MouseEvent):void { TweenMax.to(job_4, 0.25, {transformMatrix:{x:-1070, y:720, scaleX:1, scaleY:1, ease:Elastic.easeOut}}); gotoAndPlay("close_ad"); } function outJ5(event:MouseEvent):void { TweenMax.to(job_5, 0.25, {transformMatrix:{x:250, y:720, scaleX:1, scaleY:1, ease:Elastic.easeOut}}); gotoAndPlay("close_ad"); } function outJ6(event:MouseEvent):void { TweenMax.to(job_6, 0.25, {transformMatrix:{x:575, y:100, scaleX:1, scaleY:1, ease:Elastic.easeOut}}); gotoAndPlay("close_ad"); } job_1.addEventListener(MouseEvent.CLICK, buttonClickHandler7); function buttonClickHandler7(event:MouseEvent):void { gotoAndStop("job1"); } job_2.addEventListener(MouseEvent.CLICK, buttonClickHandler8); function buttonClickHandler8(event:MouseEvent):void { gotoAndStop("job2"); } job_3.addEventListener(MouseEvent.CLICK, buttonClickHandler9); function buttonClickHandler9(event:MouseEvent):void { gotoAndStop("job3"); } job_4.addEventListener(MouseEvent.CLICK, buttonClickHandler10); function buttonClickHandler10(event:MouseEvent):void { gotoAndStop("job4"); } job_5.addEventListener(MouseEvent.CLICK, buttonClickHandler11); function buttonClickHandler11(event:MouseEvent):void { gotoAndStop("job5"); } job_6.addEventListener(MouseEvent.CLICK, buttonClickHandler12); function buttonClickHandler12(event:MouseEvent):void { gotoAndStop("job6"); } When buttons Job_1, 2, 3, 4, 5 & 6 are CLICKED the corresponding 'overJ....' function is called where the button gets bigger and the timeline goes to the appropriate frame label. The over function also sets the object to the stop of the stacking order. Once on the frame label selecting the appropriate instance of 'btn_close_...' ('CLOSE AD' IN THE URL) is then clicked which calls the 'outJ....' function which tweens the object back to its original size as well as sending the timeline to the 'close' frame label which then plays to the end of the movieclip and then returns to the start of the timeline resetting the code - All this works fine as you can see at the following URL http://www.thejobgame.eu/ENG/test.html Note: the 'job_...' buttons are the ones that look like classified ads - when selected the 'CLOSE AD' button appears below My problem is that when the over function is called - the other 'Job_....' instances can still be selected and if the user were to accidentally click on them things start to go wrong as you can see. On the "Job..." frame labels I have inserted the following code to try and remove eventListeners for the buttons and kill tweens that are not being used e.g. on label "Job1" i have the following: job_1.removeEventListener(MouseEvent.CLICK, overJ1); trace("job 1 listener is removed"); job_2.removeEventListener(MouseEvent.CLICK, overJ2); trace("job 2 listener is removed"); TweenLite.killTweensOf(job_2); job_3.removeEventListener(MouseEvent.CLICK, overJ3); trace("job 3 listener is removed"); TweenLite.killTweensOf(job_3); job_4.removeEventListener(MouseEvent.CLICK, overJ4); trace("job 4 listener is removed"); TweenLite.killTweensOf(job_4); job_5.removeEventListener(MouseEvent.CLICK, overJ5); trace("job 5 listener is removed"); TweenLite.killTweensOf(job_5); job_6.removeEventListener(MouseEvent.CLICK, overJ6); trace("job 6 listener is removed"); TweenLite.killTweensOf(job_6); The trace statements are called and the tweens for these buttons killed but I am still able to select the other buttons? You can probably tell that i'm still stuck in sequential mode and this is probably not the best way to go about setting up my files so any alternative suggestions would be great Many thanks in advance
  3. PERFECT! THIS TOTALLY ROCKS! You guys deserve a nobel prize
  4. Hi there I am a noob Shockingly Green member who is having a little trouble with the Transform Around Centre + also Transform Around Point plugins. I have applied both to buttons to create very simple tweens but get this message in the output panel: ReferenceError: Error #1069: Property transformAroundCenter not found on flash.display.SimpleButton and there is no default value. at com.greensock::TweenLite/com.greensock:TweenLite::init() at com.greensock::TweenLite/renderTime() at com.greensock.core::SimpleTimeline/renderTime() at com.greensock::TweenLite$/com.greensock:TweenLite::updateAll() I am having no trouble with other plugins such as glowfilter but these are causing problems. My code is as follows: btn_apple.addEventListener(MouseEvent.ROLL_OVER, over2); btn_apple.addEventListener(MouseEvent.ROLL_OUT, out2); btn_blueberry.addEventListener(MouseEvent.ROLL_OVER, over2); btn_blueberry.addEventListener(MouseEvent.ROLL_OUT, out2); btn_cherry.addEventListener(MouseEvent.ROLL_OVER, over2); btn_cherry.addEventListener(MouseEvent.ROLL_OUT, out2); btn_lemon.addEventListener(MouseEvent.ROLL_OVER, over2); btn_lemon.addEventListener(MouseEvent.ROLL_OUT, out2); function over2(event:MouseEvent):void { TweenLite.to(event.target, 0.25, {transformAroundCenter:{scaleX:2, scaleY:2}, ease:Elastic.easeOut}); } function out2(event:MouseEvent):void { TweenLite.to(event.target, 0.25, {transformAroundCenter:{scaleX:1, scaleY:1}, ease:Elastic.easeOut}); } Awesome product btw Jack - I've been looking for something to drag me off that timeline for a while now and this is simply beautiful!
×
×
  • Create New...