Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by mrEmpty

  1. Hello.


    It looks like some anti-aliasing has been applied, and whilst I remember once reading about a similar problem I cannot remember what the solution was. I'm sure one of the more experienced members will point out something.


    One thing, why are you using both TweenLite and TweenMax to tween properties of the same item? Not a bash, I'm just interested. :)

  2. Yes, each tween has an isTweening property you can check.


    Let me quickly boot up my other computer which I code on and get back on here...


    ...back. OK, so for example you have a movie clip called box, you've applied a tween to it and you want to know if that tween is still in progress:


    if (TweenMax.isTweening(box)) {
    //tween is still going, do whatever is here


    Is basically saying, if the tween is still going, do...


    Of course you could check if the tween isn't going by using:


    if (!TweenMax.isTweening(box)) {
    //tween is not in progress, do something

  3. Hello.


    Another done of my impossible to describe questions :) Last one of the year I promise :)


    Image two buttons, left and right. You have a large movie clip which is being used to control the position of many things which are neatly nested inside it. Click left and it moves that movie clip 100 pixels to the left, ditto for right. Now, you can ignore the request for a tween if the tween is happening, or remove the listeners until the tween is done, but that stop you quickly tapping your way through.


    So I wondered what a better way to do it would be? I wondered if I could create an array and fill it with values for the movie clip, appropriate x values for the movie clip. You could then have a variable which records where you are, say place 3 out of 5 positions. When you call a tween it take the position, chooses the next (or previous) number, and tweens that that value which is stored in the array.


    That works happily in my head, but I wonder if I'm doing it a really complicated way?

  4. Hey Carl.


    Those are good links, I'll no doubt find myself reading a lot about this.


    When I did my testing (my current job is to help a large well known non-profit create digital labels using iPad style devices) I got to test almost every tablet currently on sale. The difference between Android and iOS was huge, it made me think Android must be leaked beta software. ;) But yes, the vectors ran really smoothly. On the Galaxy 10.1 tab for example, running at full 1280x800 I used my recent parallax thing to tween a load of interactive and non-interactive content, across 5 layers, and I got a solid 60fps. When I started adding images, It dropped to round 50-ish then gradually down to a crawl. Replacing the PNG bitmaps with movie clips filled with brownian motion circles wobbling themselves around, it was back at 60fps. So what I saying is on Android at least, sticking to the drawing API kept things massively fast.


    That may be Android though, it seems to have very poor memory management. And it meant I got good at drawing in code which is something I needed to learn :)


    With regards to the original poster, can you not use bitmaps instead of vector text? Try creating a Glyph Sheet (Sprite Map for characters), I'm sure you'll find something on Google.

  5. Have you tried various tweens with and without certain aspects being animated, to find out what's sowing it down? When I get my iOS license again (forgot to renew) I'll be testing this myself. On Android I discovered bitmaps were much slower than vectors, no matter if you targeted CPU or GPU. Scaling and movement were fine, but alpha caused the various devices I had for testing to slow down. I'd like to see how my stuff runs on iOS.


    It's interesting Jack that you say to use bitmaps instead of vectors. I've been ignoring Illustrator and Photoshop in favour of Flash's drawing API, this seems to improve performance hugely. Is this different to vectors made in Illustrator?


    This is an interesting discussion :)

  6. One thing I tested very briefly was using TweenLite to tween items to the current position of an invisibly physics object. I used APE for my test. I simply tested the amount the physics engine moved, if it was more than n I tweened to that new location. The reason was the physics engine drew things poorly, so it stuttered. TweenLite made it look good again.


    But it was only a test, I doubt I'd use it for anything serious.

  7. Hello.


    Thanks for the comments. The source won't include any member code, the parallax doesn't need it but the full example code will, so if people want to use it as is they'll need to purchase.


    In terms of the parallax, the file is attached, feel free to use however you want and please make suggestions because the code will be so very poorly written. :)


    EDIT: Oh, the new version which I'll upload soon has the iPad style bounce as shown on Jack's ThrowProps example. I'll upload a complete thing soon, but again if people wish to use as is they'll need to buy Jack's source.

  8. I kinda have it done, I have a very ugly class which needs some serious tidying when I get time. I create a parallax class like so:


    private var aNewThing:Parallax = new Parallax(5, 1.1);


    The arguments are the numbers of layers and the ratio. So this one for example has 5 layers, with each layer moving 1.1* the amount of the number I pass in, which I do by:




    So you could, as I'm doing, pass in the Y location of a master movieclip.


    So add stuff to the layers you simply use:


    aNewThing.addLayerChild(yourMovieClipOrSprite, 2);


    Which is the item you want to add, and the layer you want to add it to.


    Like I say, it's ugly and needs work but for testing an idea it's ok. I can share if you want? I'd just need to strip out some stuff I can't release yet.


    Attached is a SWF, I only added random content to the top panel as it were, but it shows the idea. I may add a blur based upon the layer, which tweens in and out when it's moving or stopped. This uses my parallax along with Jack's example code for iPad style flicking between pages combined with Throwprops to get that nice bouncy motion. I'm happy to share all the code, but please let me tidy it a little as it's an experiment and therefore a total disaster in terms of readability of cleanliness! It would be nice to share though so people can suggest ways to tidy it. :)

  9. On mouse over you can tween the scaleX and Y of the target movie clip, then on mouse out you can set them back to 1.


    TweenLite.to(ball, 0.5, {scaleX:2, scaleY:2, ease:Elastic.easeInOut});


    TweenLite.to(ball, 0.5, {scaleX:1, scaleY:1, ease:Elastic.easeInOut});


    I don't have access to Flash currently (formatting, long long story) so I can't test it, but that should get you started.

  10. I just tested this on a different system, it's working fine. I'm guessing a lot of the odd issues I've been having are either down to Lion + CS5.5 or the way the IT Department configured this Mac. It's behaving badly.


    A good example is code that will compile and run fine, will then decide to not compile at all and throw an error, normally to do with not being able to find external classes. And then a simple quit and re-run of Flash solves the problem. It means I can spend ages to trying to find the problem in my code, only to discover it doesn't exist.


    But it's good to know my base Parallax system runs, and I can move on with it.

  11. Hello.


    I am trying to use TweenLite to tween a number, which I pass into another class. I'm probably doing this in the most ridiculous way but it's an experiment and almost Christmas so hey ho :)


    Can I get the output of a tween in a number format, or target a number var directly?


    So, if I had:


    private var myNumber:Number;


    Could I target that var?

  12. Hello.


    The moves aren't radically different at the moment, the problem happens if I manually enter different tween values also. I currently have 5 layers, each with 1 sprite (a basic square).


    I use Flash 5.5, I can save as version 5 if that's easier?


    Displaying frame rate my movie is running at 60fps, so it may just be my eyes. But it does look less smooth than I'd normally expect.

  13. Hello.


    OK, so I'm getting bad performance with some tweens, I'm guessing I did something bad as Greensock never fails me.


    What I'm doing is tweening some sprites up and down based upon mouseX:


    public function parallaxLogic(ParallaxYTransition:Number):void
    		for (var i:int = 0; i < paraLayers; i++)
    			TweenLite.to(paraArray[i], 0.5, {y:(ParallaxYTransition * paraRatio * i)});
    			//paraArray[i].y = (ParallaxYTransition * paraRatio) * i;


    I have some sprites in an array, and based upon a ration number, the sprites in that array move more or less than each other (parallax). I call this function by:


    stage.addEventListener(MouseEvent.MOUSE_MOVE, init);
    	private function init(event:MouseEvent):void


    I'm guessing it's to do with the array, and the time taken to loop through it?


    Simple FLA with classes attached. :)

  14. Hello.


    Yeah, I tried out the assorted pre made stuff, I don't think it'll do what I want. The thing in my head I've discovered is more than just parallax, so I think I'll roll my own solution.


    That's a lie, it's parallax but not the standard 'further away moves least' method, it's a mixed up bag. Ideally I'd like to throw in a display object, give it it a z order and a ration, and it'll take care of everything else. So I'll spend a couple of hours ripping apart, before probably starting from scratch!


    This would all be so much fun if it wasn't for deadlines :)

  15. Hello.


    This may not be appropriate for tis forum, so please feel free to kill it if needs be. This isn't specific to Greensock code, but this is a friendly forum and I feel happier asking this here.


    After a few weeks of getting my head into AS3 and trying to ignore my iOS instincts, I'm ready to start coding my first big project. The GUI for it is quite simple, but I'm wondering the best way to go about coding it. So I thought I'd ask advice. I'm not looking for code examples, right now I'm thinking about it in a more general way.


    The layout uses 3-4 layers with parallax, each layer has several elements on it, something like the ugly sketch attached.


    The idea is that the user can swipe up/down and the GUI will navigate to the next/previous section. Parallax will be used to give a feeling of depth, many of the elements are partially transparent. Each element will come in and move out at it's own speed, initially based upon the speed of the user's gesture, which I'll give to throwProps.


    I'm wondering if I should keep things simple by using a movie clip for each 'layer' and adding the appropriate parts to those movie clips, then using simple code to fake the parallax. Of if each item should be a separate movie clip which is driven directly?


    Typing this out I think I'm making this too complex in my head, or probably not explaining it very well. It's hard to write down the complex motions these things need to do, the closest thing I can think of is parallax with dynamic velocities based off the gesture speed.


    Anyway, tomorrow when I'm not really tired (long long day, started at 5am just finished) I'll probably sketch it up better. But if anyone has any thoughts, please let me know. And again, if this isn't a great place to ask, feel free to kill the thread.