A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] Help! Masking

  1. #1
    Junior Member
    Join Date
    Feb 2006
    Posts
    19

    [F8] Help! Masking

    I'm having trouble masking LoadedMovies dynamically

    Currently i load the image into an empty movie clip and the mask into another empty movie clip as follows:

    code:

    _root["container"+n].createEmptyMovieClip("image"+i, this.getNextHighestDepth());
    _root["container"+n]["image"+i].createEmptyMovieClip("mcontainer"+i, this.getNextHighestDepth());
    _root["container"+n]["image"+i]["mcontainer" + i].attachMovie("mask", "mask" +i, this.getNextHighestDepth());



    I then load an image into the image movie clip and try to apply the mask to it as follows:
    code:

    _root["container"+n]["image" + i].loadMovie(imageurl)
    _root["container"+n]["image" + i].cacheAsBitmap = true;
    _root["container"+n]["image" + i].setMask(_root["container"+n]["image" + i]["mcontainer"+i]["mask"+i]);



    (the I / N values are because they are in a loop )

    Can anyone offer any advice, am so close to finishing this project and this is the final hurdle!

  2. #2
    Junior Member
    Join Date
    Feb 2006
    Posts
    19
    Ok so i have now got the mask displaying on top of the image i want masking, it is however not... well masking it... i changed the code to:

    code:

    _root["container"+n]["image" + i].loadMovie(imageurl)
    _root["container"+n]["image" + i].cacheAsBitmap = true;
    _root["container"+n].createEmptyMovieClip("mcontainer"+n, this.getNextHighestDepth());
    _root["container"+n]["mcontainer"+n].attachMovie("mask_frame", "mask"+n, this.getNextHighestDepth());




    The 'mask_frame' in the library has the Mask symbol inside it with the following code attached:

    code:

    onClipEvent(load)
    {
    _root["container"+n]["image"+i].setMask(this);
    }




    ....Any ideas? the mask gradient is displaying on top of each image, but as a bitmap and not as a mask

  3. #3
    Junior Member
    Join Date
    Feb 2006
    Posts
    19
    Ok i've managed to get the effect working using AttachMovie clip however it needs to be applied to an external clip and so needs to work with LoadMovie. I think the problem may be that I can't identify the loaded clip in the same way i can with the attached clip:

    code:

    _root["container"+n]["image"+i].attachMovie("us", "us"+i, this.getNextHighestDepth())
    _root["container"+n]["image"+i]["us"+i].cacheAsBitmap = true;



    can be refered to as ["us"]+i and so Cached as a bitmap, however the load movie

    code:

    _root["container"+n]["image"+i].loadMovie(imageurl);
    _root["container"+n]["image"+i].cacheAsBitmap



    can't be identified the same way and thus can't be Cached as a bitmap, how can I get at that loaded movie within the image movieclip holder?

    I could be way off, could it be that the mask isn't being applied as the external movie hasn't been loaded fully (even though currently they are loading off the hard disk)?

    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