Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-22-2004, 09:21 AM   #1
skjc
Registered User
 
Join Date: Oct 2004
Location: Southampton UK
Posts: 336
Default outline for a dragable mask

Hi,

I have a dragable mask and I would like to put an outline around it that follows the dragable mask around the stage.

When you go to the stage you cannot see the mask unless you arrow over it and the pointer changes at which point you can drag it around the stage to see the underlying graphic.

So if I have the mask in the shape of a circle I would like to put a coloured band around the circle that is not a mask but will follow the mask around as you drag it.

I can make the outline dragable and the mask dragable but when I move the mask the outline stays where it is and vice versa. Somehow I have to be able to link the outline to the mask.

I have tried grouping them but this does not work. Both the outline and the mask are movie clips.

thanks for any help
skjc is offline   Reply With Quote
Old 10-22-2004, 09:38 AM   #2
Laguana
Well known nobody
 
Join Date: Jul 2004
Posts: 818
Default

You could have some code on the outline, something like
onEnterFrame{
this._x = _root.mask._x
this._y = _root.mask._y
}
Laguana is offline   Reply With Quote
Old 10-22-2004, 12:44 PM   #3
skjc
Registered User
 
Join Date: Oct 2004
Location: Southampton UK
Posts: 336
Default

thanks laguana it works fine

here is the fla if anyone is interested - just quick graphics but you can see how simple the script is.

Steve
Attached Files
File Type: zip outlinemask.zip (5.1 KB, 394 views)
skjc is offline   Reply With Quote
Old 10-22-2004, 03:21 PM   #4
skjc
Registered User
 
Join Date: Oct 2004
Location: Southampton UK
Posts: 336
Default

I have update the graphics with the same script.

http://www.barkerfamily.plus.com/

As you can see the binoculars follow the mask but if you move the cursor quickly you can also see that they have to catch up which is a shame. I need to make it smoother so the binoculars follow the mask immediately and there is no noticeable difference. Any ideas?

thanks
skjc is offline   Reply With Quote
Old 10-23-2004, 12:22 AM   #5
Laguana
Well known nobody
 
Join Date: Jul 2004
Posts: 818
Default

You could try using an interval, but i'm not entirely sure how they work. Try searching for setInterval and using that.
Laguana is offline   Reply With Quote
Old 10-23-2004, 12:33 AM   #6
mmm..pi..3.14..
/(bb|[^b]{2})/
 
mmm..pi..3.14..'s Avatar
 
Join Date: May 2004
Location: Denver, CO
Posts: 2,740
Default

Increase framerate maybe???
__________________
Eric Hainer
Unleaded Software
970.581.3387
Email: Eric followed by the AT symbol, unleaded software (one word) DOT com
Denver Web Design
mmm..pi..3.14.. is offline   Reply With Quote
Old 10-23-2004, 09:29 AM   #7
skjc
Registered User
 
Join Date: Oct 2004
Location: Southampton UK
Posts: 336
Default

I have used setInterval now instead of onEnterFrame. I think movement is smoother and it seems to be ok.

http://www.barkerfamily.plus.com/

the code is:

// set up the function. Because the setInterval is running more quickly than
// the frame rate I have to include an updateAfterEvent

function follow (clip1,clip2) {
clip1._x =
clip2._x;
clip1._y =
clip2._y;
updateAfterEvent();
}

// call the function and pass it the arguments

setInterval(follow,1,binoculars_mc,mask_mc);

// set up the mask layer

vista_mc.setMask(mask_mc);

(the fla is very simple but if anyone wants it I will post it).
skjc is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:34 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.