A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: [RESOLVED] Stop and Play DisplayObject

  1. #1
    Member
    Join Date
    May 2006
    Posts
    31

    resolved [RESOLVED] Stop and Play DisplayObject

    My friend and I are working on a flash project in actionscript 3, and we are trying to interact with the timeline of a DisplayObject (such as stopping, playing, gotoAndStop/gotoAndPlay), the same way you would if it was a MovieClip. None of the regular commands to navigate the timeline are working on it. Is there any way that we could treat it as a MovieClip or inteact with it as if it was one?

  2. #2
    Senior Member
    Join Date
    Jun 2008
    Posts
    549
    Which commands in particular are you using to naviagate the timeline?

  3. #3
    Member
    Join Date
    May 2006
    Posts
    31
    We would like to use .stop(), .play(), .gotoAndPlay(x), and .gotoAndStop(x).

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    If it is not a MovieClip or subclass of MovieClip, then it doesn't have those methods. What would you expect those to do if there is no timeline?

  5. #5
    Member
    Join Date
    May 2006
    Posts
    31
    I guess I don't understand what a DisplayObject really is. I thought it was something that can hold a movieclip, so we could access our movieclip from within the displayobject and stop it that way. Are you saying a displayobject has only one frame? That would make a lot of sense if it was the case.

    Maybe it's best for us to stop using displayobjects and start using movieclips instead. I don't know when to use/not to use them, so it's a little confusing.

  6. #6
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Bookmark the livedocs so that you can look up properties and methods on classes:
    http://help.adobe.com/en_US/AS3LCR/Flash_10.0/

    A DisplayObjectContainer is the base class for objects which can hold DisplayObjects. A DisplayObject is anything which can appear on the displayList. DisplayObjectContainer is a subclass of DisplayObject, and MovieClip is a subclass of DisplayObjectContainer. That means that a MovieClip is something that can go on the display list and contain other DisplayObjects. There are other DisplayObjects, like Sprite (superclass of MovieClip), and Shape (a DisplayObject, but not a DisplayObjectContainer).

    Generally, you should use the most general type which is specific enough for your needs. In your case, you probably want to use MovieClips, but be aware that calling play on a MovieClip will not play its children.

  7. #7
    FK Rocks..!
    Join Date
    Dec 2003
    Location
    Islamabad, Pakistan
    Posts
    140

    resolved

    I think, you are having the same problem as discussed here, I hope it will help you.

    http://board.flashkit.com/board/showthread.php?t=805325
    Waqas A.M. Siddiqui (Vicky)
    Graphics Designer

  8. #8
    Member
    Join Date
    May 2006
    Posts
    31
    Thanks to both of you, our issue was fixed. We realised we needed to use MovieClips and not DisplayObjects. All I had to do was run a find for all instances of DisplayObject in our code and replace them with MovieClip. There was only one line I needed to (barely) change to fit the movieclip concept into our code.

    Now we are working with movieClips and everything is a LOT easier. And thanks, 5TonsOfFlax, for the link. I did bookmark it like you said.

    The reason I love about flashkit is not only the quick responses to the topics, but also the nature of the replies. I get extremely detailed posts, telling me how to fix my problem. It's just a great site for help on actionscript.

Tags for this Thread

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