A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Manually Creating MovieClips

  1. #1
    Senior Member
    Join Date
    May 2010
    Location
    Russia: Western Siberia
    Posts
    268

    Question Manually Creating MovieClips

    It's just a pure curiosity of mine . I'm using flash to create movie clip objects and never thought about creating them programatically. But today I came across this article http://livedocs.adobe.com/flex/3/htm...ieClips_6.html .
    Nevertheless, there's no official explanation of the process. Google search also gave me no adequate results.

    What if I have e.g. 5 images, and I wanna turn them into a short piece of animation. How can I do it using pure actionscript 3?

  2. #2
    Senior Member
    Join Date
    Feb 2006
    Location
    Düsseldorf, Germany
    Posts
    142
    Hey, you should use:

    http://www.greensock.com/timelinemax/

    it has all what you need.
    --
    there is a place for those who dare to dream...

    Flash Developer
    VISTAPARK GMBH
    BÄRENSTRASSE 11-13
    D-42117 WUPPERTAL

  3. #3
    Senior Member
    Join Date
    May 2010
    Location
    Russia: Western Siberia
    Posts
    268
    Thanks for the reply, but it's not what I need. It's not the problem for me actually, I can use flash to create any graphics I need for my programs and games. But I wanna know how can I create a movie clip myself, not using any third party classes.
    Let's say I have FlashDevelop and flex sdk and don't have the internet access to download any other classes or software that can help me, but I need to create movie clip here and now.. What's the solution?

    I know that Java can easily create animation out of number of images and control them just like flash controls movie clips, and I'm sure it's possible to do the same with actionscript 3.. I just need to know how
    Last edited by caseyryan; 07-23-2010 at 02:19 PM.

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    If you're intent on re-inventing the wheel, go for it. But the greensock developer has pretty much done what you asked for. That is, it's an animation library done entirely in as3 without external dependencies.

    If I were to make it from scratch, I'd have a class extend Sprite that has a timer and several resources, one per "frame". These resources would be stored in a collection like Array, and can be added or modified at runtime. Make methods to set timer properties according to framerate, and convenience stuff like play and stop. Then just use the timer to swap out resources from "frame" to "frame".

  5. #5
    Senior Member
    Join Date
    Feb 2006
    Location
    Düsseldorf, Germany
    Posts
    142
    if i understood corectly you want this code:

    Actionscript Code:
    var mc : MovieClip = new MovieClip ();
    var sp : Sprite = new Sprite ();

    and then put anything you like into the mc or sp, and then you can animate them and etc...
    --
    there is a place for those who dare to dream...

    Flash Developer
    VISTAPARK GMBH
    BÄRENSTRASSE 11-13
    D-42117 WUPPERTAL

  6. #6
    Senior Member
    Join Date
    May 2010
    Location
    Russia: Western Siberia
    Posts
    268
    If you're intent on re-inventing the wheel, go for it. But the greensock developer has pretty much done what you asked for. That is, it's an animation library done entirely in as3 without external dependencies.
    As I already said, it's not a need, it's just the curiousity

    Quote Originally Posted by ifmi View Post
    if i understood corectly you want this code:

    Actionscript Code:
    var mc : MovieClip = new MovieClip ();
    var sp : Sprite = new Sprite ();

    and then put anything you like into the mc or sp, and then you can animate them and etc...
    This way you can create a DisplayObjectContainer, nothing more. You can't create an animated mc using this code

    If I were to make it from scratch, I'd have a class extend Sprite that has a timer and several resources, one per "frame". These resources would be stored in a collection like Array, and can be added or modified at runtime. Make methods to set timer properties according to framerate, and convenience stuff like play and stop. Then just use the timer to swap out resources from "frame" to "frame".
    Well, that's the only thing that comes to my mind too


    Ok, feels like timelinemax is really the best solution in this case

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center