View Full Version : controling timeline via mouse x position ??
flyingzenmonkey
May 15th, 2005, 04:34 AM
Hi i want to know if anyone can tell me how to controll the timeline via moving the moiuse in x (left to right ).
basicly i wsant to shocase a sculpture of mine in a seemingly quicktime vr fasion. so i will take lots of images of the sculpture in difrent agles to get the 360 degreemovie. then import intoflash timeline. Then somehow i need a script to control the scrub the timeline images (to create the quicktime vr look )
please help my project has to be in soon ..
Louis
SmoothDime
May 15th, 2005, 04:57 AM
var numFrames = _root.myClip_mc._totalFrames;
var stageWidth = Stage.width;
_root.onEnterFrame = function()
{
var newFrame = Math.round((stageWidth/this._xmouse)*numFrames);
_root.myClip_mc.gotoAndStop(newFrame);
}
devonair
May 15th, 2005, 05:09 AM
hey, flyingzenmonkey,
I always "fake" this kind of thing like so..
Make a retangular movie clip as wide as your vr movie clip is long (so, if your vr clip is 50 frames, make a rectangle any height you want, and 50 pixels wide - make sure you set the registration point to 0, 0). Now drag this clip onto the stage over top of your vr mc, free transform it so it fits right over top of your vr clip and give it an instance name of something like "controller_mc".. then use this..
controller_mc._alpha=0;
controller_mc.useHandCursor=false;
controller_mc.onRollOver=function(){
this.onEnterFrame=function(){
this._parent.vr_mc.gotoAndStop(Math.round(this._xm ouse));
}
}
controller_mc.onRollOut=controller_mc.onDragOut=fu nction(){
delete this.onEnterFrame;
}
The "trick" here is that movie clips retain their own coordinate system even when resized on the stage (i.e. a 50 px wide rectangle stretched to 300 px on the stage will still have a max _xmouse position of 50)..
Hope that made some sense and helps out..
d.
flyingzenmonkey
May 17th, 2005, 08:36 AM
Thanks so much but cant get to work .. can anyone give me an fla file ??
thanks
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.