Results 1 to 4 of 4

Thread: disable movie clip if nothing loaded

  1. #1
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default disable movie clip if nothing loaded

    Hey Guys,
    Me again... i want to load a thumbnail into a movieclip dynamically.. which is easy however i dont want the movieclip square to be visible if there is no thumbnail to load.
    so basically.. if there isnt "thumb1.jpg" in the folder then movieclip "square1" doesnt show up or is not visible in my flash movie.

    is this a if statement thing?

    Holler at me!!

    Thanks

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Make "square1" an empty MC.

    insert new movie clip >> name it square1, check export for action script

    You are now in edit mode for the MC. Click "scene1" to return to your main timeline. Drag the square1 MC from the library to the stage where you want it.

    At this point, nothing is in the square1 MC, so nothing shows up. Use AS to load it with an image and the image appears where square1 is placed.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by BLiZZaRD View Post
    Make "square1" an empty MC.

    insert new movie clip >> name it square1, check export for action script

    You are now in edit mode for the MC. Click "scene1" to return to your main timeline. Drag the square1 MC from the library to the stage where you want it.

    At this point, nothing is in the square1 MC, so nothing shows up. Use AS to load it with an image and the image appears where square1 is placed.
    Ahh i get that much .. i guess i failed to mention that i have a button action set on the movieclip so then when the images isnt loaded the movieclip is still clickable... so it looks kinda weird.. maybe there is a way to disable button action if there is nothing loaded kinda thing..

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Oh sorry, misunderstood.

    Code:
    onClipEvent(load){
         if(/*put your image loaded stuff here*/){
           buttonSquare1.enabled = true;
           }
         else if (/*put your image is NOT loaded AS here */){
                  buttonSquare1.enabled = false;
           }
    }
    should get you started. My context may be a little off, but the idea is there.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •