Jump to content
Search Community

Carl last won the day on December 24 2023

Carl had the most liked content!

Carl

Moderators
  • Posts

    9,824
  • Joined

  • Last visited

  • Days Won

    546

Everything posted by Carl

  1. before getting into the wheels within wheels bit, it seems you are either: not targeting your MyButton properly or MyClip, this is one of those times that the AS3 compile errors would really help you out. if MyButton or MyClip are in other clips, make sure you have the proper path like wheel_mc.MyClip you could try adding a few traces where your existing code is: trace(MyClip) trace(MyButton) to see if those objects are in the same scope as your other code.
  2. yes, that is a tricky scenario and a bit much to troubleshoot. I don't believe TweenMax has anything to handle that natively. You should research the AS3 methods globalToLocal and LocalToGlobal which were designed to handle these situations of converting coordinates. here's a start: http://livedocs.adobe.com/flash/9.0/Act ... alToLocal()
  3. your function just needs a little love. function shifter(e:MouseEvent):void{ TweenMax.to(Myclip, 1, {rotation:120, ease:Cubic.easeIn}); }
  4. if you do not have access to the TransformAroundPoint plugin, the easiest thing to do is edit the symbol in the IDE and shift your artwork so that the registration point is in the bottom left hand corner:
  5. Hi HankTurbo, Sorry to hear you are having problems. I've used LoaderMax to load videos a few times with auditSize off and on and haven't encountered this problem. Just for more info: is the audit load throwing a runtime error? is there an onFail, onError or some other event that you have specified being triggered that shouldn't? The audit load as you probably know only loads a tiny bit of the file and then cancels itself. (this should not trigger any error events) Just curious to see the exact error you are getting which specifies the exact url it is trying to fetch the video from. Also if you could show how you are supplying your path to VideoLoader might help as well. If you can't supply simplified files (that possibly just load one video) that demonstrate this problem, it would be helpful to see your loader code and the errors. the audit should definitely be trying to load from the same location as the "real" load. As an interim test, have you tried setting the base attribute in your object/embed code as referenced in the docs at: http://kb2.adobe.com/cps/041/tn_04157.html
  6. did you change the instance names of your symbols in scene 2? what errors did you get?
  7. you can't have the same function twice in the same movie. thus the "duplicate" error. if you need to use scenes, just make your instance names and functions unique: import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; var buttons2:Array = [art2, gall2];for (var i:int = 0; i buttons2[i].addEventListener(MouseEvent.ROLL_OVER, over2); buttons2[i].addEventListener(MouseEvent.ROLL_OUT, out2); } function over2(e:MouseEvent):void { TweenMax.to(e.target, 0.3, {tint:0xE91F3E}); } function out2(e:MouseEvent):void { TweenMax.to(e.target, 0.3, {tint:null}); } notice i put a 2 after every object name. this is one of the reasons scenes aren't used that much any more.
  8. yeah that sounds pretty good. you could also use Physics2D (see example in plugin explorer) to apply a velocity and angle to each item. This will save you from calculating an end value. perhaps you can just give them enough velocity to move "far enough".
  9. thanks for the clarity on onUpdate. I was going to suggest having a function that re-creates the entire timeline, but was hoping too that there was a simpler way:)
  10. interesting issue you have there. I tried to test this scenario and came up with the following results: If the tween you are updating is the last tween in the TimelineMax, then the ease gets changed and the tween plays backwards fine. If the tween you are updating is NOT the last tween int the TimelineMax the tween does not appear to work as it seems that other starting and end values are ignored. Here is my test code (CS4 Fla attached) import com.greensock.*; import com.greensock.easing.*; var tl:TimelineMax = new TimelineMax({paused:true, repeat:1, yoyo:true, onRepeat:changeEase}); tl.append(TweenMax.to(mc, 1, {x:300})); tl.append(TweenMax.to(mc, 1, {y:300, ease:Bounce.easeOut})); //if the following tween is added. it appears the update will not work and the 2nd tween will not reverse //no visible change in y value //tl.append(TweenMax.to(mc, 1, {alpha:0})); stage.addEventListener(MouseEvent.CLICK, test) function test(e:Event):void{ tl.play(); } function changeEase(){ //reference the second tween in the timeline var myTween:TweenMax = tl.getChildren()[1] myTween.updateTo({ease:Linear.easeNone}); } this timeline moves the mc to the right, then down, then fade out. if the fade out (third tween) is removed I am able to remove the bouce on the 2nd tween (move down). Perhaps this additional information will help someone else quickly diagnose or explain this behavior. In the meantime I will see what I can come up with. Carl
  11. here is just another example of a bunch of stuff tweening: http://www.snorkl.tv/2011/04/fun-and-qu ... ster-bomb/ this example usese timelinemax so that the animation can be easily paused and reversed. ------ keep in mind allTo tweens many things TO the same place. since all your objects are starting in the center and going somewhere else... you may be more interested in allFrom. you could manage your effect with a single allFrom assuming all the items are on the stage where you want them to end. c
  12. in my tests no. and from the documentation: transformMatrix tween will affect all of the DisplayObject's transform properties, so do not use it in conjunction with regular x/y/scaleX/scaleY/rotation tweens concurrently. bezier wants to alter x/y values that I assume are being overwritten by transform matrix.
  13. can you please elaborate on what spinner you are referring to and where the bgColor parameter is?
  14. There are 2 things you can do: 1: declare a defaultEase which all tweens will use unless otherwise specified TweenLite.defaultEase = Quad.easeInOut; TweenLite.to(mc, 1, {x:100}); //will use Quad.easeInOut; 2: declare a variable the refers to the easing function you want to use var myEase:Function = Quad.easeInOut; TweenLite.to(mc, 1, {x:100, ease:myEase}); // will use Quad.easeInOut If there are multiple properties that are going to be common to multiple tweens you can assign a generic vars object that can be re-used var myVars:Object = new Object(); myVars.x = 100; myVars.y = 200; myVars.alpha = .5; TweenLite.to(mc, 1, myVars); TweenLite.to(mc2, 1, myVars);
  15. Hi Dave, I think your last tween: TweenLite(downloadButton, 1, {glowFilter:{color:0xffffff, alpha:0, blurX:30, blurY:30}}) is possibly to blame. this makes the glow invisible .1 seconds after the glow starts to come in. remove that tween and let me know if you see the glow
  16. if you load a swf like this: loader=new SWFLoader("ladybug_finished.swf",{container:holder,x:0,y:0,alpha:0,name:"swf1",onComplete:completeHandler}); you can then do: function completeHandler(e:LoaderEvent):void { trace(e.target.content.parent.name); //traces holder trace(e.target.vars.container.name); //traces holder TweenLite.to(e.target.content, 1, {alpha:1}); } *if you don't want the name, and just the object... remove .name
  17. it seems that all the motion is driven through your posX/Y and bezierX/Y arrays. i really don't know where you would begin to alter those values in a way that proportionally adjusts them that makes sense. I don't think that global center registration point exists
  18. what you want is totally possible. you should read up on the insert() and append() methods using insert() you can specify exactly what time the tween should start. timeline.insert(TweenLite.to(mc, 1, {x:10}) timeline.insert(TweenLite.to(mc, 1, {y:10}, .2) in the above code the y tween would start .2 seconds after the x tween begins. using append() the default behavior is linear (one tween then the next and then next...) but there is also an offset value which can be positive or negative http://www.greensock.com/as/docs/tween/ ... ml#append() timeline.append(TweenLite.to(mc, 1, {x:10}) timeline.append(TweenLite.to(mc, 1, {y:10}, -.2) in the above example the y tween would begin .2 seconds before the x tween ends using insertMultiple or appendMultiple is like the above soaked in gasoline. EXPLOSIVE!
  19. for the timeline scrubber watch: x10's video (source files in description) as for using the same scruber to control an flv... you really can't scrub flv's all that well but you can't use your scrubber value to drive the playhead to the proper point in time. if using the flvPlayback component you could adjust: http://livedocs.adobe.com/flash/9.0/Act ... Percentage
  20. Jamie, again, has a great approach which is quite elegant. Here is a slightly more simplistic approach, perhaps more beginner-friendly Demo: http://snorkl.tv/dev/crossFade/crossFade.html CS4 Fla http://snorkl.tv/dev/crossFade/crossFade.fla import com.greensock.*; black_btn.addEventListener(MouseEvent.CLICK, crossFade); blue_btn.addEventListener(MouseEvent.CLICK, crossFade); red_btn.addEventListener(MouseEvent.CLICK, crossFade); green_btn.addEventListener(MouseEvent.CLICK, crossFade); //tell each button which movie clip to control black_btn.mc = black; blue_btn.mc = blue; red_btn.mc = red; green_btn.mc = green; //start with all clips except black hidden blue.alpha = 0; red.alpha = 0; green.alpha = 0; //this variable stores a reference to the currently visible clip var currentClip:MovieClip = black; function crossFade(e:MouseEvent):void{ //make sure the currentClip isn't related to the button you just clicked if(currentClip != e.target.mc){ //hide the current clip TweenLite.to(currentClip, 1, {alpha:0}); //show the clip related to the btn you just pressed TweenLite.to(e.target.mc, 1, {alpha:1}); } //reset currentClip to reflect the clip related to the button you just clicked currentClip = e.target.mc; } I think you just gave me an idea for a new tutorial:)
  21. you're welcome. glad it worked out fir you.
  22. very cool results. I appreciate the magnitude of what you accomplished. Perhaps someone else will be able to answer you question about the low level render method, my gut thinks currentTime is probably the closest you will get.
  23. that sounds like a pretty clever approach. synchronizing sound and animation is know to be "virtually impossible" in flash unless the sound is embedded in the swf and set to "stream". chances are your stream is advancing in great intervals between ENTER_FRAME events so the TImelineLite is jumping ahead to catch up. Maybe use a Timer with very low interval like 50ms? would be interested to hear if this works
  24. ok, now I understand. going back to your original code, look at this: http://www.snorkl.tv/dev/assignVarsToButtons/ here is the fla: http://www.snorkl.tv/dev/assignVarsToBu ... uttons.fla CS4 (save into folder with greensock files) the code looks like this: import com.greensock.*; var clipArray:Array = [menuPintu.m1, menuPintu.m2, menuPintu.m3, menuPintu.m4, menuPintu.m5]; for(var i:int = 0; i clipArray[i].buttonMode = true; clipArray[i].addEventListener(MouseEvent.ROLL_OVER, item_onOver); clipArray[i].addEventListener(MouseEvent.ROLL_OUT, item_onOut); clipArray[i].myValue = i+1 } function item_onOver(event:MouseEvent):void { TweenMax.to(event.currentTarget, .5, {tint:0x66CC00}); output_txt.text = event.currentTarget.myValue; trace(event.currentTarget.myValue); } function item_onOut(event:MouseEvent):void { TweenMax.to(event.currentTarget, .5, {tint:null}); }
  25. yeah. just assign each button the variable that you need. Check out my map tutorial it uses the same concept to display the names of each item that you roll over. http://www.snorkl.tv/2010/11/part-1-bui ... /#more-381 import com.greensock.*; description.storeName_txt.text = ""; description.phone_txt.text = ""; map_mc.buttonMode=true; map_mc.addEventListener(MouseEvent.MOUSE_OVER, mapOver); map_mc.addEventListener(MouseEvent.MOUSE_OUT, mapOut); map_mc.spatulaCity.storeName = "Spatula City"; map_mc.spatulaCity.phone = "917-897-0987"; map_mc.justInCaseCases.storeName = "Just In Case Cases"; map_mc.justInCaseCases.phone = "917-897-3227"; map_mc.chandlersChandeliers.storeName = "Chandler’s Chandeliers"; map_mc.chandlersChandeliers.phone = "917-897-8376"; map_mc.gunsPlus.storeName = "Guns Plus"; map_mc.gunsPlus.phone = "917-435-2345"; map_mc.potsNPans.storeName = "Pots N Pans"; map_mc.potsNPans.phone = "917-954-6547"; map_mc.campOut.storeName = "Camp Out!"; map_mc.campOut.phone = "917-934-9047"; function mapOver(e:MouseEvent):void{ var mapItem:MovieClip = e.target as MovieClip; description.storeName_txt.text = mapItem.storeName; description.phone_txt.text = mapItem.phone; description.gotoAndStop(mapItem.name); TweenMax.to(mapItem, .5, {tint:0xFF9900}); TweenMax.fromTo(description, .5, {alpha:0, x:50, blurFilter:{blurX:80}}, {alpha:1, x:10, blurFilter:{blurX:0}}); } function mapOut(e:MouseEvent):void{ var mapItem:MovieClip = e.target as MovieClip; TweenMax.to(mapItem, .5, {tint:0x990000}); }
×
×
  • Create New...