detecting a held button 2004-03-05 - By Richard Carr
Back I'm trying to control 2 actions with one button. Playing an mp3 and downloading a zip file. What is the best way to do this?
I've tried double click codes but no luck, (but that is probably due to my not fully understanding the code) Last attempt was using Andreas code plugged in below. If this is the best route to follow, could someone tell me where I'm going astray. (btw, using 2 buttons works, but client now wants only one button for each demo mp3) Thanks! Richard
stopAllSounds();
myData = new LoadVars()
myData.load("zip.php")
myData.ref = this
myData.onLoad = function(succes){ if(succes){ for(var i=0; i<this.cant; i++){ this.ref["Title_txt"+i].htmlText = "<b>"+this["Title"+i]+"</b>" } } limit = 200;
this.ref["holder_mc"+i].sound = this["Sound"+i] this.ref["holder_mc"+i].onPress = function() {//added sT = getTimer(); int1 = setInterval(makeButton, limit) } this.ref["holder_mc"+i].onRelease = function(){ sT = 0; }
function makeButton(){ if(sT == 0){ trace('do the short thing'); mySound = new Sound(); mySound.loadSound(this.image, true); // this._alpha=50; this.loadPlay.gotoAndPlay(2
this.BtnFade.gotoAndStop("press"); this.loadPlay.gotoAndPlay(2); //_root.player.conditionText="PLAYING"; }else{ trace('do the long thing'); this.getURL(this.zip,"_parent"); } clearInterval(int1); }
};
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Supported by Fig Leaf Software -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Lower Prices for Certified Training! Check out new lower prices for Certified Macromedia Training from Fig Leaf Software. Expand your skill set with courses in ColdFusion, Flash, Rich Internet Applications and .NET in the new year. Fig Leaf Software provides the highest caliber instruction at our training centers in Washington D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location.
Get the details at http://training.figleaf.com/ -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe, e-mail: flashnewbie-unsubscribe@(protected) For additional commands, e-mail: flashnewbie-help@(protected)
|
|