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  

Thanks Andreas,
As you know this works when I test it in a fla. When I try to lace it into
my code, I no longer get the button acting like a button, no hand cursor, no
action. I must be using it incorrectly, but I'm not seeing it. Tried several
variations. Would you mind looking at this again? Thanks!



 this.ref["holder_mc"+i].sound = this["Sound"+i]
this.ref["holder_mc"+i].onPress = function() {
clicked ++;
if(clicked == 1){
int1 = setInterval(test2, limit)

}
}
this.ref["holder_mc"+i].onRelease = function(){


function test2(){
if(clicked == 1){
trace('do the one-click thing');
       mySound = new Sound();
         mySound.loadSound(this.image, true);
         this._alpha=50;
   this.loadPlay.gotoAndPlay(2);
   this.BtnFade.gotoAndStop("press");
 this.loadPlay.gotoAndPlay(2);


  }else{
trace('do the double-click thing');
 this.getURL(this.zip,"_parent");

clicked = 0;
clearInterval(int1);
}
}
}
};

-- -- Original Message -- --
From: "Andreas Weber" <webweber@(protected)>
To: "Flashnewbie" <flashnewbie@(protected)>
Sent: Friday, March 05, 2004 1:05 PM
Subject: [Flashnewbie] detecting a held button


> The 'held-button' was really only because someone specifically asked for
> this behavior.
>
> I guess in most situations a 'double-click' versus 'single-click' would be
> more intuitive for the users.
> (the 'held-button' code is changed a bit, the getTimer() is unnecessary)
>
> Find the code for both below.
>
> HTH
> -- ---- ------
> Andreas Weber
> motiondraw.com
>
>
>
> // double-click or single-click?
>
> limit = 200;
> clicked = 0;
>
> myButton2_mc.onPress = function(){
> clicked ++;
> if(clicked == 1){
> int1 = setInterval(test2, limit)
> }
> }
> myButton2_mc.onRelease = function(){
> // whatever
> }
>
> function test2(){
> if(clicked == 1){
> trace('do the one-click thing');
> }else{
> trace('do the double-click thing');
> }
> clicked = 0;
> clearInterval(int1);
> }
>
>
>
>
> // if pressed longer than a certain time
> // do something else than if clicked only shortly
> limit = 200;
> myButton1_mc.onPress = function(){
> released = false;
> int1 = setInterval(test, limit)
> }
> myButton1_mc.onRelease = function(){
> released = true;
> }
>
> function test(){
> if(released){
> trace('do the short thing');
> }else{
> trace('do the long thing');
> }
> 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)
>
>


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
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)