A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: applying different colors to different instances of a movieclip

  1. #1
    Junior Member
    Join Date
    Jan 2010
    Location
    limassol, cyprus
    Posts
    6

    applying different colors to different instances of a movieclip

    Hey guys,

    So i have a movieclip in my library called BALL_MC. i drag and drop two of these onto my stage, which creates 2 instances of BALL_MC right? when i edit one of those instances to change its color to a bitmap texture, it changes the other one to the exact same texture. What i need is for each instance to be a different color. How might i achieve this?

  2. #2
    Senior Member Steven FN's Avatar
    Join Date
    Mar 2010
    Location
    CA, USA
    Posts
    276
    Instead of editing the MovieClip, just select it and change its tint, i think its called color effects, in the properties window.

  3. #3
    Junior Member
    Join Date
    Jan 2010
    Location
    limassol, cyprus
    Posts
    6
    that doesnt work for me. what i am doing is i am importing png files to the library. These files are pictures of shiny spheres. when double click on the mc and change its color the sphere png files are there on the palet so i can select them. but like i said when i change one instance all the instances immediately change color. same thing when i right click in the mc and select edit. With the tint option u suggested, i can actually change the color but the shiny sphere png files dont show up in the palet. plz help

  4. #4
    Senior Member Steven FN's Avatar
    Join Date
    Mar 2010
    Location
    CA, USA
    Posts
    276
    Try Color Effect > Advanced. Adjust the RGB Offsets to change color while keeping most image details.

  5. #5
    Junior Member
    Join Date
    Jan 2010
    Location
    limassol, cyprus
    Posts
    6
    i cannot afford to lose any image details, is there no way to apply different images to different instances? or am i going to have to create a different mc for each image? because that does not sound very logical to me

  6. #6
    Senior Member Steven FN's Avatar
    Join Date
    Mar 2010
    Location
    CA, USA
    Posts
    276
    You can have a MovieClip with multiple frames, and each frame have a different color. Then using code, change the frame of the MovieClip using gotoAndStop, ie:

    Code:
    myMovieClip.gotoAndStop(1); // using frame numbers
    myMovieClip.gotoAndStop("blue"); // using frame labels
    Hope that helps. No loss of quality, just have to write some code.

  7. #7
    Member
    Join Date
    May 2012
    Posts
    51
    What you want to use is a graphic with multiple frames. Each frame would contain the ball with a different texture (be sure to create a key frame before you make any changes). Now, after you dragged the graphic onto the stage, go to the "Looping" section in the property pane. Change "First" to 1 for the first instance and 2 for the second instance.
    Last edited by cleong; 08-11-2012 at 09:48 AM.

  8. #8
    Junior Member
    Join Date
    Jan 2010
    Location
    limassol, cyprus
    Posts
    6
    Thank you very much that does help. Problem solved!

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