A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: same mask effect for mkultiple images

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    12

    same mask effect for mkultiple images

    OK so I have a mask and I want to take 12 images and put the same mask to it and then loop them, I have been struggling with this for a while, if someone has a example or information that would lead me in the right direction I would rally appreciate it.

    I can apply the mask to one image but would this be easier to do in actionscript or am I completely off base here?

    Thank You very much

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    So you have a MASK Layer, and below it, is the layer that is masked. Make a new layer, and put the new layer BETWEEN the MASK Layer and the image that is going to be masked. Then, the same MASK will be applied to that layer too

    If you don't know what I mean, just say so and I'll post images
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    I have acutally tried that and I seem to be doing something wrong because it does the first pic then masks to the second pic but then after that I do something that causes it only to go to the 2nd pic, I would love to see a pic or two to point me in the right direction.

    Thank you very much.

  4. #4
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Well, I don't know what you're doing wrong. But, convert each of your image to a movieclip, and give image 1 movieclip's instance name, for example a name of img1, image 2 movieclip's instance name, img2, etc.

    And then, convert your mask to a movieclip, and give its instance name, a name of for example my_mask. Then, click on one of your frames, and use this code depending on how many images you have:

    Actionscript Code:
    img1.setMask(my_mask);
    img2.setMask(my_mask);
    img3.setMask(my_mask);
    img4.setMask(my_mask);
    // etc.

    Maybe that works?
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  5. #5
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    ok so how would i convert each of my images to a movieclip?

    Thanks man.

  6. #6
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    nevermind I got that part, let me try and do this step by step, i will let you know when i do something wrong.

    Thanks a lot.

  7. #7
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Oh, so you're not so very familiar with Flash? That's okay - just go ahead and ask ^^
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  8. #8
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    OK, so i converted to movie clip just 2 of the images, then on frame 1 I have img1 and on frame 2 I have img2 then in frame1 in the actions panel i set this:
    Actionscript Code:
    img1.setMask(mask2);
    img2.setMask(mask2);

    And then all i see is just img2 and no mask or even img1 I am obviously missing a step.

    Thanks for your help.

  9. #9
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Would it be possible for you to attach the .FLA file, so I may take a better look at how your Flash file is constructed? That way, I'll be able to help you ALOT more
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  10. #10
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    ok I had to remove some files from it so it could be added here.

    Thanks a lot man this is really important for me.
    Attached Files Attached Files

  11. #11
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Okay, so the code didn't work on more than 1 movieclip. However, normal masking on multiple layers work perfectly fine here
    Attached Files Attached Files
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  12. #12
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    so it may be working on yours but on mine it is not, i am using adobe flash professional cs5 is there something I need to do to make this work right?

  13. #13
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Last try, put all your animation and all your images in a new movieclip, and use the code provided above on that single movieclip. Then you'll mask one movieclip, which contains all of your images and stuff
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  14. #14
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    So that was a no go either, I am at a loss as to why this does not work, i should be able to do something similar to: http://www.flashxml.net/video/masks/
    the only differance is I would like it to loop. now I can't seem to get past making them transition to where he is because of having to put stop() in the last frame.
    Last edited by reaper7861; 07-27-2011 at 06:43 PM.

  15. #15
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Upload your whole FLA file in another site like tinyupload or 4shared or 2shared or something similar!
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  16. #16
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    Which FLA file? I have like 5 of them now.

  17. #17
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Well, I really don't know what you want to achieve >.<

    Is it that effect in the video? If so, what are you having problem with it, and could you send a FLA file of the file that you're having problem with or, could you please describe your problem =?
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  18. #18
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    just looping the effect in the video.

  19. #19
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Then I suggest you do exactly as told in the video, but first, make a movieclip, and INSIDE the movieclip, follow the video

    CHECK PAGE 2
    Last edited by Nig 13; 07-27-2011 at 07:51 PM.
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  20. #20
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    ok, I was also wondering how i would do a rotation of 90 degrees on the mask.
    is it like this?
    Actionscript Code:
    mask2._rotation = 90;

    I know that _rotation will rotate it but I am unsure of how to tell it to rotate the mask.

    Thanks again for all your help.

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