[Flashcoders] buttons not able to control movieclip's timeline
i have 2 buttons (prev and next) that should control the timeline of a moviclip called container but it just doesn't work. at first it moves to the second frame on this movieclip then the container shows always the same content ( it has different content for each frame), the content of the second frame. though , the output panel shows: prev. cf: 2 next. cf: 1 function btnContainerClick(e:MouseEvent):void { if (e.target.name == btn_prev) trace (prev. cf: + container.currentFrame); //container.gotoAndStop(container.currentFrame - 1); container.prevFrame(); //container.gotoAndStop(2); if (e.target.name == btn_next) trace (next. cf: + container.currentFrame); //container.gotoAndStop(container.currentFrame + 1); container.nextFrame(); //container.gotoAndStop(5); } i get absolutely no clue of what's going on and i'm getting nuts. i really appreciate any help. thanks a lot. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] buttons not able to control movieclip's timeline
Should if (e.target.name == btn_next) be if (e.currentTarget.name http://e.target.name/ == btn_next) It's just a guess as I can't see the fla. Jer On Thu, Aug 13, 2009 at 9:15 AM, Isaac Alves isaacal...@gmail.com wrote: if (e.target.name == btn_next) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] buttons not able to control movieclip's timeline
Isaac, You need to enclose each if block with braces {}. You can only get away without them when there is only one line of code to execute following the if. Without the braces your function simply outputs the trace() (depending which button is pressed) but will run container.prevFrame(); AND container.nextFrame(); every time no matter which button is pressed. function btnContainerClick(e:MouseEvent):void { if (e.target.name == btn_prev){ trace (prev. cf: + container.currentFrame); //container.gotoAndStop(container.currentFrame - 1); container.prevFrame(); //container.gotoAndStop(2); } if (e.target.name == btn_next){ trace (next. cf: + container.currentFrame); //container.gotoAndStop(container.currentFrame + 1); container.nextFrame(); //container.gotoAndStop(5); } } - Keith -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Isaac Alves Sent: Thursday, August 13, 2009 9:16 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] buttons not able to control movieclip's timeline i have 2 buttons (prev and next) that should control the timeline of a moviclip called container but it just doesn't work. at first it moves to the second frame on this movieclip then the container shows always the same content ( it has different content for each frame), the content of the second frame. though , the output panel shows: prev. cf: 2 next. cf: 1 function btnContainerClick(e:MouseEvent):void { if (e.target.name == btn_prev) trace (prev. cf: + container.currentFrame); //container.gotoAndStop(container.currentFrame - 1); container.prevFrame(); //container.gotoAndStop(2); if (e.target.name == btn_next) trace (next. cf: + container.currentFrame); //container.gotoAndStop(container.currentFrame + 1); container.nextFrame(); //container.gotoAndStop(5); } i get absolutely no clue of what's going on and i'm getting nuts. i really appreciate any help. thanks a lot. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] buttons lined up next to each other- rollout not work
Try using a variable local to the for loop for the target: //this also sets the event handling in one shot for (i=0; i5; i++) { clipName = this[clip+i]; var myTarget= _root[text+i] trace(target); clipName.onRollOver = function() { Tweener.addTween(this.person,{_alpha:100, delay:0, time:2}); Tweener.addTween(this.whiteborder,{_alpha:100, delay:0, time:2}); Tweener.addTween(myTarget,{_alpha:100, delay:0, time:2}); trace(onrollover+myTarget); }; clipName.onRollOut = function() { Tweener.addTween(this.person,{_alpha:30, delay:0, time:1}); Tweener.addTween(this.whiteborder,{_alpha:0, delay:0, time:1}); Tweener.addTween(myTarget,{_alpha:0, delay:0, time:2}); }; } My guess is target is declared outside the for loop, so you're having some problems with closure. I don't know if AS's closure works the same way as C#'s, but if it does then this could be the problem. This article is specific to C#, but it does a good job of going over how closures and anonymous methods work, and might be helpful to understand this (assuming I'm right in that AS's behavior matches C#'s for closure) http://www.theserverside.net/tt/articles/showarticle.tss?id=AnonymousMethods search for the Captured local variables and code visibility section for an example of the possible differences between what you have and what I suggested. -Andy On Jan 16, 2008 2:13 AM, Dwayne Neckles [EMAIL PROTECTED] wrote: OK on rollover the correponding text clip fades in on rollout it fades out.. during debuging.. all of the targets are text4 and it shouldnt be.. clip0 should control text0 and etc.. but what happens is that clip0 to clip4 controls text4... which is wrong, any suggestions? Code below: //this also sets the event handling in one shot for (i=0; i5; i++) { clipName = this[clip+i]; target= _root[text+i] trace(target); clipName.onRollOver = function() { Tweener.addTween(this.person,{_alpha:100, delay:0, time:2}); Tweener.addTween(this.whiteborder,{_alpha:100, delay:0, time:2}); Tweener.addTween(target,{_alpha:100, delay:0, time:2}); trace(onrollover+target); }; clipName.onRollOut = function() { Tweener.addTween(this.person,{_alpha:30, delay:0, time:1}); Tweener.addTween(this.whiteborder,{_alpha:0, delay:0, time:1}); Tweener.addTween(target,{_alpha:0, delay:0, time:2}); }; } Date: Tue, 15 Jan 2008 21:32:41 -0800 To: flashcoders@chattyfig.figleaf.com From: [EMAIL PROTECTED] Subject: Re: [Flashcoders] buttons lined up next to each other- rollout not work No such problem here with either adjacent or overlapping buttons. Please post your code. Here's mine for four buttons named btn1, btn2, etc.: for (i = 1; i 5; i++) { this[btn + i].onRollOut = function() { trace(this._name); }; } Marc At 09:06 PM 1/15/2008, you wrote: This is probably a classic issue.. I have 5 buttons lined up next to each with no space between but they arent overlapping. I have rollover and rollout events.. but the rollout event doesnt work when i roll over to the next button.. the onrollout event works only when i rollout on to negative space..which sucks is there a workaround ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _ Share life as it happens with the new Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] buttons lined up next to each other- rollout not work
This is probably a classic issue.. I have 5 buttons lined up next to each with no space between but they arent overlapping. I have rollover and rollout events.. but the rollout event doesnt work when i roll over to the next button.. the onrollout event works only when i rollout on to negative space..which sucks is there a workaround _ Watch “Cause Effect,” a show about real people making a real difference. http://im.live.com/Messenger/IM/MTV/?source=text_watchcause___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] buttons lined up next to each other- rollout not work
No such problem here with either adjacent or overlapping buttons. Please post your code. Here's mine for four buttons named btn1, btn2, etc.: for (i = 1; i 5; i++) { this[btn + i].onRollOut = function() { trace(this._name); }; } Marc At 09:06 PM 1/15/2008, you wrote: This is probably a classic issue.. I have 5 buttons lined up next to each with no space between but they arent overlapping. I have rollover and rollout events.. but the rollout event doesnt work when i roll over to the next button.. the onrollout event works only when i rollout on to negative space..which sucks is there a workaround ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] buttons lined up next to each other- rollout not work
OK on rollover the correponding text clip fades in on rollout it fades out.. during debuging.. all of the targets are text4 and it shouldnt be.. clip0 should control text0 and etc.. but what happens is that clip0 to clip4 controls text4... which is wrong, any suggestions? Code below: //this also sets the event handling in one shot for (i=0; i5; i++) { clipName = this[clip+i]; target= _root[text+i] trace(target); clipName.onRollOver = function() { Tweener.addTween(this.person,{_alpha:100, delay:0, time:2}); Tweener.addTween(this.whiteborder,{_alpha:100, delay:0, time:2}); Tweener.addTween(target,{_alpha:100, delay:0, time:2}); trace(onrollover+target); }; clipName.onRollOut = function() { Tweener.addTween(this.person,{_alpha:30, delay:0, time:1}); Tweener.addTween(this.whiteborder,{_alpha:0, delay:0, time:1}); Tweener.addTween(target,{_alpha:0, delay:0, time:2}); }; } Date: Tue, 15 Jan 2008 21:32:41 -0800 To: flashcoders@chattyfig.figleaf.com From: [EMAIL PROTECTED] Subject: Re: [Flashcoders] buttons lined up next to each other- rollout not work No such problem here with either adjacent or overlapping buttons. Please post your code. Here's mine for four buttons named btn1, btn2, etc.: for (i = 1; i 5; i++) { this[btn + i].onRollOut = function() { trace(this._name); }; } Marc At 09:06 PM 1/15/2008, you wrote: This is probably a classic issue.. I have 5 buttons lined up next to each with no space between but they arent overlapping. I have rollover and rollout events.. but the rollout event doesnt work when i roll over to the next button.. the onrollout event works only when i rollout on to negative space..which sucks is there a workaround ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _ Share life as it happens with the new Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] buttons not active on mac
I have a site at http://venues.or-media.com http://venues.or-media.com/ that doesn't work on a mac, you're supposed to be able to click on one those logos and the site loads the relevant xml document to build itself. You can drill straight to the main site by going to http://venues.or-media.com?venue=savoy http://venues.or-media.com/?venue=savoy and still no joy - none of the buttons are clickable on mac, yet it works perfectly on PC Has anyone seen this before? Does anyone have any ideas.. I've racked my brains and now they're melting! Any suggestions would be gratefully appreciated. T ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] buttons not active on mac
On my PC (FireFox) I have two errors... maybe a symptome... it's a long shot! Erreur : invalid flag after regular expression Fichier source : http://venues.or-media.com/?venue=savoy Ligne : 45, Colonne : 10 Code source : bNotice/b: Undefined variable: currVenue in bE:\Inetpub\ietvenues\index.php/b on line b78/bbr / AND Erreur : init is not defined Fichier source : http://venues.or-media.com/?venue=savoy Ligne : 1 A+ Trevor Burton a écrit : I have a site at http://venues.or-media.com http://venues.or-media.com/ that doesn't work on a mac, you're supposed to be able to click on one those logos and the site loads the relevant xml document to build itself. You can drill straight to the main site by going to http://venues.or-media.com?venue=savoy http://venues.or-media.com/?venue=savoy and still no joy - none of the buttons are clickable on mac, yet it works perfectly on PC Has anyone seen this before? Does anyone have any ideas.. I've racked my brains and now they're melting! Any suggestions would be gratefully appreciated. T ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] Buttons
Good morning, There is two buttons on the same level wich launch a function : btn2.onRelease=btn1.onRelease =function () { play (); }; I put a button at the level40 and it doesnt work, do you ssee why ? _level40.btn2.onRelease=btn1.onRelease =function () { play (); }; Thank you ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Buttons
Good morning, There is two buttons on the same level wich launch a function : btn2.onRelease=btn1.onRelease =function () { play (); }; I put a button at the level40 and it doesnt work, do you ssee why ? _level40.btn2.onRelease=btn1.onRelease =function () { play (); }; I'd imagine that it's working but playing its own parent rather than the level where you wrote the function (or vice versa: what were you hoping it would do?). Have you tried this?: var thisFunction=function () { play ()} _level40.btn2.onRelease=btn1.onRelease=thisFunction If not, then try adding a trace(this) and see what you get Danny ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders