PDA

View Full Version : I want to be able to resize my flash menu


MrBungle
07-25-2001, 03:37 PM
I've made a very simple flash menu as an MC with buttons that can be minimize and moved about the screen. It will sit over the top of my page as a menu the user can alter to suit their tastes. However, I've hit a hurdle....

What I'd like is a way to have another button in the corner of my MC so I can press, hold and resize the MC and it will scale, just like a standard PC window. I don't care about the text resizing at present. (But if theres a way to compensate for that ....then even better!)

Thanks

Ben

benjiemoss
07-27-2001, 03:21 PM
It's absolutely possible to have just a button with a plus sign and a button with a minus sign and when you click them your menu gets one stage bigger or smaller. But that requires working out it's size and whilst I knnow how to do it in theory, I haven't got iot to work yet. If you wanted just a simple list of sizes, for example : 100 x 100, 110 x 110, 120 x 120 etc. etc. do this:

1) Have your menu as a MC on your timeline. Name it "menu" in the instances box.

2) Make a button for each size you're going to allow people to resize it to. Put them on the same timeline that the menu MC is on.

3) Put the following code on the button to make it 100 pixels by 100 pixels:

on (press){
menu._xscale = 100;
menu._yscale = 100;
}

Put the following code on the button to make it 110 by 110 pixels:

on (press){
menu._xscale = 110;
menu._yscale = 110;
}

You get the point.

That's all you need do and the menu MC will resize. I think it's best to do it in small steps, because it's less disorientating for the viewer. But maybe that's what you want.

I'm trying the incremental resize myself at the moment so if I work it out I'll add it after the last post on this thread.

Cheers.

Marlow
08-27-2001, 01:18 AM
To resize with just a plus or minus sign use the following:

on (press, keyPress "+") {
_root.mc, _yscale = _yscale+5;
_root.mc, _xscale = _xscale+5;
}

This just takes the current x and y scale of your mc and adds 5 pixels.

Ricod
09-07-2001, 02:20 PM
Try this :

Add 4 draggable buttons to each of the MenuMC's corners, but not in the MC, just on a different layer at the exact x and y coordinates of the corners. Make sure they are on top of the visible buttons. (handier : a border) Now use the startdrag command to drag the cornerbutton of your choise (let's use the right bottom one as an example) and start calculating the distance with the LeftBottomButton and the RightTopButton. Use the Telltarget to resize the MenuMC according to the distance of the CornerButtons. Make the script a loop.

I haven't tested it, but it's a theory. Let us know if it works.

pixelwit
09-28-2001, 02:42 AM
Go here:
http://www.pixelwit.com (New Flash)

Try the "Swirlpool" project and resize the "Options" menu.

If this is what you want to do then you should read some tutorials on how to create a "slider".

Go here:
http://www.actionscripts.org/tutorials/intermediate/sliding_value_setter/index.shtml

Once you know that, you can set the menu's scale properties using the "slider".

Hope this helps,

-PiXELWiT

Tim - DFS
10-16-2001, 09:07 AM
Go here: http://www.actionscripts.org/showMovie.php?id=214

This other one has a text box inside.

http://peripheral.h8tml.com/

The text size stays the same, but is rearranged depending on the shape of the box... I'm guessing he has the effect working on a dynamic text box as well... or something... dunno. Too bad this second one isn't open source, it's a fair bit better
Good luck