dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: MovieClips and actions..

  1. #1
    Junior Member
    Join Date
    Dec 2001
    Posts
    3

    MovieClips and actions..

    I'm a newbie trying to learn so I'm wondering;
    can't you set actionscript on Movieclips in actionscript 3.0? I thought this would be the simplest thing, but I can't seem to get it to work in 3.0.

    Anyone got any good ideas for where I can start to read up on AS 3.0? This is just confusing me.. Why would they change such a simple action?

    Thanks in advance for any input.
    FuZzi

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    You can add script to frames, but you cannot add script to buttons or library items. You should instead link them to a class defined in a .as file. They changed it because hiding script all over the place is a terrible practice.

  3. #3
    Junior Member
    Join Date
    Dec 2001
    Posts
    3
    So as soon as you adapt it's in fact easier? I can live with that.. class = instance name? Or am I way off now..?
    FuZzi

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Yeah, once you adjust to the more programming-centric (as opposed to art-centric) organization you'll be fine. You're not way off, but you are off. An instancename is just a string that's attached to a particular instance on the stage. There are a few methods that use it, but it's really no more special than, say, the x property.
    A class is like a recipe for building instances. You could have a cake class, which would tell you all about cakes. All cakes have certain things in common, like a list of ingredients, how many calories, flavor, etc.
    Once you know how to make a cake, you can make as many as you want, just by doing something like:
    Code:
    var acake:Cake = new Cake();
    var anotherCake:Cake = new Cake();
    acake and anotherCake are two different instances, with different instancenames (which I didn't bother to set, so they're something like "instance34", "instance35"), but both are Cakes.

    There are many tutorials about Object Oriented programming that can explain these concepts. Some are linked in the resources thread at the top of this forum.

  5. #5
    Junior Member
    Join Date
    Dec 2001
    Posts
    3
    Thanks alot! You actually made it quite clear.. I'll check out that resources thread! Cheers =)
    FuZzi

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