Flex :: Getting An Event That Is Triggered When A Component Is No Longer Displayed On The Screen?

Jan 21, 2011

I have a custom component I've developed that's part of a dashboard.It does some polling based on a timer that's part of the component.

When the user navigates away from the view that contains this component I would like to stop the timer and hence stop the polling.I can obviously fire an event when the view's changed and catch it within the component but I was hoping that there might be a way to contain this all within the component.Is there an event or state change within a component that triggers and even when a component is currently be displayed?

Example:

]]>
</mx:Script>
<mx:TabBar x="10" y="10" dataProvider="viewstack1">

[code]....

View 3 Replies


Similar Posts:


Flex :: Event Triggered On Component Re-render?

Feb 10, 2011

What's the call analogous to creationComplete that happens every time a component is rendered? I want to rerun a function every time the component gets rendered (it has to make an HTTP request, but the url it calls changes each time) and I can't figure out how to do it.

For context:

<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"

[Code].....

View 3 Replies

Flex :: Print A Dynamically Created Component/chart That Is Not Being Displayed On The Screen?

Jan 24, 2011

I have a several chart components that I have created in Flex. Basically I have set up a special UI that allows the user to select which of these charts they want to print. When they press the print button each of the selected charts is created dynamically then added to a container. Then I send this container off to FlexPrintJob.

i.e.

private function prePrint():void
{
var printSelection:Box = new Box();

[Code]....

I have seen some examples on the adobe site that add the container to the application but don't include it in the layout. This looks like the way to go.

i.e.

printSelection.includeInLayout = false;
addChild(printSelection);

View 2 Replies

ActionScript 3.0 :: MovieClip Movement Triggered By Socket Event - Screen Render?

May 11, 2009

I have a flash project that's implementing a simple two player game. I have added an enterFrame function to my main movie which listens for keyboard activity in order to move a cowboy gunslinger. Whenever the cowboy moves, I send a message over a socket to a server which dispatches the movement to the other connected client. This works pretty well, however, the movement messages tend to arrive in clumps which results in jumpy animation of my cowboy on my opponents screen and jumpy animation of his cowboy on my screen. To illustrate, i put a trace in my enterFrame function because I am imagining that this function will run roughly once each time my main movie renders the screen. I also put a trace statement in my function that responds to network traffic and moves the remote player's cowboy on my screen.

Here's the output:
enter frame:4
enter frame:4
enter frame:4
client movePlayer running
client movePlayer running
client movePlayer running
[Code] .....

As you can see, I'll get several messages in a row from the remote client which instruct me to move their cowboy ('client MovePlayer running') and they will all run in a row before the screen updates. I'm guessing I should be using something like updateAfterEvent but this method is only provided by Mouse, Timer, and Keyboard events.

So a few questions:
1) Can someone recommend a good approach to force a screen render each time an incoming movePlayer event arrives over the socket? It's important to note that my function for handling these events has no visibility to the original socket data event.
2) Am I right in understanding that the enterFrame function of my main movie happens once each time my movie is rendered? Is there some more accurate event to which I could attach a trace message so that I better understand the relative frequency of the render events and the socket events?
3) Does firing an updateAfterEvent call force onEnterFrame events to happen more frequently? I'm worried about destroying performance by inadvertently firing more enterFrames which would fire more socket events which would fire more enterFrames, etc., etc.

View 9 Replies

Flex :: Event Is Not Being Triggered For Geolocation?

Mar 13, 2012

I created a button that looks up the coordinates of the device. There is no errors in the code but for some reason which is eluding me, the event is not being triggered.

Here is my code:

protected function lblCheckIn_clickHandler(event:MouseEvent):void
{
if (Geolocation.isSupported)

[Code]....

View 2 Replies

Flex :: HideEffect Not Triggered When Component Visible Property Set False Programmatically?

Feb 11, 2010

In Flex I've got a component, which is based on a Canvas.It looks like this (I removed the <mx:Script> for better reading):

<mx:Canvas verticalScrollPolicy="off" showEffect="showFX" hideEffect="hideFX" horizontalScrollPolicy="off" creationComplete="doComplete()" xmlns:mx="http://www.adobe.com/2006/mxml" width="63" height="63">[code]....

If I set customComponent.Visible to false, the component gets hidden (as expected). But doesn't trigger the hideFX at all. Am I doing something wrong? Or isn't this the correct way to use hideEffect and showEffect?

View 1 Replies

Flex 3.5 :: Flash HSlider Event Listener Not Triggered When Value Is Updated

Aug 16, 2010

I am writing a web application that will serve as a configuration for a random data generator that I have written in Java.The values that I set in this application will write to xml. The xml data is updated by a file called simulationParams.as and that file is added to each child in the "viewStack" so that when I change any of those values the simulationConfig file will be automatically updated.The problem is that when I press the randomizeBtn the proper events are fired and the listeners grab those events.My problem exists when I uncheck the randomize button.For some reason an event is triggered or the listener isnt listening so that when I uncheck randomizeBtn the values go back to their last position or value on the slider. Ex. if my initial value is 0 then press randomize the slider will go to 100. The config file updates and all is well.When I uncheck the randomizeBtn, the sliders value goes back 0 but the config file isnt update.The same thing happens when I press the useDefaultBtn for both selected/unselected, nothing gets updated.[code]

View 1 Replies

Actionscript 3 :: Which Event Or Function Is Triggered When Tree Node Is Expanded/collapsed ( Flex 4.5 )

May 28, 2011

I am looking for the function or event, which is called when tree node is expanded/colapsed inside Tree object in Flex 4.5.

View 1 Replies

ActionScript 2.0 :: List Box Component On Screen Which Had An Event Listener To Get Changes?

Jun 30, 2008

If I were to have a list box component on screen which had an event listener to get changes, when navigating away from the current screen, is it a good idea to remove any listeners that exists in that frame? If so, what is the best way to do it.

Is this best practice in clearing up listeners?

View 3 Replies

Flex :: Propagating Event From A Built-in Component To A Custom Event?

Jan 27, 2012

I am trying to understand event propagation in Flex framework and have a following doubt on it:

Scenario: I have a built-in component DropDownList on change of which I want to create a custom event refreshPreview and want to propagate it to a custom component PictureComponent.

In the custom component's mxml, I have added the Metadata directive as follows to register a refreshPreview event with the compiler

<fx:Metadata>
[Event(name="refreshPreview", type="flash.events.Event")]
</fx:Metadata>

Layout Details: In my main mxml application I have laid out DropDownList and the custom component such that both are siblings (i.e. have a common indirect parent)
e.g.

<s:Group id="contentGroup">
<s:Group id="formGroup">
<s:Form x="11"

[Code]....

I am seeing that the refreshPreview event is not getting propagated to the custom component.

I doubt this is because the built-in component is a sibling of the target (where the event got generated) and not a parent. how to make refreshPreview event propagate to custom component?

View 1 Replies

ActionScript 3.0 :: Cannot Get The Boxes To Be Displayed On The Screen?

Feb 23, 2011

I have written up this code from a tutorial, however, I cannot get the boxes to be displayed on the screen.When i compile I get a 1086: Syntax error: expecting semicolon before colon.

I cannot figure out what it is complaining about, however it is complaining where I am trying to pull in the nodes from the XML file - any help and information shedding light into what I am doing wrong would be very helpful. I seem to have a recurring problem with objects not showing up on the stage that I have programmed - maybe I am not calling them correctly?

[Code]...

View 6 Replies

IDE :: Event.Complete Not Triggered?

Nov 9, 2009

my completeHandlerI would like it to be triggered when the progress bar is complete.

// uploader script
var URLrequest:URLRequest = new URLRequest("http://mysite.php");
// image types

[code].....

View 1 Replies

ActionScript 2.0 :: Getting Name Of Event That Triggered The EventListener?

Jan 26, 2009

I am trying to extract the last part (after the last .) of what trace(evtObj.target) shows, but when i try to use the code bellow to do it i get some of the info i get for the traces EventOb=_level0.RightSide.instance435.Ath (or whatever it is that triggered the event) Legth=Undefined

i get Undefined for all the string commands i have tied

example for evtObj.target with
_level0.RightSide.instance435.Ath
i want to get just Ath

[Code]....

View 2 Replies

ActionScript 3.0 :: Event.DEACTIVATE Not Triggered?

Jul 13, 2011

I'm looking for an event that tells me when the browser is refreshed, or better to say, when my flash app exits. So I tried
 
stage.addEventListener(Event.DEACTIVATE, onDeactivate);
 
but its only triggered when closing the debug window and not on refreshing or closing the browser.

View 1 Replies

Flex :: Make A Component Appear On The Center Of Screen?

Aug 13, 2010

In Flex, how to put some component ( like canvas ) appear at the center of the screen. ( even if there is scroll, it should be displayed at the center of the current view).

View 1 Replies

CS3 Get Input Text To Be Displayed On Screen Without Creating Buttons?

Sep 17, 2009

I'm creating a quiz application using Flash CS3, but it's been such a long time since I've used ActionScript and I'm a little bit stuck.I've created an input text box in the first frame of my quiz program. A person will enter their name into this text box (which I've called "nameInput") and then click the next button to proceed through the quiz.However, when I get to the results page I cannot figure out how to get the input name to be displayed automatically in the dynamic text box (which is called "nameOutput") when the user enters the frame.

View 2 Replies

ActionScript 1/2 :: OnPress Event Function Not Getting Triggered

Jan 10, 2010

I have created different buttons on different movieclip. Then i assigned onPress event on each buttons. But the function of onPress event is not triggered. The arrangement of movieclips is following.

var mainMC:MovieClip = _root.createEmptyMovieClip("mainMC",0);
mainMC._alpha = 0;
var adImgMC:MovieClip = mainMC.createEmptyMovieClip("adImgMC",0);
var offerMC:MovieClip = mainMC.createEmptyMovieClip("offerMC",1);
var offerList:MovieClip = offerMC.createEmptyMovieClip("offerList",0);
[Code] .....

I have created an event as follows:
offerList.onRollOver = function(){
offerList.stopTween();
clearInterval(autoScrlTimer);
} offerList.onRollOut = function(){
duration = 0;
autoScrlTimer = setInterval(automaticScroll,duration);
ovrFlag = true
}
I doubt that the onPress event is not working because of the above piece of code.

View 4 Replies

ActionScript 3.0 :: Listen The Event Triggered By Another Class?

Oct 15, 2011

I've got 3 classes: The class that recognizes the change in URL (using SWFAddress by Asual):

[Code]...
 
And the "Hello World" never appeared in the output window - so I'm not sure if is it possible that my MenuPanel has a chance to receive a info about completing the validation triggered by some other class?

View 2 Replies

Actionscript 3 :: When The Event Is Triggered, The Popup Window Will Appear?

Jan 22, 2011

Im doing a program in AS3 and, i'm trying to do the following:Lets say I have a button, which have onClick event, and when the event is triggered, the popup window will appear. And in this popup window there is going to be an animation (countdown) of 2020 (this is just an example).Is there a way to do this without javascript. Because i'm not doing this for website, its going to be a animation.

View 1 Replies

Flash :: Pass Parameters When An Event Is Triggered?

Jul 11, 2011

I want to pass parameters when an event is triggered. My function:

private function keyChange(e:KeyboardEvent, setValue:Boolean):void

so that I can use the same function to set if a key is up or down. How would I write the event listener? I tried:

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyChange(,true)); however that didn't work.

View 3 Replies

Actionscript 3 :: Adding An EventListener While Such An Event Is Being Triggered O?

Oct 10, 2011

When the escape key is released, I close the deepest child in a tree-like structure, and then tell it's parent (which is now the new 'deepest child') to close when the escape key is released ... but I do that while such an event is triggered, that causes the whole chain to close.

View 3 Replies

Actionscript 3 :: Listen The Event Triggered By Another Class?

Oct 15, 2011

I've got 3 classes: The class that recognizes the change in URL (using SWFAddress by Asual):

[code]...

And the "Hello World" never appeared in the output window - so I'm not sure if it's possible that my MenuPanel has a chance to receive an info about completing the validation triggered by some other class?

View 1 Replies

Actionscript :: Return A Value When XML Load Event Is Triggered

Jan 21, 2012

Actionscript is really stressing me out! My code is too messy to post as I have tried everything from design patterns to procedural approaches. In short, is there any way i can retrieve my XML data in a variable after loading the URL request?

var req:URLRequest = new URLRequest(url);
this.loader = new URLLoader(req);
this.loader.addEventListener(Event.COMPLETE, readXML);

Basically I am trying to capture my XML output so I can place it a list. There doesn't seem to be a way to assign it to a variable without it losing scope when the event is over.

View 1 Replies

ActionScript 3.0 :: URLloader - Event Not Triggered On Completion

Feb 11, 2009

I have code that sends variables to an .asp file to be put on a database, and all that works fine the database connects and is updated fine, the thing is flash doesn't recognize that the operation was successful and won't continue with the further functions. I understand this may be due to a problem on my asp file, but the SQL executes successfully which I see when i check my DB, so I was wondering if anyone could look at my AS code and see any problems?

[Code]...

View 1 Replies

ActionScript 3.0 :: Resize Event Doesn't Get Triggered?

May 8, 2009

I'm working on a project that uses a resize event and the Flash is full-browser (100% height and width). This means of course that every time the Flash stage size will change the resize function will be triggered. This works all fine. But the problem is that if you open a new tab in a browser besides the Flash tab and you go to another website and you resize the browser itself than the rezise event wasn't triggered when you return to the Flash tab. It only triggeres when you resize the browser with THAT tab open.

So is there a normal way (without having an enterFrame loop) to still trigger the event if you return to the Flash tab?

I thought maybe a timer is best way. It should trigger the resize every 3 or 5 seconds or so.

View 2 Replies

Adobe Flex Toggle A Component Full Screen?

Aug 25, 2010

I have 5 components on my Flex application(actual view) and they are:

x = main panel
y = bottom panel
z = left panel
a = right panel
b = top panel

I have a toggle full screen button. When clicked I want the main panel(x) to become full screen. At this point only main panel(x) should be visible. when I click on the toggle button again, it should become normal displaying all 5 components(the actual view).

View 2 Replies

Flex4 :: Placing Flex-component In Middle Of Screen

Sep 6, 2011

When using BasicLayout (i.e. absolute positioning) - what is the best approach to place a Flex component in the center of the application?In the test case below I'm using x="{width/2}" but this gives me at least 2 problems:How do I account for the component dimensions (the ProgressBar in the test case)?Is the binding {width/2} a good idea to use? Wouldn't it send unnecessary DATA_CHANGE events in some cases?And finally I wonder, how this all applies to full screen applications using StageScaleMode.SHOW_ALL - because currently my application is aligned to the top-left in the full screen mode and there is a white dead zone on the right of it. (Which is at least a change from pure Flash/AS3 behaviour, where the full screen content is displayed in the center of the screen and 2 dead zones on the left and right).[code]

View 2 Replies

Flash :: Make Webpage Displayed Same Size On Any Screen Resolution?

Nov 19, 2010

How can I make my flash Webpage displayed same size on any screen resolution of my computer? Whether it is 1024 X 768 or 1280 X 960 screen resolution, the size of Webpage (Flash Webpage) should always be same so that user don't need to use horizantal scroll bar to view all the content.

And secondly, how can I scroll my webpage vertical on moving with my mouse like in the following link: The below link also shows that it's webpage size is always same on any screen resolution.[url]...

View 1 Replies

Actionscript 3 :: Flex 4 Disptaching Custom Event From Custom Component (why Flex Converting Custom Event To Mouseevent)?

Mar 2, 2012

This is NOT duplicate of my earlier post (its is slightly different)But this is similar issue with similar error but its not the same error The error I am getting now is below while dispatching the custom event from my custom component

TypeError: Error #1034: Type Coercion failed: cannot convert events::MapEvent@a74ab51 to flash.events.MouseEvent.
dispatchEvent(new MapEvent(MapEvent.CLICKED_ON_MAP));

Note: The error in my earlier post is giving below error message

Type Coercion failed: cannot convert flash.events::Event@81ecb79 to com.events.ShopEvent

The difference here are two things, the earlier error is while converting flash event to custom event and now this one is while converting custom event to flash event and secondly, I have no clue why it is trying to convert to the mouseevent where I am just dispatching my custom event with proper listeners.

This is my custome event

package events
{
import flash.events.Event;
import ui.map.MapElement;

[code]...

View 1 Replies

Professional :: Html Displayed Within List Component ?

Apr 21, 2010

I'm trying to do to familiarize myself with flash.   I'm loading an external XML document into a Flash AS2 project using the XMLComponent.  I'm able to get everything to display properly within my lists except for my hyperlinks.
 
I've enclosed my hyperlinks in the XML document using the <![CDATA[hyperlink]]>.    Once the movie launches.....the full URL tags are being displayed: (eg.  <a href="http://www.google.com">Google</a> )
 
My hyperlinks are in there own seperate List component. 

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved