Mailing List
Home
Forum Home
Flash Pro
Subjects
Subject: RE: Firework Effect
Web Service Results
Flash Interface with 10mb xml file
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash MX 2004 Sucks
Reading and displaying RSS feeds in Flash MX
Flash and QuickTime VR
Textfield prototype question
XML to Object help
Order of events per frame
MX2004 Dataset itemClassName
memory management removeMovieClip /
Event Dispatcher between classes
Help: MX 2004 How to script a print button to print the entire sli
ScrollPane component doesn 't auto update
setInterval bug identified and fixed
setInterval bug identified and fixed
Listener Object 's best practice
 
detecting a held button

detecting a held button

2004-03-05       - By Richard Carr

 Back
Reply:     1     2     3     4     5     6     7     8     9     10  

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)