Scale

I have a movieclip called “masterbar” and within that is one movieclip called “bar” (which is one pixel wide) and a dynamic text field called “varnumber”

What I need to do is get “bar” to expand to the be the width of four times whatever number I type into “varnumber”

I tried soemthing along the lines of the following but it isn’t working. Any help would be great!

onClipEvent (enterFrame) {
masterbar.bar._width = varnum * 4;
}

I know this doesn’t work, but can anyone help. Even better would be if you could get the bar to animate to the set size (and even better if it could have an ease out of 100)

Thanks in advance!

Steve

If that textField has instancename varnumber and the MC bar, the try this:

onClipEvent (enterFrame) {
    this.bar._width = Number(this.varnumber.text) * 4;
}

ofcourse this action has to on the MC, inside which all those things are… You can also place it on frame with this syntax:

masterbar.onEnterFrame = function() {
    this.bar._width = Number(this.varnumber.text)*4;
};

[FONT=Courier New][/FONT]

Sorry, but that doesn’t appear to work.

I’ve put the FLA online if you wouldn’t mind a having a look. You’d be a life-saver!

www.steve-savage.co.uk/bar.fla

Sorry, but that doesn’t appear to work.

I’ve put the FLA online if you wouldn’t mind a having a look. You’d be a life-saver!

www.steve-savage.co.uk/bar.fla

Yes, that couldnt work. For two reasons:

  1. varnumber was not an instance name but a variable assgined to that textfield
  2. that textfield didnt contain only a number but also “%” character

I changed the testfields type to input for easy testing… change it back if you want. When you are goint to acces its content use the TextField.text property.