Removing an event listener from buttons
Hi.
I´d like to know if it´s necessary to remove event listeners from buttons.
I know it's good practice to remove event listeners when its use is over.
But it´s necessary to remove event listeners for buttons as well?
Thanks
it's necessary if you want to ready your buttons for gc.
Similar Messages
-
Remove event listener from loaded external swf
I have a main movie timeline that loads an external swf. When I unload the swf from the main timeline I get an error from this: my_FLVPlybk.addEventListener(VideoEvent.COMPLETE, vidEnd);
is there any way to remove the event listener from the loaded swf from the main timeline?
THANKS!if you're publishing for fp 10+, use unloadAndStop() applied to your swf's loader. that has a fair chance of solving the problem.
if that fails, you should explicitly stop my_FLVPlybk. -
Can't remove event listener from Image
I'm clearly missing something and would appreciate some help. I'm trying to run an event handler when an Image completes loading, then remove the handler so that it won't run again should the image be reloaded later.
The problem that I'm having is that the event handler simply wont' go away, despite calling removeEventListener on the Image object.
The following example demonstrates the problem (the example doesn't actually do anything useful...it's just the shortest example to demonstrate the problem). (To run the app, you'll have to provide any ol' JPEG file named "myImage.jpg" in the "src" directory of your project).
What I expect to happen is :
1) on startup, the image loads and loadComplete() runs.
2) loadComplete removes the event Listener so that subsequent re-loads won't re-fire the handler. I only want the handler to run once.
3) "loadComplete" shoudl be displayed in the Debug console.
4) A button click should display only "Changing Image" in the Debug console
What I get instead is that the loadComplete handler isn't removed, and every time I click the button, loadComplete runs when the image is re-loaded (i.e., every button click results in both "Change Image" AND "loadComplete" being displayed in the Debug console).
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Image width="655" height="181" source="myImage.jpg" id="myImage" autoLoad="true" scaleContent="true" complete="loadComplete()" x="100" y="100"/>
<mx:Button x="100" y="341" label="Button" click="click(event)"/>
<mx:Script>
<![CDATA[
private function loadComplete():void
trace ("loadComplete");
myImage.removeEventListener("complete", loadComplete);
private function click(evt:Event):void
trace ("Changing Image");
myImage.load("myImage.jpg"); // Reload same image; it's just an example
]]>
</mx:Script>
</mx:Application>Hi,
You can remove only event listeners that you added with the addEventListener() method in an ActionScript block. You cannot remove an event listener that was defined in the MXML tag, even if it was registered using a call to the addEventListener()method that was made inside a tag attribute.
Check this page for reference.
http://livedocs.adobe.com/flex/3/html/help.html?content=events_05.html
You can modify the code a bit a get it working
<mx:Image width="655" height="181" id="myImage" scaleContent="true"
x="100" y="100"
creationComplete="myImage_creationCompleteHandler(event)"/>
private function myImage_creationCompleteHandler(event:FlexEvent):void
myImage.addEventListener("complete",myImage_completeHandler);
myImage.load("myImage.jpg");
private function myImage_completeHandler(event:Event):void
myImage.removeEventListener("complete",myImage_completeHandler); -
Revision: 23085
Revision: 23085
Author: [email protected]
Date: 2011-10-21 07:49:33 -0700 (Fri, 21 Oct 2011)
Log Message:
Fix test to explicitly remove an event listener after the test is finished. Not doing this was causing the test to throw an RTE.
Modified Paths:
blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/messagingService/security/stream ing-amf/MessagingAuthProSendTest.mxmlThanks for the ideas regarding beforeInvoke, Ben. I will try to check that out. In my situation, here's essentially how my script is working...
BeforeSave is invoked.
Script makes a change to the document, which should be captured in the saved file.
Document saves.
Document appears saved for a moment, and then appears unsaved (asterisk in the document title).
My biggest problem is that this behavior isn't consistent. I have dozens of users, all running the same script, and the problem only occurs with certain users and at random times. I can move a problematic document from a user's machine to a different machine, and the problem doesn't occur there. It's very difficult to troubleshoot because I can't reproduce it consistently. -
Remove the key listener from JTable problem please help
Hi
I�m trying to remove the key listener from my table, it doesn�t work,
I�m pressing the enter key it still goes to the next row from the table,
hear is my code
KeyListener[] mls = (KeyListener[])(table.getListeners(KeyListener.class));
for(int i = 0; i < mls.length; i++ )
table.removeKeyListener(mls);
Please help thanksHm ...
that should indeed remove all the KeyListeners from your table - the question is only, when does this happen?- Where in your code do you remove the KeyListeners?- I am quite sure, you remove them successfully, but after your have removed them, one or more KeyListeners are added to the table.
greetings Marsian -
Removing event listener from a button.
I've added a "click" event listener to a button, but I'd like to remove it once the button is clicked, so it's not active/clickable any longer. Here's the basic code:
sym.$('button').click(function(){
//here I need to make this button not clickable any longer
Thank you.one way...
sym.$('button').click(function(){
//here I need to make this button not clickable any longer
// do smething here then unbind click handler
sym.$('button').unbind( "click" );
unbind documentation here.
hth
Darrell -
How to remove an event listener
I have a series of buttons. When a button is clicked a component (instructorView) is loaded into a container named passageContainer:
passageContainer.addChild(instructorView);
Each time I load a new component, I remove the old component first:
passageContainer.removeAllChildren();
The component includes an eventListener which is triggered when a key is pressed.
The first time I load a component and press a key the event is triggered once.
The second time the event is triggered twice.
The third time the event is triggered three times, and so on.
I'm almost certain that the eventListeners are not being removed although the components are removed. So the event listeners execute multiple times.
Is it possible for the eventListeners to remain after the components have been removed? If so, how can I remove them?
Thanks!It means the components are still in the memory, they are tightly coupled, you need to do makesure that the event listeners are loosely coupled/weakreferenced.
http://www.selikoff.net/2010/09/21/flex-event-handlers-and-weak-references/
(OR) you have to remove the listeners manually, by doing this.removeEventLIstener(...... on each and every component to all the events that are registered in the component before you remove it from the memory.
Message was edited by: saisri2k2 -
Cant remove enterframe event listener in control animation
Hi
I am trying to create a simple play, stop, rewind. fforward controller. I have the slideShow and the Control in the same time line.
As the enterframe event is nested inside a function it will rewind but then none of the other buttons will work as I am not able to removeEventListener for the enterframe event. Thanks for looking. Regards
stop();
btnStop.addEventListener(MouseEvent.CLICK,StopSlideShow)
btnPlay.addEventListener(MouseEvent.CLICK,PlaySlideShow)
btnRewind.addEventListener(MouseEvent.CLICK,RewindSlideShow)
function PlaySlideShow(e:MouseEvent):void
play();
function StopSlideShow(e:MouseEvent):void
stop();
function RewindSlideShow(e:MouseEvent):void
addEventListener(Event.ENTER_FRAME,keeprewinding);
function keeprewinding(e:Event):void
prevFrame();
if(currentFrame ==1)
removeEventListener(Event.ENTER_FRAME,keeprewinding);stop();
btnStop.addEventListener(MouseEvent.CLICK,StopSlideShow);
btnPlay.addEventListener(MouseEvent.CLICK,PlaySlideShow);
btnRewind.addEventListener(MouseEvent.CLICK,RewindSlideShow);
function PlaySlideShow(e:MouseEvent):void
removeEventListener(Event.ENTER_FRAME,keeprewinding);
play();
function StopSlideShow(e:MouseEvent):void
removeEventListener(Event.ENTER_FRAME,keeprewinding);
stop();
function RewindSlideShow(e:MouseEvent):void
addEventListener(Event.ENTER_FRAME,keeprewinding);
function keeprewinding(e:Event):void
if (currentFrame == 1)
removeEventListener(Event.ENTER_FRAME,keeprewinding);
prevFrame(); -
How to remove an event listener of Enter Frame
basically, i doing a three level game. 1st level is dodging the stone from sky, Secondly, samsh the wolf head. However, when i enter leve1 2 game, it show me an error.
TypeError: Error #2007: Parameter hitTestObject must be non-null.as:113 Cant access to null object or reference.as.83
I think due to when i enter level 2, the object is not available anymore, so happen this errors,izzit? how i gonna fix this?
package
import flash.display.MovieClip;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.ui.Mouse;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.events.Event;
public class level1 extends MovieClip
var vx:int;
var vy:int;
var collisionHasOccurred:Boolean;
var score:uint;
public function level1()
init();
function init():void
//Initialize variable
vx=0;
vy=0;
collisionHasOccurred=false;
stone.stop();
score=0;
optionPage.visible=false;
//Add event listeners
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
wolf2.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function onKeyDown(event:KeyboardEvent):void
if(event.keyCode==Keyboard.LEFT)
vx=-5;
else if (event.keyCode==Keyboard.RIGHT)
vx=5;
else if (event.keyCode==Keyboard.UP)
vy=-5;
else if (event.keyCode==Keyboard.DOWN)
vy=5;
function onKeyUp(event:KeyboardEvent):void
if (event.keyCode==Keyboard.LEFT || event.keyCode==Keyboard.RIGHT)
vx=0;
else if (event.keyCode==Keyboard.DOWN || event.keyCode==Keyboard.UP)
vy=0;
function onEnterFrame(event:Event):void
trace(player);
trace(cursor);
trace(aaa);
trace(wolf2);
trace(wolf);
//Move the player
player.x+=vx; <-------------------------------------------------------------this is line 83
player.y+=vy;
//collision detection
if (stone.hitTestObject(player))
player.gotoAndStop(3);
health.meter.width-=2;
if (! collisionHasOccurred)
score++;
messageDisplay.text=String(score);
collisionHasOccurred=true;
else
player.gotoAndStop(1);
collisionHasOccurred=false;
if (health.meter.width <=1)
New.text="Game Over!";
stop();
fl_CountDownTimerInstance_3.stop();
if (player.hitTestObject(wall)) <-------------------------------------------------this is line 113
player.x-=vx;
player.y-=vy;
if (player.hitTestObject(wallA))
player.x-=vx;
player.y-=vy;
if (player.hitTestObject(wallB))
player.x-=vx;
player.y-=vy;
if (player.hitTestObject(wallC))
player.x-=vx;
player.y-=vy;
if (player.hitTestObject(wallD))
player.x-=vx;
player.y-=vy;
if (player.hitTestObject(wallE))
player.x-=vx;
player.y-=vy;
if (player.hitTestObject(wallF))
player.x-=vx;
player.y-=vy;
if (player.hitTestObject(wallG))
player.x-=vx;
player.y-=vy;
if (player.hitTestObject(wallH))
player.x-=vx;
player.y-=vy;
function fl_MouseClickHandler(event:MouseEvent):void
score++;
aaa.text=String(score);
trace("Mouse clicked");instead of:
if (player.hitTestObject(wall))
use:
if(player&&wall){
if (player.hitTestObject(wall)) -
How to remove a node apps listener from CRS.
We have a node apps in type of listener offline shown from crs_stat -t:
ldctrdb01|PDAMLDV11|/u01/crs/product/10.2.0/bin $ crs_stat -t
Name Type Target State Host
ora....11.inst application ONLINE ONLINE ldctrdb01
ora....12.inst application ONLINE ONLINE ldctrdb02
ora....LDV1.db application ONLINE ONLINE ldctrdb02
ora....SM1.asm application ONLINE ONLINE ldctrdb01
ora....01.lsnr application ONLINE OFFLINE
ora....01.lsnr application ONLINE ONLINE ldctrdb01
ora....b01.gsd application ONLINE ONLINE ldctrdb01
ora....b01.ons application ONLINE ONLINE ldctrdb01
ora....b01.vip application ONLINE ONLINE ldctrdb01
ora....SM2.asm application ONLINE ONLINE ldctrdb02
ora....02.lsnr application ONLINE OFFLINE
ora....02.lsnr application ONLINE ONLINE ldctrdb02
ora....b02.gsd application ONLINE ONLINE ldctrdb02
ora....b02.ons application ONLINE ONLINE ldctrdb02
ora....b02.vip application ONLINE ONLINE ldctrdb02
I want to delete it from the list by using netca. But this listener would not be able to show from netca. The netca can only show the other listener that is currently used and also shown in the crs_stat. How to remove the offline listener from crs_stat list?
Thanks for advice!I run the netca from both $ORACLE_HOME and $ASM_HOME earlier. But now, none of the home can detect the listener to be deleted. However, if I try to add a listener with that name, the netca replied with " the listener already exist...".
We have a symbolic link from $ORACLE_HOME/network/admin to $ASM_HOME/network/admin ($TNS_ADMIN) for the files tnsnames.ora and listener.ora. -
How to remove event listener when all the MoviClip are off the stage
Hi i am newbie to as3,
I am creating animation using as3 in which i duplicate the circle ten time,then pushing into an array and giving random motion. When all the duplicate object goes outside the stage then i should remove the event listener. But right now when one duplicate object goes off the stage the event listener is removed. Thanks in advance//---------code for creating random bubble movement------//
var bubbleNo:Number = 10;
var vx:Number = .3;
var vy:Number = .5;
var bubbles:Array = new Array();
var bubbleRadius:Number = 9;
var myColor:ColorTransform = this.transform.colorTransform;
init();
function init():void {
for(var i:Number = 0; i<bubbleNo; i++){
var bubble = new newBall();
bubble.x = Math.random() * stage.stageWidth;
bubble.y = Math.random() * stage.stageHeight;
//bubble.color = Math.random
//trace("bubble.x=="+bubble.x+"bubble.y=="+bubble.y);
bubbles.push(bubble);
myColor.color = Math.random() * 0xFFFFFF
bubble.transform.colorTransform = myColor;
addChild(bubble);
addEventListener(Event.ENTER_FRAME,createBubble);
//addEventListener(Event.ENTER_FRAME,createBubble);
function createBubble(event:Event):void{
for(var k:Number = bubbles.length-1; k>0; k--){
var bubble = (newBall)(bubbles[k]);
bubble.x += vx;
bubble.y += vy;
if(bubble.x - 18 > stage.stageWidth || bubble.x + 18 < 0 || bubble.y - 18 > stage.stageHeight || bubble.y + 18 < 0){
removeChild(bubble);
bubbles.splice(k, 1);
//trace("out"+bubbles.length);
if(bubbles.length <= 0 );
removeBubble();
trace(bubbles.length);
//removeEventListener(Event.ENTER_FRAME,createBubble)
trace("all Bubbles cleared");
function removeBubble():void{
removeEventListener(Event.ENTER_FRAME,createBubble) -
Removing a Button Event Listener on a Specific Frame and Reactivating it on Next Frame
Hi , i am trying to develop a Slideshow where Next Button needs to behave in a certain way on a specific Frame , lets say a Specific Condition is met only then Next Button would work , I have been able to achieve that but problem is the Button Retains its Event Listener even on the next Frame , whereas i have already included removeEventListener on the next frame with a new Function for the button , but its doesnt take it like that.
Can anyone help please ?Hello Ned,
I have fixed the issue with few Frame , but where we have the conditions to be met on two consecutive frames , I am not able to achieve that.
here is the Code on my first Frame.
FRAME1
stop();
slidecounter.text = String(this.currentFrame - 1 + "/" + indexframe);
mc_prog.width = 0;
//LIBRARIES TO BE IMPORTED ///////////////////////////////////////////////////////////
import flash.events.MouseEvent;
//VARIALBLES INITIATED
var score:Number = 0;
var questions:Number = 0;
var qtotal:Number = 11;
var attempt:Number = 0;
var indexframe:int;
indexframe = this.totalFrames - 1;
var notes:Array = new Array();
var count:int;
count = 0;
var backcounter:int;
backcounter = 0;
var count2:int;
count2 = 0;
var backcounter2:int;
backcounter2 = 0;
var count3:int;
count3 = 0;
var backcounter3:int;
backcounter3 = 0;
// MOVIE CLIPS INITITATED ////////////////////////////////////////////////////////////////
var volbutton1:volcontrol;//VOLUME BUTTON ROLLOVER MOVIE CLIP
volbutton1 = new volcontrol();
var clist:courselist;//VOLUME COURSE LIST ROLLOVER MOVIE CLIP
clist = new courselist();
var pop1:Mc_slide9 = new Mc_slide9;
pop1 = new Mc_slide9;
var pop2:Mc_slide13 = new Mc_slide13;
pop2 = new Mc_slide13;
var pop3:Mc_slide17 = new Mc_slide17;
pop3 = new Mc_slide17;
//BUTTONS INITIATED
btn_nxt.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame);//NEXT SLIDE BUTTON
btn_bck.addEventListener(MouseEvent.CLICK, backbtn);//BACK BUTTON
btn_loc.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage); //LIST OF COURSES BUTTON
btn_notice1.addEventListener(MouseEvent.CLICK, loadnotice1);
pop1.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn1);
btn_notice2.addEventListener(MouseEvent.CLICK, loadnotice2);
pop2.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn2);
btn_notice3.addEventListener(MouseEvent.CLICK, loadnotice3);
pop3.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn3);
//VOLUME BUTTON ROLL OVER FUNCTION EVENT LISTENERS ///////////////////////////////////////
btn_vol.addEventListener(MouseEvent.ROLL_OVER,vol);
btn_vol.addEventListener(MouseEvent.ROLL_OUT,volout);
btn_loc.addEventListener(MouseEvent.ROLL_OVER,coursel);
btn_loc.addEventListener(MouseEvent.ROLL_OUT,corlist);
// FUNCTIONS INITIATED /////////////////////////////////////////////////////////////////
function fl_ClickToGoToNextFrame(event: MouseEvent): void
nextFrame();
function backbtn(event:MouseEvent):void{
prevFrame();
function fl_ClickToGoToWebPage(event: MouseEvent): void {
navigateToURL(new URLRequest("https://www.onlineinduction.com/fmgl/courselist.php?ist=2&type=Vendor Employee Inductions"), "_self");
//VOLUME BUTTON ROLLOVER EFFECT FUNCTION
function vol(e:MouseEvent):void
addChild(volbutton1);
//popup_instance.width = 675;
//popup_instance.height = 300;
if(this.currentFrame == 2)
volbutton1.x = 150;
volbutton1.y = 528;
else{
volbutton1.x = 278;
volbutton1.y = 528;
function volout (e:MouseEvent):void {
removeChild(volbutton1);
function coursel(e:MouseEvent):void {
addChild(clist);
if(this.currentFrame == 2)
clist.x = 85;
clist.y = 532;
else if(this.currentFrame == 5){
clist.x = 115;
clist.y = 325;
else{
clist.x = 175;
clist.y = 532;
function corlist (e:MouseEvent):void {
removeChild(clist);
function loadnotice1(Event:MouseEvent):void//FRAME 9 FUNCTION FOR IMPORTANT NOTICE
if ( count == 1 && stage.contains(pop1))
removeChild(pop1);
if(count == 1)
nextFrame();
else
addChild(pop1);
pop1.x = 40;
pop1.y = 120;
count = 1;
trace("Counter Value:" + count);
function loadnotice2(Event:MouseEvent):void//FRAME 9 FUNCTION FOR IMPORTANT NOTICE
if ( count2 == 1 && stage.contains(pop2))
removeChild(pop2);
if(count == 2)
nextFrame();
else
addChild(pop2);
pop2.x = 40;
pop2.y = 120;
count2 = 1;
trace("Counter Value:" + count);
function loadnotice3(Event:MouseEvent):void//FRAME 9 FUNCTION FOR IMPORTANT NOTICE
if ( count3 == 1 && stage.contains(pop3))
removeChild(pop3);
if(count == 3)
nextFrame();
else
addChild(pop3);
pop2.x = 40;
pop2.y = 120;
count2 = 1;
trace("Counter Value:" + count);
function nextframe9(event: MouseEvent): void
if(count == 1 && stage.contains(pop1) )
removeChild(pop1);
if(count == 1)
nextFrame();
else
addChild(pop1);
pop1.x = 40;
pop1.y = 120;
count = 1;
function nextframe13(event: MouseEvent): void
if(count2 == 1 && stage.contains(pop2) )
removeChild(pop2);
if(count2 == 1)
nextFrame();
else
addChild(pop2);
pop2.x = 40;
pop2.y = 120;
count2 = 1;
function nextframe17(event: MouseEvent): void
if(count3 == 1 && stage.contains(pop3) )
removeChild(pop3);
if(count3 == 1)
nextFrame();
else
addChild(pop3);
pop3.x = 40;
pop3.y = 120;
count3 = 1;
function backbtnscript1(event:MouseEvent):void
if(stage.contains(pop1) )
removeChild(pop1);
backcounter = 1;
trace("back" + backcounter);
prevFrame();
function unloadbtn1 (e:MouseEvent):void {
removeChild(pop1);
function backbtnscript2(event:MouseEvent):void
if(stage.contains(pop2) )
removeChild(pop2);
backcounter2 = 1;
trace("back" + backcounter2);
prevFrame();
function unloadbtn2 (e:MouseEvent):void {
removeChild(pop2);
function backbtnscript3(event:MouseEvent):void
if(stage.contains(pop3) )
removeChild(pop3);
backcounter3 = 1;
trace("back" + backcounter3);
prevFrame();
function unloadbtn3 (e:MouseEvent):void {
removeChild(pop3);
//SLIDE COUNTER
and here is the Code on all the Frames where I need to call in specific Listeners
FOR EXAMPLE ON FRAME 8,9,10,
Here Is the Code ,
FRAME 8
stop();
slidecounter.text = String(this.currentFrame - 1 + "/" + indexframe);
count = 0;
backcounter = 0;
btn_nxt.addEventListener(MouseEvent.CLICK , fl_ClickToGoToNextFrame);
btn_bck.addEventListener(MouseEvent.CLICK, backbtn);
btn_bck.removeEventListener(MouseEvent.CLICK , backbtnscript1);
btn_nxt.removeEventListener(MouseEvent.CLICK , nextframe9);
pop1.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn1);
//btn_notice1.addEventListener(MouseEvent.CLICK , loadnotice1);
FRAME 9
stop();
slidecounter.text = String(this.currentFrame - 1 + "/" + indexframe);
//POPUP FUNCTION
count = 0;
btn_nxt.removeEventListener(MouseEvent.CLICK , fl_ClickToGoToNextFrame);
btn_bck.removeEventListener(MouseEvent.CLICK, backbtn);
btn_bck.addEventListener(MouseEvent.CLICK , backbtnscript1);
btn_nxt.addEventListener(MouseEvent.CLICK , nextframe9);
btn_notice1.addEventListener(MouseEvent.CLICK , loadnotice1);
FRAME 10
stop();
slidecounter.text = String(this.currentFrame - 1 + "/" + indexframe);
count = 0;
backcounter = 0;
btn_nxt.addEventListener(MouseEvent.CLICK , fl_ClickToGoToNextFrame);
btn_bck.addEventListener(MouseEvent.CLICK, backbtn);
btn_bck.removeEventListener(MouseEvent.CLICK , backbtnscript1);
btn_nxt.removeEventListener(MouseEvent.CLICK , nextframe9);
pop1.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn1);
I am repeating this Pattern on each frame set where I need these Listeners ,
Problem is with the next one where I have two consecutive frames have different conditions to meet, any ideas how would I disable and enable listeners respectively on these frames ?
I hope I am not confusing this very much ?;( -
I need to delete a calendar event that transfered to my 4S from my Droid phone. This event occurs yearly. When I open this event, the edit button that normally appears in the upper right corner does not exist so I can't delete it. Any suggestions on how to get rid of it?
uninstalled firefox ....deleted all files still remaining under mozilla firefox directory in program files ... to avoid having to reprogram all my settings, reisntall all addons as well .. I did not remove anything from mozilla firefox that is stored in either appdata or under the windows users directory (if any)
... the as suggested reinstalled the latest version of the firefox browser using the link you provided in the email ..; tested and several issues still remain present and unresolved ....
so please this is urgent or I will have to jump browsers and start using chrome .. because we work 14 hours a day 6 (sometimes 7) days a week, to get ready for the launch of our newest venture and we cannot lose that much days on browser related issues ... so please instead of putting me through week long step process .. of do this .. do that .. can you please actually look into the issue from your end .. I use firefox for so many, many years thta I deserve this kind of support .. thnx Robert -
Hi,
I came across a little problem.
I put an event listener inside a for loop and the for loop inside a function.
I want the for loop to end as soon as the event listener inside the for loop calls its function.
Here is the general code for a better picture.
Code:
this.addEventListener(Event.ENTER_FRAME, function#1);
function function#1(event:Event):void{
if(something is true){
for(var i = 0; i < numOfmy_mcs; i++){
this["my_mc_"+String(i)].addEventListener(MouseEvent.CLICK, function#2);
function function#2(e:Event):void{
//do something cool here
Thank you for any help!kglad wrote:
that for-loop (if it executes), defines listeners for interactive objects. that will complete long before any object is clicked.
Well yes but it does it again and again (frames per second times seconds = number of times it goes through the code if i'm not mistaken), because it is inside a function, and through testing i found out that it works like this:
Example:
there are 5 my_mc's in my project: (my_mc_0, my_mc_1, my_mc_2, my_mc_3, my_mc_4)
if i click my_mc_0 function#2 is called and executed. BUT only after the loop finishes (i know this from tons of testing)...which is unnecessary since you cannot click two places at once. This might not be a problem in this example because i am only using 5 my_mc's buy if i use 500000000 my_mc's it would make a lot of difference.
is there a way to stop the loop if the function is called?
...maybe there is a better way to write it, the only alternative i know that works is if i manually write every single listener and this also is logical in this example but as i said next to impossible if the numbers get bigger.
-Note
I didn't specify this earlier but function#2 makes the if statement false so it wont jump back into it.
Thank you for the help I really appreciate it!
3rd edit...don't know what's wrong with me -
in iPhoto, I want to copy certain photos in an event and then have the copies in another event WITHOUT removing the original photos from their original event; how to do that?
The only way to do that is to export the image to a new file and then re-import it.
It's not really the intended way of working as it uses twice the disk space and is inefficient.
Use Albums instead. A Photo can be in any number of albums and use no extra disk space as it just simply references the image in the Library. Albums can be sorted any way you want - including manaually - and can have image from anywhere in the Library just by drag and drop.
Maybe you are looking for
-
J2SE 5.0 Documentation Download button broken
This is probably not the right place to post this, but the documentation download is broken. http://java.sun.com/javase/downloads/index.jsp
-
Adding a boot LUN in Datastore view
Hello, We recently moved to SAN boot, once rebooted the host i was going to add the new LUN under datastores but there's something not clear, here's the screen. What the "use free space" is intentended for? Is it going to perform any formatting actio
-
I am trying to install the NI-VISA 2.01 driver I downloaded from the NI website on a HP-UX 10.2 platform, but it keeps giving me the following error: tar: /var/spool/sw/NICVISA.DPT: This doesnt look like a tar archive. I also get errors telling me th
-
E-REC-Job Postings are not reaching to internal career channels
Hi All, Recruiter Published job postings are not reaching to internal career sites. Can any one share their experiences on this pls. We already executed the HCM_ER_Jobpostings as well...but still...!!! Thanks, Asha... Edited by: Sikindar on Jan 24, 2
-
Keeping QT open and 'always on top'
i think this should be fairly easy for all u clever folk out there: i am using an app, for eg. GB2, and i want to follow a tutorial for it on QT. How can i keep the QT window on top of the screen so that it does not disapear as soon as i start workin