To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 05-29-2004, 07:13 PM   #1
jamesbooth97
Member
 
Join Date: Jun 2001
Posts: 93
how to keep an internal movie the original size when the parent movie is scaled?

What I am trying to do is to make my own scrollbar component. I have made them before but always have to custom build it. What I would like to do is to build a component.

The problem I can't seem to find an answer to is that when you stretch the component in author mode, the buttons (movies) stretch, I don't want them to stretch. Actually, don't care if they stretch in author mode, but what them the original size in runtime.

I have torn apart the original scrollbar, but can't see where it solves that problem..

anyone got an answer to this one?

Jim
__________________
Jim Booth
jamesbooth97 is offline   Reply With Quote
Old 05-29-2004, 09:48 PM   #2
jbum
Senior Member
 
jbum's Avatar
 
Join Date: Feb 2004
Location: Los Angeles
Posts: 2,920
I assume you're talking about stretching the body of the scrollbar, but not stretching the "thumb" or the buttons on either end.

In the following example, I'm assuming you're making a vertical scrollbar, although the same principles apply for a horitontal one as well.

One method you might consider is making the part that stretches a 'sibling' to the parts that don't stretch (rather than a 'parent').

You'd have a parent object which doesn't stretch (scrollbar). It contains the following parts:

scrollbar.bar (stretches)
scrollbar.up_arrow (doesn't stretch)
scrollbar.down_arrow (doesn't stretch)
scrollbar.thumb (doesn't stretch)

Another method would be to compute the scale of the parts that don't stretch as the inversion of the parent object's scale. So when the parent object is at 200%, the parts that don't stretch are at 50%.

Here's the math:

ratio = bar._yscale / 100;
thumb._yscale = 100 * 1/ratio;

This reduces algebraically to:

thumb._yscale = 100*(100/bar._yscale);

or

thumb._yscale = 10000/bar._yscale;
__________________
jbum is offline   Reply With Quote
Old 05-30-2004, 04:04 PM   #3
jamesbooth97
Member
 
Join Date: Jun 2001
Posts: 93
Hey jbum,

i really like your idea of the sibling, not sure exactly what you mean there, any chance you could elaborate on it or point me to a site this is discussed? I will do some searches on the web for this as well..

thanks jbum.. got me started on a different solution..

jim
__________________
Jim Booth
jamesbooth97 is offline   Reply With Quote
Old 05-30-2004, 04:12 PM   #4
jamesbooth97
Member
 
Join Date: Jun 2001
Posts: 93
i think it just occurred to me what you were suggesting.. that when i drag the component on the the stage, i edit it, and stretch the scrollbar, rather than the up and down arrows.. that would work i think.. maybe just edit in place to line up with the textfield..
__________________
Jim Booth
jamesbooth97 is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:24 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.