# Zoomin'!

**URL:** <https://forum.kirupa.com/t/zoomin/19106>\
**Category:** flash\
**Created:** [April 24, 2003, 9:31am UTC](https://forum.kirupa.com/t/zoomin/19106 "2003-04-24T09:31:25Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![markcq](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@markcq](https://forum.kirupa.com/u/markcq)\
**Post date:** [April 24, 2003, 9:31am UTC](https://forum.kirupa.com/t/zoomin/19106/1 "2003-04-24T09:31:25Z")

</div>

Hey,

I was wondering if anyone could help. Not sure if I should post this message here or in the ActionScript section.

I was wondering if anyone know how to get a zooming effect… have a look at [SoFake](http://www.sofake.com) .

I can imagine how half the stuff can be done, but I’m not sure about the transitions. If you press the last button for example, and then the first button it plays through the whole lot.

I don’t want to use this for a website or for a project. Its just one of those want to know things. I’m always building a little library for myself with various flash things. Interesting to have.

Thanx for any help and or suggestions

Markcq:toad:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 24, 2003, 11:47am UTC](https://forum.kirupa.com/t/zoomin/19106/2 "2003-04-24T11:47:56Z")

</div>

I reckon you do that effect with just simple tweening.

If you use a picture bigger than the display area (with unwanted stuff round the excess space), you can put it in on a click then motion tween it out until only the bit you want is showing.

So it looks like it’s zooming, but you don’t have the trouble of making it go from tiny to large, as it already filled the screen when the picture loaded.

If that makes sense. 🙂

If it didn’t I can whip up a quick example for you… 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 24, 2003, 12:05pm UTC](https://forum.kirupa.com/t/zoomin/19106/3 "2003-04-24T12:05:44Z")

</div>

that is tha part i do get…

the part i don’t get is to get the nice transition to play… from which button i press to the next…

without the zooming trasition it will loose all its power.

i recon some kind of action script will be needed for that but i’m not sure how to go about with that. 👽

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 24, 2003, 12:20pm UTC](https://forum.kirupa.com/t/zoomin/19106/4 "2003-04-24T12:20:45Z")

</div>

If you mean what I think you mean, then you just have to make each section + transition into a separate movie, place them on the main timeline (off the screen for example), then assign each button an onClick() function with gotoAndPlay() to call up and make visible the correct movie.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 24, 2003, 12:24pm UTC](https://forum.kirupa.com/t/zoomin/19106/5 "2003-04-24T12:24:58Z")

</div>

ok, but if i press button 4 for example then it must play one two and three… if i was sitting on 6 then it must play 5 and 4…

hmmm. maybe i can write an if statement that will check where it is sitting and then play it from there…

hehehe, this is what i love about programming and scripting… have to keep on your toes all the time and its so exciting when you get something right…

thanx for the help… i’ll have to play around a bit and see what i can come up with. 👽

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 24, 2003, 12:45pm UTC](https://forum.kirupa.com/t/zoomin/19106/6 "2003-04-24T12:45:09Z")

</div>

Cool. Post what you make, so we can see it. 🙂

Just keep a flag of the current movie - a single global variable that holds a number to say what movie you’re on. Then check that to see what other movies to run.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 24, 2003, 12:50pm UTC](https://forum.kirupa.com/t/zoomin/19106/7 "2003-04-24T12:50:35Z")

</div>

cool, thanx for that advice i will try it… don’t know when yet, because it was just something i saw and thought i want to do something like that… but if and when i do it i will most definately post a copy of it

👽

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 24, 2003, 5:06pm UTC](https://forum.kirupa.com/t/zoomin/19106/8 "2003-04-24T17:06:29Z")

</div>

do u familiar with function??

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 25, 2003, 1:33pm UTC](https://forum.kirupa.com/t/zoomin/19106/9 "2003-04-25T13:33:04Z")

</div>

i’m familiar with functions… why? what did you have in mind… so far i have a basic setup… zooming from one to two to three to four to five to six, and back… but i only have one button… only need to figure out how to do to make the multiple buttons work…

each level sets a global variable with a number… i traced the values and tested through all levels to make sure the numbers are correct.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 25, 2003, 4:12pm UTC](https://forum.kirupa.com/t/zoomin/19106/10 "2003-04-25T16:12:13Z")

</div>

may be this could make it easier for u…

```auto
MovieClip.prototype.zoom = function(endWidth, endHeight) {
	this.onEnterFrame = function() {
		currentWidth = this._width;
		diffWidth = endWidth-currentWidth;
		zoomWidth = diffWidth/5;
		this._width += zoomWidth;
		//
		currentHeight = this._height;
		diffHeight = endHeight-currentHeight;
		zoomHeight = diffHeight/5;
		this._height += zoomHeight;
	};
};

```

call it

```auto
on (release) {
	zoom(this._width*2, this._height*2);
}

```

or u could insert fix value

```auto
on (release) {
	zoom(200, 40);
}

```

just a suggestion… 😃

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 25, 2003, 5:03pm UTC](https://forum.kirupa.com/t/zoomin/19106/11 "2003-04-25T17:03:39Z")

</div>

thanx… will have a look at that and see how i can include that… never knows… anything possible 🙂

👽

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 25, 2003, 5:31pm UTC](https://forum.kirupa.com/t/zoomin/19106/12 "2003-04-25T17:31:36Z")

</div>

see this fla…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 25, 2003, 5:36pm UTC](https://forum.kirupa.com/t/zoomin/19106/13 "2003-04-25T17:36:31Z")

</div>

hey thanx!

wow… i’m sure i’ll be able to do something with that. 🙂

if you have to see my version you will laugh… so i’m not going to show my version to you… hehehe.

thanx for the help again

👽

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 25, 2003, 5:39pm UTC](https://forum.kirupa.com/t/zoomin/19106/14 "2003-04-25T17:39:39Z")

</div>

good luck with your sofake…😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 25, 2003, 5:49pm UTC](https://forum.kirupa.com/t/zoomin/19106/15 "2003-04-25T17:49:30Z")

</div>

let me know if you wanna visit Kuala Lumpur… hehehe. i buy you lunch or dinner. 👽

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 25, 2003, 5:55pm UTC](https://forum.kirupa.com/t/zoomin/19106/16 "2003-04-25T17:55:15Z")

</div>

hey!! kuala lumpur is not far from jakarta!! unless u take a bike…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 25, 2003, 5:57pm UTC](https://forum.kirupa.com/t/zoomin/19106/17 "2003-04-25T17:57:57Z")

</div>

ok, if you like to do it the hard way, take a bike… else fly… sorry, no transporters like in startrek (yet(), so i can’t beam you up ☹  
👽

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 25, 2003, 6:07pm UTC](https://forum.kirupa.com/t/zoomin/19106/18 "2003-04-25T18:07:53Z")

</div>

```auto
Travel.Prototype.goTo = function(destination){
if(transport<aeroplane){
transport = bike;
goToAndPlay(destination);
else{
transport = transporters;
destination = ! destination;
}
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 25, 2003, 6:16pm UTC](https://forum.kirupa.com/t/zoomin/19106/19 "2003-04-25T18:16:09Z")

</div>

hehehehe… ok, you try that one first 🙂
