Jump to content
Search Community

gigbig

Members
  • Posts

    62
  • Joined

  • Last visited

Everything posted by gigbig

  1. But do you think it is an unexpected behaviour? Or do you think it shouldn't be used that way? I thought BlitMask could work with straight rectangles only, but this result tells the opposite. the code is this: private var blitMaskWall : BlitMask; private var wallBM : Bitmap; wallBM = new Bitmap(new PatternWall(), "auto", false); blitMaskWall = new BlitMask( wallBM, wallBM.x, wallBM.y, wallBM.width*3, wallBM.height, false, true, 0x00000000, true); blitMaskWall.wrapOffsetY = 1; //to avoid the wrap glitch with rotation container.addChild(wallBM); TweenLite.to(container, 10, {rotation: 60, onUpdate:***} ); ...onUpdate: wallBM.x -= wallShift; I didn't expect the blitmask rotated with the target, but it does.
  2. Well, the solution I adopted seems to work great: - I instantiated a piece of the wall to scroll - I instantiated a blitmask with the wall as target, and enabled the wrap and autoupdate properties - I added the target to a container displayObject - I tweened the container to rotate - I tweened the wall (the blitmask target) to scroll horizontally The result is that the wall AND the blitmask rotate with the container. Is this an unexpected result? Well, I thought it was not possible, but I tried and it worked... and it looks pretty smooth too. What do you think Carl?
  3. Hi, I am trying to create a smooth scroll effect: I have a wall that moves horizontally, and I am using 3 pieces with the old-school method. While shifting the wall rotates from x to y degrees. The result is ok, but I want to maximize performances: can I use BlitMask to create a shifting+rotating wall? Is it correct to create the BlitMask for an item, add the item to a DisplayObject, and rotate the DisplayObject? It seems to work ok, even if there is a minor glitch on the top side of the wall, showing the lowest pixels of the wall BMP and certain angles of the rotation (fixable with wrapOffsetY I suppose). Thanks
  4. Ok, I wasn't stopping the tween, I missed this detail The TimeLineMax version is great too, as I can completely exclude TweenLite and ignore the duration of the resulting tween. Thank you Carl and Jamie!
  5. Hi, I have created a tween to move an object from a point A to a point B with bezier trajectory: I have to dynamically calculate the starting and ending points, that will be percentages of the whole animation. How can I tell the tween to run from i.e. 23% to 78% of the whole animation (obviously in 78-23% of the total time)? I think I have to use progress property, but maybe I am doing something wrong, because it looks like the animation runs from 23 to 78% and then to 100%. I am doing like this: var timeLine: TimelineLite = new TimelineLite(); timeLine.fromTo(item, totalTime, { x: 0, y: 0 }, { bezier: { type:"thruBasic", values: [ { x: 300, y: 200 }, { x: 500, y: 800 } ] }, ease: Linear.easeNone } ); TweenLite.fromTo(timeLine, totalTime* (0.8 - 0.5), {progress: 0.5 }, {progress: 0.8, ease: Sine.easeOut } ); I have to learn a lot about timelines...
  6. Yeah, I have written those lines in a hurry, sorry. I think the call function is what I needed! Oh, and your tutorial looks perfect to understand the concept: are you going to create an updated version for v12? I am sometimes confused by the v11 and v12 examples, maybe because I am pretty new to GSAP timelines. Thank you Carl!
  7. Hi! Today I have returned on that piece of code, and I have combined the previously separated Tweens of the leds (delayed in order to simulate a slowing down spinning wheel) into a timeline. Previously I was using an approach similar to this: for (var i:uint = 0; i<led.length; i++) { delay += Math.pow(step, 2); TweenLite.delayedCall(delay, flashLed(i)); } Now I have converted it in a timeline: var ledTimeline: TimeLineLite = new TimeLineLite(); for (var i:uint = 0; i<led.length; i++) { delay = Math.pow(step, 2); ledTimeline.to(dummy, delay, {onStart: flashLed(i)}); } that should reproduce the same identical animation. BUT! But if I want to use an ease instead of the delay calculation...... I could do like this var ledTimeline: TimeLineLite = new TimeLineLite({ease: Quad.easeOut}); for (var i:uint = 0; i<led.length; i++) { ledTimeline.to(dummy, 0.1, {onStart: flashLed(i)}); } right? I would create a sequence with a constant speed, bended by the ease to slow down it, without slowing down the flashLed animation, this is important. I still have to try this solution, what do you think about it? I am sort of faking the timeline with a dummy object to execute my flashLed function into an eased sequence.
  8. I am tweening an objct on a circular path: TweenLite.to(glareMC, 2, { circlePath2D: { path: circlePath, startAngle: 225, endAngle: 225, direction: Direction.COUNTER_CLOCKWISE, extraRevolutions: 1 }} ); I'd expect to see a CCW motion, as specified in the direction property, but the glareMC moves CW: why? If I change endAngle to whatever different from startAngle the animation looks correct: is this an unhandled exception of the motionPath engine?
  9. 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.
  10. Well, I didn't think about killing tweens of an array, my mistake. Anyway I think that this approach would not work for me, as the array of elements to tween can change, so I am obligued to killTweensOf the single elements. In the meanwhile I am tweening elements separately, assigning the onComplete to just one of them, obviously. Waiting for the new release, and, as always... keep on the good work! Thank you Jack!
  11. Hi, I am trying to kill the common tween assigned to two movieclips TweenLite.to([obj1, obj2], 1, { y: 10, onComplete: smile } ); If I do something like TweenLite.killTweensOf(obj1); TweenLite.killTweensOf(obj2); the onComplete function continue to exhist, but why? I am doing something wrong for sure...
  12. Well, you are the guru Jamie's solution is good, I am adopting equivalent solutions for various cases. I was just wondering if an event system could be possible, but it looks like it would be the wrong way to proceed. Ok! No, problem! Thank you Jack and Jamie!
  13. Yes, you're right, this case is very simple and I am not working on an 8088 anymore, but for very complex contexts an event phylosophy would be more clear and efficient, don't you think? I don't know if a new property "onStep" is in the plans of the future releases (it would be specific just for this ease), but it sounds very natural to me, when using a "step" parameter.
  14. Well, yes, it works, but that way I am updating both the score (rounding it to int) and movieclip once per ENTER_FRAME, and not 10 times as it seems. I could add a variation check (if score != previousScore) to avoid redrawing the gfx when not needed. If I could intercept the STEP event of SteppedEase I could write very short, efficient and clean pieces of code. It could be a cool addition for future GSAP releases
  15. Hi, I am trying to tween a number that grows progressively: I have a totalAmount and the number of total steps to reach it. I should have something like this: TweenLite.to(this, totalTime, { ***textfieldText: totalAmount***, ease:SteppedEase.create(steps) } ); My problem is: how can I increase the amount in a textfield at each step? I tried a few solutions, but I don't know how to execute actions at each step. I have the onUpdate property, but it is synchronized with the tween updates, not the step event. Maybe I am missing the onStep property or something similar...
  16. var itemsNames:Vector.<String> = queue.getLoader("audioLib").rawContent.loaderInfo.applicationDomain.getQualifiedDefinitionNames(); Great! It works! Thank you! It could be a nice code snippet to add to the docs
  17. Player 11.3 introduced the possibility to get the complete class list from a loaded SWF var definitions:Vector.<String> = this.loaderInfo.applicationDomain.getQualifiedDefinitionNames(); How do I use it in combination with a LoaderMax loading an SWF? I'd like to load an SWF and then extract all the classes using the names list I got with getQualifiedDefinitionNames: how can I do? I initially used the flassari SWFClassExplorer, but I had to download the SWF twice, once in binary format to get the list, and one in SWF format ti instance the classes: var bytes:ByteArray = ByteArray(queue.getContent(audioLibBin)); // audioLibBin is in binary format, loaded with DataLoader var itemsNames:Array = SwfClassExplorer.getClasses(bytes); var itemsListObj:Object = new Object(); for each (var className: String in itemsNames) { itemsListObj[className] = instance(audioLibSWF, className);// audioLibSWF is loaded with SWFLoader } I'd like to avoid this hassle Thanks
  18. Yeah! Thank you Carl! Your post convinced me to start using timelines, and I wounder how I could do without them. BUT... timeline does not solve my problem, unless I miss something. I have to nest the leds animations/tweens into a timeline, at a fixed distance from eachother, and this is ok, offset is what I needed (ah, I am using v11). Now I can choose the ease for the whole timeline, and this is fine, BUT I'd like to execute the nested animations/tweens (the leds) at the native speed, independently from the timeline speed/ease: is this possible? In the past I tried updating from 11 to 12, but I encountered a problem (VerifyError: Error #1053, maybe a have to recompile all the SWFs). What about the recent discussion about the timeline modifications? I read something about it, but I don't remember the details. If I switch to v12, will I have to modify the timelines written in v11? Thank you!
  19. Hi, I am trying to create a sort of wheel of fortune animation: I have 37 numbers, I always start from the first number, I know how many numbers I have to pass before reaching the right one (I could complete more than one cycle) and the time needed. The basic tween to turn a number on like a fading led is something like this TweenLite.to(led#, 0.5, {onInit: setLedAlphaTo1, alpha: 0, ease: Linear.easeNone}); If I have to make 2 cycles and a half I will create about 93 tweens, this not a problem. My problem is: how do I tween the sequence of tweens using an ease? That is: i.e. I want to tween these 93 tween on 5 seconds with an ease:Quad.easeOut, making the spinning gradually slowing down. I thought about TimeLineLite-Max, but... if I append the 93 tweens they will start as soon as the previous one has completed, but this is not the case as they partly overlap, and then I don't know if I can tween the total time with an ease. Have you got any idea of how I can do this? Thanks
  20. Noone knows if application domain could be the problem? I'd like to focus on a possible problem to fix it, otherwise I think I should abandon the project. I don't know if it is a LoaderMax problem, as I switched from regular loader from the beginning.
  21. Hi, I am having big time losses in creating a project: I have multiple games that use a common AssetsLoader class to load a toolbar manager (agent), that loads a toolbar through another assetsloader. The structure is as follows: a single configurable toolbar, 3 agents (toolbar managers) for 3 kinds of games, 80 games. Now, when I modify the toolbar code I can recompile it, it takes a few seconds, and the same is for the 3 agents, but recompiling 80 games is terrible! Why should I recompile all games? I noticed that if I modify the toolbar or an agent I have to recompile the parent cascaded swfs, otherwise I wouldn't see the agent or toolbar modifications in game as if recompiling the game I included agent and toolbar inside it. If I modify a game I need to recompile it, and it is ok; if I modify an agent I have to recompile it and all the games that load it; if I recompile the toolbar I have to recomile it, all agents, and consequently all games, and this is absolutely no good! I tried to cast the agent to * instead of the corresponding interface, but nothing changed. I tried to mess around with the application domains (trying to use a different sandbox for the agent and the toolbar), but I think I don't know very well how this works. I use LoaderMax for assets, and interfaces to access an agent from games and the toolbar from agents: game -> interface(agent) -> interface(toolbar). Can you help me please?
  22. Yeah, it was my mistake, I know that () is no good I didn't know about the () behaviour, thank you for your explanation!
  23. Ah! oNComplete is evaluated at the tween creation? Good to know, so I have to call an external function. I didn't know that () means "execute immediately": what does this imply? Does it execute it just once at the first tween step? Thank you Carl!
×
×
  • Create New...