so users can move the window around, and they should be able to click the close button to make the window go away.

The startDrag/stopDrag script works great. I can move the window around everywhere. But the button never triggers any of its states, and it of course doesn't work either.

Is this a level problem? I know I've put buttons in movie clips before and it should work, but the button just sits there, no rollover state or anything.

Using Flash MX.Johnhttp://homepage.mac.com/johnselvia/

lostinbeta

Guru

Posts: 1402

Loc: Philadelphia, PA

3+ Months Ago

When you put a button inside a movieclip symbol acting as a button, the buttons inside will not register.

So I can only assume in your case, the actions in your post are put on the movieclip symbol acting as the window, and not on a button or movieclip symbol inside that movieclip symbol. Am I correct?

If so, I recommend creating a button or clip inside the window clip to use as an individual dragging handle. Then assign the actions for dragging to that clip (although you may have to use _parent.startDrag() just so you are targeting the right clip... depends on if you use a button or movieclip symbol though)

This way all your individual buttons can be contained within the window clip and still register.

cmontana

Novice

Posts: 18

3+ Months Ago

The problem seems to be that you are treating the entire draggable window as a button, like lostinbetta pointed out. Just use a drag button at the top of the window.

I like to name instances of my move clips (in this case "window") and use something like:

on (press) {
setProperty("_root.window", _visible, "0");
}

Download http://imaginaire.ws/flash/dragwindow.fla and see what I mean.

Also make sure your closing button is used as a button, not a movie clip.

Also good strategy using _visible to make the window disappear, many people try using _alpha=0 to make their window disappear, not know that on 16bit color monitors, clips with an _alpha setting of 0 are still slightly visible.

Last but not least... I highly recommend relative addressing using _parent (previous timeline in hiearchy) and this (current timeline) rather than static addressing using _root. Makes the movie more portable.