# Scale

**URL:** https://forum.kirupa.com/t/scale/186749
**Category:** flash
**Created:** [April 24, 2006, 11:17am UTC](https://forum.kirupa.com/t/scale/186749 "2006-04-24T11:17:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![stevesavage](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@stevesavage](https://forum.kirupa.com/u/stevesavage)
#### Post date: [April 24, 2006, 11:17am UTC](https://forum.kirupa.com/t/scale/186749/1 "2006-04-24T11:17:22Z")

</div>

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!

```auto
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

---

<div class="post-metadata">

### Author: ![mathew\_er](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mathew\_er](https://forum.kirupa.com/u/mathew_er)
#### Post date: [April 24, 2006, 11:48am UTC](https://forum.kirupa.com/t/scale/186749/2 "2006-04-24T11:48:03Z")

</div>

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

```auto
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:

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

```

[FONT=Courier New][/FONT]

---

<div class="post-metadata">

### Author: ![stevesavage](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@stevesavage](https://forum.kirupa.com/u/stevesavage)
#### Post date: [April 24, 2006, 12:00pm UTC](https://forum.kirupa.com/t/scale/186749/3 "2006-04-24T12:00:06Z")

</div>

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](http://www.steve-savage.co.uk/bar.fla)

---

<div class="post-metadata">

### Author: ![stevesavage](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@stevesavage](https://forum.kirupa.com/u/stevesavage)
#### Post date: [April 24, 2006, 12:00pm UTC](https://forum.kirupa.com/t/scale/186749/4 "2006-04-24T12:00:14Z")

</div>

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!

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

```

---

<div class="post-metadata">

### Author: ![mathew\_er](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mathew\_er](https://forum.kirupa.com/u/mathew_er)
#### Post date: [April 24, 2006, 12:35pm UTC](https://forum.kirupa.com/t/scale/186749/5 "2006-04-24T12:35:14Z")

</div>

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.
