Thread: ActionScript 3, wait for movieclip to end

  1. #1
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446

    ActionScript 3, wait for movieclip to end

    Well, this is really not the best place to post it, but i'll give it a shot.

    This is about the website that will host the game I'm currently developing in C++.

    I have a main timeline composed of just one frame. Objects inside have their own timelines.

    - I'm loading text into a dynamic text field in the main timeline.
    - In one of the main timeline layers, I have a verticalBlind_mc which moves a white box from bottom to top, hiding the contents area, and then top to bottom, re-exposing it, in order to create a transition effect.

    What I basically want is this...

    1. Play verticalBlind_mc till half way and stop;
    2. Only then load text contents into dynamic text field;
    3. Play the rest of verticalBlind_mc;

    My problem is with step 1. I can control 2 and 3 with event.COMPLETE and the URLLoader object. But I cannot seem to be able for step 2 to only start after step 1 is finished.

    Can you provide general directions?
    Last edited by Mario F.; 05-29-2008 at 04:43 AM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #2
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,110
    It has been a long time since I've done anything in flash/AS. But you can set up your own eventHandlers and generate events as well... (thats first thing that comes into my mind to generically deal with things like this).

    So somewhere halfway the verticalBlind_mc you let the publisher generate a message to whoever is subscribed to it (in this case the dynamic text loading)... Be sure to create the publisher on the _root timeline so every mc has acces to it.

    I would give you specific AS code but as it has been 2 years since ive done anything in AS (and at that time we were still using 1.0) the syntax would be way off, but in short just use the observer pattern and it should work.

  3. #3
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Doh! Of course.

    I should let the movieclip itself define the exact instant the text is updated on the dynamic text field. I was complicating it by trying to set everything from the main timeline script. Thanks Gangly.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Overwriting all in array, why?
    By guesst in forum C Programming
    Replies: 7
    Last Post: 10-09-2008, 05:56 PM
  2. singly linked to doubly linked
    By jsbeckton in forum C Programming
    Replies: 10
    Last Post: 11-06-2005, 07:47 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Collision with quads?
    By SyntaxBubble in forum Game Programming
    Replies: 6
    Last Post: 01-18-2002, 06:17 PM
  5. Character in Array to end for loop.
    By mattz in forum C Programming
    Replies: 6
    Last Post: 12-04-2001, 11:05 AM

Tags for this Thread