Jump to content
Search Community

progressbar.x migration on scaleX

mark_vdi test
Moderator Tag

Recommended Posts

Hi just a small point which might help somebody:

 

If I want a loadProgressBar as a rectangle at say x=20 and y= 20 and create it using

. . .

loadProgressBar.graphic.drawRect(20,20,100,10);

. . .

rather than:

. . .

loadProgressBar.graphic.drawRect(0,20,100,10);

loadProgressBar.x = 20;

. . .

when loadProgress scales the loadProgressBar.scaleX from 0 to 100 the actual bar migrates from x = 0 to the final x set by the graphic.drawRect command in this case 20 . . . I don't know why it does this but 'hard' setting the .x to 20 removes the behavior.

 

Mark

Link to comment
Share on other sites

thanks for posting your solution.

 

just as a note, you should always make sure the contents of the object you are scaling have an x of 0 when scaling horizontally.

items will scale from the registration point.

 

if you went into the Flash IDE

 

> create a move clip called bar

> draw a rectangle in side of bar with an x of 20, width of 100, height of 10

 

go back to scene 1 and scale bar left to right.

 

the same offset will appear as you scale.

 

as the object gets bigger, the distance between the rectangle and registration point is going to get bigger too. make sense?

 

 

the IDE steps outlined are virtually the same as what happens when you draw to the graphic layer of a displayObject.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...