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. Hi welcome to the world of GreenSock. A few things: Most importantly, TweenLite/Max can tween to negative values just fine. Just try: TweenMax.to( karta, 1, {x:-500}) also, if the registration point of your object is the top left corner, the object will scale to the right and down and the position of the registration point will not change. if the registration point of your object is in the center, then you will get a symmetrical scale from center. I wasn't able to digest your code fully, but if you only want to zoom in and out from center, the easiest thing would be set the registration point to the center. if you want to symmetrically scale from any point on your map (mouse location) can require tricky calculations. If you are interested, a Really Green membership gives you access to the transformAroundPoint plugin. http://www.greensock.com/club/ --- in short, TweenMax will do as its told. Please verify that you are providing it with the proper values. right before the TweenMax code add: trace(newX) trace(newY) are you getting the values you suspect?
  2. Hi Caglar, That is a very impressive and ambitious project you are working on. I'm still not clear if your timelines are not reversing or if the erase mechanism isn't working. Looking at the animation for the first time it is kind of difficult to figure out exactly what is happening. The other forum post you referenced seemed to address the issue of targeting individual tweens inside of timelines and trying to reverse them independent of their parent timelines (which is sort of a bizarre scenario). If you can provide an example of nested tweens/timelines not reversing when the parent is reversed I know that I and GreenSock would love to help you figure out what is happening. As for the erasing, the code I provided is highly experimental and wasn't ever intended for something of this scale. Keep in mind that every time each timeline updates a new super small graphic object is added to your stage. I imagine you could have 10s of thousands of these things eating away at available memory. I'm really not cut out to troubleshoot how all those functions and loops are operating within the context of your application. I have created many timelines with hundreds of nested tweens and haven't ever experienced any trouble reversing at any time. If you can narrow down the issue to something related to the core of the tweening platform it will really help. Carl
  3. to play and pause you just need to target the rawContent of the SWFLoader here is a basic example: import com.greensock.* import com.greensock.events.LoaderEvent; import com.greensock.loading.SWFLoader; import flash.events.MouseEvent; //hide buttons until swf has loaded play_btn.visible = false; pause_btn.visible = false; var loadedSWF:SWFLoader = new SWFLoader("part1.swf", {container:this, onComplete:setupButtons}); loadedSWF.load(); function playSWF(e:MouseEvent):void{ loadedSWF.rawContent.play(); } function pauseSWF(e:MouseEvent):void{ loadedSWF.rawContent.stop(); } function setupButtons(e:LoaderEvent){ play_btn.visible = true; pause_btn.visible = true; play_btn.addEventListener(MouseEvent.CLICK, playSWF); pause_btn.addEventListener(MouseEvent.CLICK, pauseSWF); } programming a seekbar is quite involved. perhaps you can find some tutorials on building a seekbar for a movie clip that is on the stage and then apply those concepts to controlling the rawContent of your swf. Unfortunately we do not have the time to provide extensive custom code solutions. attached are files for that contain the code above.
  4. the problem was that you were immediately changing the y value of the clip that holds all the text and then you had a bunch of tweens that all had delays on them start running so there was a brief moment where the text block would move up and then it would animate character by character. the solution is to start all the tweens with no delay and then slide the block of text up. try this: function runText():void { //don't shift the text until after the tweens have begun TweenLite.delayedCall(.1, shiftText); for (var i:int = segovia_stf.textFields.length - 1; i > -1; i--) { //remove the delay property from this tween TweenMax.to(segovia_stf.textFields[i], 1, {blurFilter:{blurX:10, blurY:10}, x:Math.random() * 650 - 100, y:Math.random() * 350 - 100, scaleX:Math.random() * 4 - 2, scaleY:Math.random() * 4 - 2, rotation:Math.random() * 360 - 180, autoAlpha:0, ease:Quad.easeIn, repeat:1, yoyo:true, repeatDelay:0.2}); } } function shiftText() { segovia_mc.y -= 110; if (segovia_mc.y segovia_mc.y = 0; } }
  5. once your _completeHandler fires, changing the xy of mediaContainer will have no effect on the position of the loaded swf as it will have been placed onto the stage. use either the container property to add your swf to the mediaContainer automatically OR use the _completeHandler to do it.
  6. You just need to set your container property to be a Sprite or MovieClip which themselves are types of DisplayObjectContainers. //option 1 //in the Flash IDE create a movie clip symbol on the stage with the instance name of swfHolder //OR //option2 //programmatically create a Sprite with code and add it to the stage var swfHolder:Sprite = new Sprite(); addChild(swfHolder); var swf:SWFLoader = new SWFLoader("someSwf.swf", {container:swfHolder}) swf.load();
  7. its really a matter of personal preference mixed with some concern for what you expect your target audience to be. If you are promoting high-end work to high-end clientele i'd say go with what looks best. I use 60 in a lot of my tutorials as I love how smooth it looks. In a lot of the Starling / Stage3D and even javascript demos the developers are aiming for 60. When flash first came out it was recommended to use 12. We have come a long way. Still, when doing professional banner work, 18-24fps is still the norm (which is a real challenge to work with). If possible I would suggest testing on a mid-range laptop to see how it runs and if the fans go into overdrive. depending on the complexity of your site/animation you can also use "frame rate throttling" to set the frame rate really low when animation isn't taking place. perhaps you can compromise with 40.
  8. can you please post an example (fla CS5 or less zipped) of nested timelines not reversing when the parent/root timeline reverses? it doesn't need to have any of draw/erase code in it. the simpler the better. if we can replicate this base issue, it will be much easier to figure out what is going wrong. thanks
  9. Hi and Welcome, ThrowProps handles the creation of a smooth tween based on a velocity. Its up to you tell ThrowProps how fast it should start and what sort of range the tween should end in. ThrowProps doesn't doesn't have anything built in to detect mouse or flick velocity. Fortunately, the interactive example on http://www.greensock.com/throwprops/ is set up to do almost exactly what you need. You can literally copy and paste the code (provided in the interactive demo) into a new Fla/project and it will work. I would suggest starting with that code and then add the symbols you want to use and adjust the min, max parameters. Also the in the ASDocs http://www.greensock.com/as/docs/tween/ ... lugin.html there is a similar example that doesn't use BlitMask if that suits your needs better. Once you get going with your code, feel free to post back with any specific trouble you are having.
  10. hi mrEmpty. thank you for taking the initiative to help learner7n. another way to do this would be like this: TweenMax.fromTo(box, 1, {y:400}, {y:100, repeat:-1, ease:Linear.easeNone}); it seems in his original code he was using yoyo:true which he didn't want.
  11. yes that is all possible. In order for you to accomplish that there are quite a few things you will need to be comfortable with. read everything you can about LoaderMax on the GreenSock site: http://www.greensock.com/loadermax/ http://www.greensock.com/loadermax-tips/ see how you can load a few images without xml and track their progress: http://www.snorkl.tv/2011/08/loading-im ... le-images/ read the XMLLoader documentation: http://www.greensock.com/as/docs/tween/ ... oader.html practice loading xml, loading assets, displaying assets, and responding to events that happen during the loading process: http://www.snorkl.tv/2011/08/loading-im ... xmlloader/ then read about the properties and methods specific to the SWFLoader: http://www.greensock.com/as/docs/tween/ ... oader.html -unload(); -rawContent -content Once you are comfortable loading xml and images you should have no problem converting over to loading swfs.
  12. consider the following: var someContainer:MovieClip = new MovieClip(); addChild(someContainer); for (var i:int = 0; i var b:Box = new Box(); b.name = "b" + i; b.x = i*60; someContainer.addChild(; } //the next line will cause an error //someContainer["b1"].y = 100; //the next line will work fine someContainer.getChildByName("b1").y = 100; so in your example you could do: TweenLite.to(_easel.alphabetContainer.getChildByName("easelItemClip"+ i), .5, {transformAroundCenter:{scaleX:1, scaleY:1}});
  13. I think your master should be should have boxes in it before you create a BlitMask for it. in the first example I didn't see that master was on the display list. i didn't see addChild(master). so even though you do master.addChild(somebox); if master isn't added to the display list... you won't see any boxes.
  14. hi mr empty, I'm glad you are enjoying my tutorials. I don't know which code you are referring to when you say I have quite a few tutorials on this sort of thing: http://active.tutsplus.com/series/timel ... ter-guide/ but i don't recall doing anything with pausing a timeline when it is reversed. the reason your initial pauses don't work in reverse is because the onComplete callbacks on individual tweens don't fire when they are nested in a timeline that is reversed. and I'm guessing the reason the timeline restarted is because the timeline had an onComplete that fired after the onComplete in the last tween in the timeline. attached is one way to approach forward and reverse with a pause. here is the code: import com.greensock.*; var tl:TimelineMax = new TimelineMax(); tl.append(TweenLite.to(mc1, 1, {x:400}) ); tl.addCallback(pauseTl, tl.duration); tl.append(TweenLite.to(mc2, 1, {x:400}) ); tl.addCallback(pauseTl, tl.duration); tl.append(TweenLite.to(mc3, 1, {x:400}) ); tl.addCallback(pauseTl, tl.duration); function pauseTl(){ tl.pause(); trace("paused"); } fwd.addEventListener(MouseEvent.CLICK, fwdHandler); rvr.addEventListener(MouseEvent.CLICK, rvrHandler); function fwdHandler(e:MouseEvent):void{ tl.play(); } function rvrHandler(e:MouseEvent):void{ //jump over the previous pause callback tl.currentTime -= .05 //if the previously line is omitted then the first reverse click will trigger a pause, and then the next click will reverse. tl.reverse(); }
  15. it appears your file is just so big that it is choking the Flash Player used for previews in the Flash IDE. I tested with a small file, no problem. I tested with an 8mb file and saw the lock up. the good news is that if you open Test1.swf in the standalone flash player or preview in a web browser there is no lockup. don't trust the Flash Pro "test - movie" preview as it performs much worse than the other players/plugins.
  16. hi bassta, loading as2 swfs into as3 swfs is generally problematic. there is nothing built in to LoaderMax to facilitate the duplication of loaded swfs. furthermore, although I have seen some solutions for making copies of loaded assets similar to how duplicateMovieClip would have worked in AS2, your best bet is just to reload the external swf for each instance that you need. This should not effect load time as the swf should be cached. If you want to pursue copying loaded swfs, I would suggest only using AS3 swfs and once that is working then try AS2. Would be interested to hearing about your results. -carl
  17. thanks for converting the file and commenting your progression so well. the code that you had looked good and like you were implementing my suggestions correctly. Are you ABSOLUTELY certain that title_mask2.swf is an AS3 swf? I opened your file, tested, and got errors about the Loader thing. I created my own swf called carl.swf and changed the code to load carl.swf instead of title_mask2.swf. it worked fine. ? see the attached.
  18. i don't see what problems the code you posted would cause but if you start adding tweens that are longer than the one with onComplete or are delayed, then yes the onComplete will fire before they are all done. TimelineLite is the best solution for responding to a group of tweens that have finished.
  19. hmm, if it works with smaller files, that makes me think the bigger files are in fact the issue. Why don't you do a test and cut the 12mb file down to 3mb? if the problem still persists you can upload your files (trim out all code related to the xml) to a service like http://www.ge.tt/ and I will take a look at them. If I can't replicate the problem (using my own small files) I am not going to be able to find a solution. thanks
  20. It appears the greensock folder you are using does not contain the MotionBlurPlugin. MotionBlurPlugin is provided with your Club GreenSock Membership. http://www.greensock.com/club/ You need to be Really Green or higher. If you are a member and are still experiencing difficulties, just let us know. Carl
  21. can't open your file. please save it down to CS4. the whole point of using LoaderMax and SWFLoader is so that you don't have to use: var title_loader:Loader = new Loader(); var SWFtitle:URLRequest = new URLRequest("title_mask.swf"); var swf_title:MovieClip = new MovieClip(); title_loader.load(SWFtitle); swf_title.addChild(title_loader); title_show.addChild(swf_title); no. my code is waiting for the swf to load, placing it on the stage and telling it to play. your code is not waiting for the swf to load, nor is it telling it to play. yes, that is the name of the swf I am loading.
  22. it's probably because you are not giving your tween any time to run and it is constantly being overwritten: function moveCircle(){ for (var i = 0; i var curX = circleArray[i].x; var curY = circleArray[i].y; var moveX = randomRange(curX-moveRange,curX+moveRange); var moveY = randomRange(curY-moveRange,curY+moveRange); TweenMax.to(circleArray[i],.5, { x: moveX, y: moveY, onUpdate:drawLine }); } } on update of the TweenMax, you call drawLine() which instantly calls moveCircle() which instantly creates a new TweenMax. oh and that TweenMax is also in a loop so it has happening twice AND two tweens are calling the same onUpdate process which does everything I mentioned above. put this line of code somewhere else and make sure both circles' tweens aren't calling onUpdate. TweenMax.to(circleArray[i],.5, { x: moveX, y: moveY, onUpdate:drawLine }); any better?
  23. this issue seems to be getting a bit confused. I mentioned telling the rawContent of the SWFLoader to play: LoaderMax.getLoader("title_mask").rawContent.play(); and now you are telling title_show to play: title_show.play(); from looking at your code, I don't see any previous reference to title_show Also, are you waiting for the swf to be fully loaded before telling it to play? please look at the attached example files. the code looks like this: import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.ContentDisplay; var queue:LoaderMax = new LoaderMax({name:"main"}); queue.append( new SWFLoader("loadSingleSwf_child.swf", {onComplete:childComplete, autoPlay:false})); queue.load() function childComplete( e:LoaderEvent ):void{ trace("child swf is loaded"); //you can access the content and raw content through the LoaderEvent trace("the loader is " + e.target); trace("the content is " + e.target.content); trace("the actual swf is " + e.target.rawContent); trace("\n or you can access the content through LoaderMax.getLoader().content " + LoaderMax.getLoader("loadSingleSwf_child.swf").content); trace("\n or you can access the content through LoaderMax.getContent() " + LoaderMax.getContent("loadSingleSwf_child.swf")); trace("\n and you can access the swf through LoaderMax.getLoader().rawContent) " + LoaderMax.getLoader("loadSingleSwf_child.swf").rawContent); var LoaderContent:ContentDisplay = LoaderMax.getContent("loadSingleSwf_child.swf"); LoaderContent.x = 50; LoaderContent.y = 120; //to see the SWFLoaders content (ContentDisplay object that holds the swf) addChild(LoaderContent); //to have the swf play LoaderMax.getLoader("loadSingleSwf_child.swf").rawContent.play(); }
  24. yeah, you probably don't want to be using a Loader object when you already have everything handled with LoaderMax and SWFLoaders. to target and play a swf that was loaded by a SWFLoader you can do: LoaderMax.getLoader("title_mask").rawContent.play(); and to place it on the stage: addChild( LoaderMax.getContent("title_mask") );
  25. i'm suspecting it could have something to do with your 12mb file. I am getting lost with why you are loading an xml file and then seem to hardcode the urls of the swfs into your script. It would be a tremendous help if you were to upload your files. please replace the 1mb and 12mb files with very very small and light-weight swfs. we would love to help you figure out the issues.
×
×
  • Create New...