A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: create buttons at runtime??! Vanishes!?

  1. #1
    Member
    Join Date
    May 2005
    Posts
    30

    create buttons at runtime??! Vanishes!?

    Hello!

    Im trying to create some buttons at runtime... flash 8.
    The idea is to load some external file (here a .jpg) and turn it into a button, for what ever use.
    For this i used the code below (from macromedia), but when the button is pushed, it disappears...??? Why? With just the trace command, its ok, but with everything else, its gone...

    Any ideas??




    Code:
    code:

    // Creates a parent movie clip to hold the container.
    this.createEmptyMovieClip("my_mc", this.getNextHighestDepth);

    // Creates a child movie clip inside of "my_mc".
    // This is the movie clip the image will replace.
    my_mc.createEmptyMovieClip("container_mc",this.get NextHighestDepth);

    // Use MovieClipLoader to load the image.
    var my_mcl:MovieClipLoader = new MovieClipLoader();
    my_mcl.loadClip("somePicture.jpg", my_mc.container_mc);

    // Put event handler on the my_mc parent movie clip.
    my_mc.onRelease = function() {
    // trace("It works");
    _root.createEmptyMovieClip("someClip",this.getNext HighestDepth);
    someClip._x=200;
    trace(someClip._x);
    };


    Last edited by Ponder; 05-10-2006 at 03:11 PM.

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