A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Loading movieclip from library with actionscript

  1. #1
    Junior Member
    Join Date
    May 2010
    Posts
    23

    Lightbulb Loading movieclip from library with actionscript

    Hey guys.

    -I need to load a movie clip to the stage from the library.
    -I also need that movie clip to load with a certain string of actionscript code in it.

    To load the movie clip, i checked the "export for actionscript" thing in the "linkage" section of the movie clip info, and i named the class "sol1"
    I then used this code on the first (and only) frame:
    Code:
        _root.attachMovie("sol1", "NewInstanceName", {_x: 50, _y: 100});
    It seems to work, but the question is, how do i load the movie clip with code in it?


    thanks in advance

  2. #2
    Member
    Join Date
    Aug 2006
    Posts
    96
    What kind of code do you want to load with it?

    Is there a reason you can't include the code in the movie clip in the library?

  3. #3
    Junior Member
    Join Date
    May 2010
    Posts
    23
    Quote Originally Posted by RESlyder View Post
    What kind of code do you want to load with it?

    Is there a reason you can't include the code in the movie clip in the library?

    the code i want to have in this object is extremely simple:

    Code:
    onClipEvent(enterFrame){
    this._x+= 5
    }

    i didnt think it was relevant.
    ***EDIT***
    Sorry i misunderstood what you were saying until i read it again...

    And thanks, that totally worked!

    I don't know why I didn't even think of that, and I feel really stupid >.<
    Last edited by Ffatty; 01-19-2011 at 03:16 AM. Reason: thanks!!

  4. #4
    Member
    Join Date
    Aug 2006
    Posts
    96
    No problem! That is why these forums are here! Glad it worked out

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