PDA

View Full Version : Timer


Bernie
05-06-2008, 05:30 PM
I am trying to set a timer inside this string can somebody help me, I have tryed many different things and no one worked.

this is the line where I need the timer.
I want to set it between change:0,pan,0,400 and change:0,tilt,180,500;
myArray[1] = "change:0,pan,0,400;change:0,tilt,180,500;change:0, zoom,0.6,600,easeOutCubic";

This a is all the actionscript in my movie

import _class.XMLConstruct;
import com.mosesSupposes.fuse.*;
ZigoEngine.simpleSetup(Fuse,Shortcuts,PennerEasing );
////
var posiciones:Array = Array();
posiciones[1] = [[97.8, 100.3, 155.2], [108.2, 40, 100], [54.9, 28.6, 100], [37.1, 68.5, 131]];
posiciones[2] = [[102.8, 39.45, 82], [41.15, 106, 124], [49.1, 48.65, 117], [107.25, 91.05, 131]];
posiciones[3] = [[45.95, 112.4, 107], [112.6, 33.55, 100], [43.6, 42.25, 146], [98, 88.75, 131]];
posiciones[4] = [[33.4, 116.35, 107], [30.65, 68.95, 121], [92.35, 112.8, 110], [101.25, 47, 182]];
//
var color:Array = Array();
color[1] = "#C22116";
color[2] = "#B3E129";
color[3] = "#F9DE23";
color[4] = "#47C3FF";
//
var que_seccion:Number = 0;
////
/////
// Use the same name in spots.xml: <global controller="lc_test">
// Better use different controller names for different panorama applications
var controllerName = "lc_test";
// Master slot name:
var masterSlot:String;
// Slave slot name:
var slaveSlot:String;
// Begin of connection code (better use it as is).
var dumpSlot = controllerName+"_dump_"+random(1000000);
var _lc = new LocalConnection();
_lc.allowDomain = function() {
return true;
// allow all connections
};
_lc.connect(dumpSlot);
_lc.onStatus = function(info) {
if (info.level == "error") {
trace("No master connection detected.");
_lc.close();
delete _lc;
}
};
_lc.setSlot = function(slot) {
masterSlot = controllerName+"_master_"+slot;
slaveSlot = controllerName+"_slave_"+slot+"_"+random(1000000);
_lc.close();
_lc.connect(slaveSlot);
trace("set slave: "+slaveSlot);
startWatch();
};
_lc.send(controllerName+"_master_0","getSlot",dumpSlot);
// end of connecion code
var panoName:String;
// current pano name
var panoBusy:Boolean;
// true if panorama is loading or a transition effect is in process
var iid:Number;
// interval id
// start watching parameters "panoName" and "panoBusy":
function startWatch() {
iid = setInterval(this, "sendQuery", 500);
}
// send query:
function sendQuery() {
// 3rd argument is array of askable parameters, 4th and 5th are connection name to callback
_lc.send(masterSlot,"getParams",["pano.panoName", "pano2.panoName"],slaveSlot,"callback");
}
// listener function:
_lc.callback = function(values) {
// store panoName
panoName = values[1] != null ? values[1] : values[0];
// if the second panorama is not null, set busy flag:
panoBusy = values[1] != null;
};
// remove focus manager, let the panorama has the focus
focusManager.enabled = false;
focusManager = null;
///
var myArray:Array = Array();
myArray[1] = "change:0,pan,0,400;change:0,tilt,180,500;change:0, zoom,0.6,600,easeOutCubic";
myArray[2] = "change:0,pan,85,500;change:0,tilt,0,500;change:0,z oom,0.6,600,easeOutCubic";
myArray[3] = "change:0,pan,-90,500;change:0,tilt,0,500;change:0,zoom,0.6,600,e aseOutCubic";
myArray[4] = "change:0,pan,0,500;change:0,tilt,-190,500;change:0,zoom,0.6,600,easeOutCubic";
for (i=1; i<=4; i++) {
var botonera:MovieClip = eval("btn_"+i);
var XYscale:Number = posiciones[1][[i-1][0]];
botonera.tween(["_x", "_y", "_scale"],XYscale,1,"easeOutCubic");
botonera.colorTo(color[que_seccion],0);
//
botonera.onRelease = function() {
_lc.send(masterSlot,"execute",myArray[this._name.slice(4, 5)]);
//
sending_di.send("lc_di", "methodToExecute");
sending_il.send("lc_il", "methodToExecute");
sending_re.send("lc_re", "methodToExecute");
sending_we.send("lc_we", "methodToExecute");
//
var que_boton:Number = Number(this._name.slice(4, 5));
que_seccion = que_boton;
for (i=1; i<=4; i++) {
var botonera:MovieClip = eval("btn_"+i);
botonera.enabled = true;
var XYscale:Number = posiciones[que_boton][[i-1][0]];
botonera.tween(["_x", "_y", "_scale"],XYscale,2,"easeOutCubic");
botonera.colorTo(color[que_seccion],2);
}
this.enabled = false;

};
botonera.onRollOver = function() {
this.colorTo(color[this._name.slice(4, 5)],0);
};
botonera.onRollOut = function() {
this.colorTo(color[que_seccion],0);
};
}

// Code in the sending SWF file
var sending_di:LocalConnection = new LocalConnection();
var sending_il:LocalConnection = new LocalConnection();
var sending_re:LocalConnection = new LocalConnection();
var sending_we:LocalConnection = new LocalConnection();


thanks