« Fireworks 8: Updated Undo Policy | Main | Revolution vs. Evolution »
August 30, 2005
Studio 8 Killer Tricks: Scale 9
To help keep Josh's Studio 8 tips thread rolling, I'd like to share what I've found to be an insanely powerful new feature of Flash 8 - Scale 9. For those unfamiliar, Scale 9 is essentially component logic that can be applied to any MovieClip. Say you have a container, or pod, or window... and you want to transition the window from small to large without distorting it. Tough luck? Not anymore.
Scale 9 allows you to create Slice Guides which determine how the Clip scales. Previously, scaling a Movie Clip looked like this:

Original MC and Scaled MC
But now, with Scale 9 applied, it scales like this:

Original MC and Scaled MC
And this works because of the Slice Guides. These guides allow Flash to render the MC in parts... so the four corners do not scale at all. The sides scale only vertically, while the top and bottom scale only horizontally. Lastly, the middle scales in both directions. To apply them... open your Library, select the Movie Clip and open its Properties window. At the bottom will be a checkbox to enable Scale 9. Turn it on. Now, any time you enter that Movie Clip, the guides will appear. The guides look like this:

Slice Guides
And finally... I've already found some cool tricks for using this. For example, I'm working on a prototype which requires a pod to be collapsed (left, below) with a small border around it. But when the pod grows to become active, it has to have some area for buttons and filters, so I wanted the left "border" to grow out. Scale 9 can help with this too! I just put the left edge in the middle section and spaced it right and as the Clip grows, my control area is revealed! Very cool:

Tricky Scale 9
I'm sure that this method of trickery can be used for lots of applications... so explore how this works, cause it beats building these things part-by-part. And it works through code too. In fact, you can even dynamically designate Slice Guides via AS.
A few drawbacks to be fair... (which will hopefully be fixed in the final release): the effect doesn't show up properly in the authoring tool! It seems to take hold on export. Eek. And, it seems that the MC being Scaled must have only primitives in it. Oh well! But still, waaaaaaaaay worth it.
Ty Lettau
Senior Interactive Designer, XD
Posted by tlettau at August 30, 2005 12:27 PM
Comments
Okay seriously, this is going to make so many lives easier. I can't even begin to explain how frustrating that little quirk was, and this is exactly what we need. The Macromedia components always scaled so nicely... they've been hording this feature for themselves until now.
Posted by: dave walsh at August 30, 2005 12:45 PM
Don't see a contact address anywhere, so I'm going to ask this here... any word on Flash 8 addressing the 1px rounded corner issue? Rounded 1px outlines tend to get distorted and don't connect properly in MX Professional 2004.
Posted by: dave walsh at August 30, 2005 12:47 PM
Only works on primitives? So does that mean I can't draw a window shape in paint, import into flash, and apply a scale9grid to it?
Posted by: David R at August 30, 2005 01:18 PM
> http://www.kaourantin.net/2005/08/stroke-hinting-in-flash-player-8-aka.html
Posted by: N Rohler at August 30, 2005 01:21 PM
David R: Thus far, (at least in the latest build I have) I have found that having nested movie clips results in the Scale 9 not taking effect.
I tested this by making a movie clip, and inside it placing another movie clip, but also a primitive. Upon export, the Scale 9 only affected the primitive. So unless I missed something, or this isn't built yet, it means that everything within a movie clip must be primitives.
As for your question, this doesn't necessarily mean that you can't do what you want, just that you need to be working with vectors or broken bitmaps. Flash's newfound abilities to handle vector importing will help a lot. The real problem I see here is for coding. Having nested clips that would have coded Scale 9 will be very common. But hey, it's better than nothing, right?
Posted by: tlettau at August 30, 2005 01:45 PM
Will the scale 9 component be packaged with Flash Pro 8?
Posted by: H8ids at August 30, 2005 02:56 PM
Yes, it is built in the Beta version already, but i'm unsure if it is totally feature-complete yet. But it'll ship with it, most certainly.
Posted by: tlettau at August 30, 2005 09:45 PM
Is this something that would only work with Flash Player 8, or is it a backwards-compatible feature of the IDE?
Loving all these new features in Flash 8 but also depressed at how long it's going to be before we get to use them. Most of our clients are still on Flash 6 (with some saddos still on Flash 5) so am still waiting to use many of the new features of flash 7 - could be years before we actually get to use any new funky flash 8 stuff!
Posted by: MOLOKO at August 31, 2005 03:47 AM
Thanks for the rundown. I knew scale 9 was available in AS, so it's great to know it's accessible from the IDE too.
Is it possible to assign a scale 9 grid within another scale 9 grid to get super-fine scaling control?
Posted by: Paul Neave at August 31, 2005 04:04 AM
It is not backward compatible. Needs to be published as FP8.
And I doubt that nested Scale 9 would work because it needs to be on an MC and I haven't found a way to get nested MCs to Scale properly... So unless someone finds a workaround, or this gets fixed by the Flash team, I think it's a no-go. BTW Paul... nice job on FlashMaps. It's an ncredible piece of work.
Posted by: tlettau at August 31, 2005 09:22 AM
This is an incredible feature!!! I made a "MovieClipBorder" class which KIND OF emulated this functionality, but in a much more basic and much much harder to use way.
Posted by: Dujodu at September 2, 2005 05:53 AM
I'm surprised no one here has thought about how this will impact compression. This is going to be huge b/c in many cases, all you're concerned about are the edges. If I understand the concept correctly, it means, in the case above, you can shrink that thing down until it's almost nothing but edges and then expand it as needed.
Truly awesome - this will be a huge help.
Posted by: P.J. Onori at September 7, 2005 11:43 AM
Hi.. I just found out about the 9 segment movie clip feature in Flash 8, and am very jealous that I can't afford to have it right now. So I just decided to emulate it in mx 2004. I just spent the past few hours writing this function attach9segMovie() which you can use in place of attachMovie. It has bugs right now. Please let me know if it is usefull at all to anyone.
http://www.blindcurves.com/test/attach9segMovie/attach9segMovie.html
I used the image on this page to demo my code. I don't know who the developer is but I hope he/she doesn't mind me doing so.
Take it easy everyone.
Posted by: Amol Mittal at September 15, 2005 04:15 AM
Thanks for the rundown i knew scale 9 was available in AS, so it's great to know it's accessible from the IDE too
Posted by: melk moon at November 22, 2005 12:42 PM
Very Good
Posted by: Peter at March 21, 2006 04:15 PM