View Full Version : Zooming
Joppe
July 14th, 2005, 02:29 PM
Hello!
I have an problem with zooming..
I zoom with the use of
onClipEvent (enterFrame) {
if(_root._yscale >= 150){
_root._yscale = 150}
if(_root._xscale >= 150){
_root._xscale = 150}
if(Key.isDown(90)){
_root._xscale+=25
_root._yscale+=25
}else{
_root._xscale=100
_root._yscale=100
}
_x = _root._xmouse;
_y = _root._ymouse;
}
but then when i press the 'Z' the picture goes to much to the right .. I tried to stabilise it with
_root._x = this._x
_root._y = this._y
but that didnt work..
Does anyone got a sollution for this problem?
NiñoScript
July 14th, 2005, 02:50 PM
im not sure, but what about
_root._x=Stage.width/2-_root._width/2
or maybe
this._x=Stage.width/2
, for something like thati would use Stage instead of _root, becouse the _root is changing, but the stage should be the same... i think...
Joppe
July 14th, 2005, 03:11 PM
uh.. Exactly how do i use that? Im very new with using scaling ..:h:
kingofnukes
July 14th, 2005, 03:22 PM
I had the same problem.
http://kirupa.com/forum/showthread.php?t=184015
I got help in this thred. It should be exactly what your looking for.
Joppe
July 14th, 2005, 03:48 PM
Yes i read your thread and thats how i got started on my zooming but my problem is that the picture that is zoomed goes down in the right down corner.. And i didnt see anywhere that got solved in your thread =-S maybe you could help me
NiñoScript
July 14th, 2005, 07:33 PM
post your fla and or your swf, im no good with abstraction :P
Smee
July 14th, 2005, 07:43 PM
If you mean you want it in the bottom right corner, and when you press whatever key 90 is, it gets larger then...
have the center of the MovieClip be in the bottom right corner, and use:
zoomMin = 1;
zoomMax = 2;
zoomSpeed = .25;
onEnterFrame = function(){
if(Key.isDown(90)){
mcName._xscale += zoomSpeed*100;
mcName._yscale += zoomSpeed*100;
if(mcName._xscale > zoomMax*100){
mcName._xscale = zoomMax*100;
mcName._yscale = zoomMax*100;
}
}else{
mcName._xscale -= zoomSpeed*100;
mcName._yscale -= zoomSpeed*100;
if(mcName._xscale < zoomMin*100){
mcName._xscale = zoomMin*100;
mcName._yscale = zoomMin*100;
}
}
}
charmander
July 16th, 2005, 01:47 AM
hi....
sorry for break your conversation...but i had a question:
this actions you have write it make the zooming for all the game screen.....i mean all object in stage effect by the number of zomming...i tried once befor to make zooming to an objects i want to zomming it only...that by control on the X & Y scale for object like :
this._xscale+=zoom
this._yscale+=zoom
(zoom) is a number i control on it......
but the problem i facing it was the diffrent between the objects sizes...beacause when i add the zoom number to the diffrent object it have grown without a proportion in the full view...and i using the (/) to division the number like this:
this._xscale+=zoom/2
this._yscale+=zoom/2
and the number i defination haven't the better look alot of time....
i was asking if i can control by your way but not in all objects...else the objects i difine..
thank you
Smee
July 16th, 2005, 01:49 AM
I'm not sure I understand, do you mean you want seperate objects to scale at different rates, or just scale at different times?
charmander
July 16th, 2005, 01:52 AM
i mean i want to seperated it in different rate...at same time.....i just want to let some objects without scaling...and scale the others normaly
Smee
July 16th, 2005, 04:11 PM
Can you put the MovieClips you don't want scaled in one MovieClip, and the ones you do want scaled in another, then scale the latter?
charmander
July 16th, 2005, 04:23 PM
no i can't.....the objects must be single..because there are some actions demands the objects being in the premier stage......
Smee
July 16th, 2005, 04:30 PM
I still don't understand. Would either of these be what you're looking for? (Just the animation)
charmander
July 16th, 2005, 04:56 PM
i will explain it for you smee.......
did you know about (fifa) game?
the board thats the score table and time are in , and the power board....when the camera zooming in or out it's still freezing and didn't get change....
Smee
July 16th, 2005, 05:04 PM
Well, the way I would do that is have the game playing in a scaling MovieClip, and then have the score board seperate so it won't be affected. Doesn't that work?
charmander
July 16th, 2005, 05:22 PM
it's acttually in another movie clip.......
and i do the zomming in all objects all in itself.....i was wondred about the proportion between the all objects when i scaleing it.......
when i tried it the small object have been biggest comparing the big object after scaling.....i wish you understand me.....
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.