Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1

    Default Hiding a mouse creating a new mouse and make that reveal?

    I want to hide my mouse make a new mouse thats just a semi-big circle and have that circle reveal the picture under the mask. So when you move the mouse you can see the picture through the circle. Can anyone give me the script and guide me through this?

  2. # ADS
    Join Date
    Always
    Posts
    Many
     
  3. #2
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    You could use the mouse.hide method to hide the mouse, then you would attach a movie from your library to the mouse coordinates.....

    myMouse=_root.attatchMovie("name"."newName",depth) ;
    myMouse._x = _root._xmouse;
    myMouse._y = _root._ymouse

    This would achieve the first part of creating a custom mouse. Then you would need to make the attached movie a mask over the _root layer, or the layer that contained the graphic that you want to reveal...

    _root.setMask(myMouse);

    Just thinking out loud, I have not tested this but it should work.

    HTH
    NTD

  4. #3

    Default heres what i got

    Mouse.hide()
    //this hides the mouse
    masker_mc.onEnterFrame = function(){
    this._x = _xmouse
    this._y = _ymouse
    };
    //this tells the symbol to follow the mouse by tracking its coordinates.
    this.setMask(masker_mc)
    //this turns the symbol into a mask.

    thats what i got now a question

    I created a movie clip named masker i want this to be my mouse and reveal the picture

    Do i need to put this movie clip on a frame?

    Where do i put the action script?

    I need to put a huge white square on the first layer of the mask and on the under layer of the mask i need to put the picture i want revealed correct? help please

  5. #4
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    The method I posted would use attachMovie from the library to attach the mask to the mouse. By dynamically declaring setMask, you can target either a level or a movie clip.

    //attaches a movie from the library to the mouse to use as a mask
    myNewMouse=_root.attatchMovie("name"."newName",dep th);
    myNewMouse._x = _root._xmouse;
    myNewMouse._y = _root._ymouse

    //sets the main timeline as the "maskee" of the attached movieclip
    _root.setMask(myNewMouse);
    or
    _level0.setMask(myNewMouse);

    _level0 and _root are both references to the main timeline

    to set the mask for a movieclip...

    // set the mask to reveal a movieclip
    mcName.setMask(myNewMouse);

    HTH
    NTD

  6. #5

    Default 2 favors?

    Can you do me 2 favors and tell me where to put all that script and will my way work? oh and where to fill in the name of the movie clip

  7. #6
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    It is generally best to learn to put all your code in the first frame of the main timeline. This makes editing, updating, and bug tracking much easier as your code is centralized. Flash also allows you to put code on objects and buttons themselves, but for larger dynamic projects, this can make tracking your code difficult. Putting code on objects can allow for the objects to be duplicated with the existing code, so there are advantages to both ways, but generally, codeing on the first frame and accessing movieclips or buttons with dot syntax is standard practice.

    To name a movieclip, select it on the stage and open the properties panel. You will see a textfield filled in with greyed letters that reads "instance name" ..... this is where you would name your movieclip.

    Your way should work as long as you put the movieclip on the stage in the mask layer. Then put your graphics under the mask layer and attach the mask to the mouse position with the onEnterFrame code.

    HTH
    NTD

  8. #7

    Default

    THank you NTD you have been a big help thus far but i have 2 more questions then im done

    I managed to get the mouse to dissapear and my custom cursor appear (just a circle)

    How can i make the color of the circle invisible like fade it to 100% or whatever how do i do that?

    and

    How do i make it so that it recognizes it as a mask remover or mask or whatever?

  9. #8
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    You can adjust the level of visiblility with _alpha.....
    Create a test movie with a a movie clip on the stage named "mcName" and add this code to the first frame of the main timeline. You can target any mc to alpha down with this function.

    Code:
    _root.alphaDown = function(target) {
        this.onEnterFrame = function() {
            _alpha -= 5;
        };
    };
    _root.alphaDown(mcName);

    To use a mask..... create a graphic in one layer, lock it and insert another layer,.... create a graphic in this layer... right click on the higher layer and select mask. The layer beneath will only reveal what is inside the graphic on the layer above.

    Make a movieclip in the mask layer and attach it to your mouse with the code in the previous post to make a scrollable viewer.

    NTD

  10. #9

    Default ARGGHHH

    ARggghhh is all i can say i have managed to get the movie clip to follow the mouse and what not but hte masking wont work!!!!!!!!!!

    I put the movie clip on the mask layer and all it does is stay there and not follow my mouse and then my mouse has the movie clip on it as well but it doesnt do any masking........ im so confused please help i got a shortened version of code that should work

    Mouse.hide();
    startDrag(masker_mc,true);
    target_clip.setMask(masker_mc);

    whats wrong with this?

  11. #10
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    Try just making a normal masked graphic until you get that to work, then look into using setMask dynamically.....

    Create a new movie with a graphic or picture on the first frame of the layer. Insert another layer and draw a circle. Highlight the entire circle and select form the top menu ... Insert.. create new symbol. Make the circle a symbol and name it "viewer". select the layer that the circle is on,... making sure it is above your graphic layer, and select "mask". Now, all you need is the code to make it all work. Insert a third layer above the other two and name it actions and paste this code .......

    Code:
    Mouse.hide();
    _root.viewer.onEnterFrame = function () {
    _root.viewer._x = _root._xmouse;
    _root.viewer._y = _root._ymouse;
    }
    HTH
    NTD

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Mouse Rollover problem
    By dj.michaud in forum Newbies
    Replies: 2
    Last Post: 08-27-2006, 01:52 PM
  2. stop the animation on mouse over
    By eye_catching in forum Flash Scripting
    Replies: 1
    Last Post: 08-27-2006, 12:08 PM
  3. how to spin a propeller with the mouse
    By gtmen in forum Flash Scripting
    Replies: 0
    Last Post: 12-28-2005, 11:57 PM
  4. need help with mouse over movement
    By domenique in forum Advanced Flash
    Replies: 3
    Last Post: 07-13-2005, 06:00 PM
  5. horizontally scrolling by moving mouse
    By bubbaphro in forum Advanced Flash
    Replies: 1
    Last Post: 05-05-2005, 01:03 PM

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
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial