Flex :: Event Propagation Whilst Container Is Not Initialized

Jun 16, 2010

I have a Canvas (lets call it the Drop Box) which users can drag and drop external files onto. Next to this I have a ViewStack, of which one of the layers is a Canvas with a TileList. I have successfully managed to code it so that the items dropped onto the Drop Box appear in the TileList. I simply capture the darg drop event (lets call this event A) and dispatch a new one that the TileList is listening for (lets call this event B).

However, this only works if the ViewStack selectedIndex is set to that of the Canvas with the TileList. If the Canvas with the TileList isn't selected then the event listener which is added to the TileList at CreationComplete level (event B), won't be called until after the drag drop event has dispatched (event B). This means that something is firing before something even has a chance to listen for it!

I've tried looping until the Canvas with the TileList is completely drawn, but this causes the app to hang.

I've also tried passing the event to the Canvas and storing it locally, but when I attempt to access the clipboad of the event I get an error (dead clipboard).

Effectively I want to only dispatch the event to the Canvas after it's had a chance to load, and add the event listener to the TileList.

View 1 Replies


Similar Posts:


Flex :: Why Need To Use Event Propagation

Feb 25, 2010

Why we need to use event Propagation?

View 1 Replies

Flex :: Debugging Focus And Keyboard Event Propagation In AS3

Dec 18, 2009

I have a custom TitleWindow component that is registered to listen for keyboard events from the user (so that esc closes the window, enter saves, etc.). However, in my testing I've found a couple cases where my keyboard event handlers don't fire. My best guess as to why this is happening is that there is some child component somewhere that has stolen focus and is stopping the keyboard events from propagating.

Unfortunately, due to the large number of components in my TitleWindow, I have no good way of knowing who has stolen the focus. My question then is, are there any good tips / techniques / tools for debugging focus issues and event propagation in Flex? Basically, I need something that will tell me who has the focus at any given time and who's handling an event at any given time... is that possible?

View 1 Replies

Actionscript 3 :: Flex 3 Event Propagation On A Composite Custom Component?

Jul 24, 2009

I have a custom component made up of a selectable control (radio button)and a text input. I want to perform some logic in response to the change events from both of those controls, but after that I want anything that is registered on the composite component's change handler to have a change to handle the events as well. The problem is, when I re-dispatch the events the event target has changed to my custom component, losing the originating event's target.

Here's my custom component:

<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" label="{listItem.@text}" data="{listItem.@level.toString()}">
<mx:Script>

[code].....

In the event handler that receives change events from this component, I see that event.target is an instance of SpecifyRadioButton, not the TextInput or RadioButton, as I'd expect. How should I propagate the event to get what I want here?

Getting event [Event type="change" bubbles=false cancelable=false eventPhase=2]
from question0.tabSurvey.questionForm.questionContainer.Single94.VBox95.SpecifyRadioButton111

View 2 Replies

Flex :: Double Click Event Propagation On Datagrid Dependent On Component Order?

Mar 21, 2010

I'd like to have a double click event on a datagrid in Flex3. The following example only works if the Accordion (id = "mustBeSecond") container comes after the DataGrid. Why is the order of the components important and what can I do to prevent this behavior? (The example does not work. If you change the order of "mustBeSecond" and gridReportConversions" the example works fine)

<mx:Script>
<![CDATA[
import mx.controls.Alert;

[code].....

View 1 Replies

ActionScript 3.0 :: Any Way To Prevent Event Propagation?

Feb 5, 2009

I have a movieclip containg several containers with other objects attached to them. Those containers have different levels of nesting. Now I want to add an EventListener to the top-level MovieClip and the called function uses attributes of this MovieClip. Because
of that I cannot just retrieve the MovieClip by saying e.target.parent but have to stop the propagation. I know there is a stopPropagation() method but I don't really get how (and when) to use it.

If I have sth like this:
function myResponse(e:Event):void {
//Things happening
} myMC.addEventListener(MouseEvent.CLICK, myResponse);

Where do I have to stop the propagation?

View 1 Replies

ActionScript 3.0 :: Timers And Event Propagation?

Feb 8, 2010

I have a container named circleHolder_mc. Inside I have four circles named circ0_mc circ4_mc. My goal is to have each circle blink on mouseover. The closest I've got is the following code which causes all of the circles to blink at the same time.

circleHolder_mc.addEventListener(MouseEvent.MOUSE_OVER, onBlink)circleHolder_mc.addEventListener(MouseEvent.MOUSE_OUT, unBlink)
var timer:Timer = new Timer(1);timer.addEventListener(TimerEvent.TIMER, onTimer);
function onTimer(evt:TimerEvent):void{    alpha +=7;}
function onBlink(evt:MouseEvent):void{    timer.start();}    function unBlink(evt:MouseEvent):void{    timer.stop();    alpha = 100;}

View 16 Replies

Actionscript 3.0 :: Event Propagation In PV3D?

May 18, 2009

how event propagation works in PV3D its definitely not like the conventional Flash style. On a quick search i have been able to find out that its possible using the InteractiveSceneManager Class, but unfortunately

View 1 Replies

ActionScript 3.0 :: Reach All The Children When Using Event Propagation?

Feb 24, 2010

I'm using Event Propagation in order to change the alpha of each Child on MOUSE_OVER, MOUSE_OUT, and MOUSE_DOWN using... evt.target.alpha On OVER the Child's alpha increases from 0 - 0.5. On OUT it goes from 0.5 - 0. On DOWN it goes to 0.5 and stays there even with a MOUSE_OUT. What I'd like to do is then add a button to the main stage which takes the visibility of all Children back to 0, a basic type of Clear button.

I have one way to do it where I list each Child in a function (all 9!). But can I re-write this so that all Children are effected writing so much code? Ideally I'd like to send a request to find the number of Children (9) and then use this variable to write a function which says (where 'n' is the Instance name of each Child) that n(0-numChildren).alpha = 0

[Code]...

View 3 Replies

ActionScript 3 :: Event Bubbling And Stop Propagation

Oct 18, 2011

What is the difference between event.bubbles to false for any event, And Setting event.stopPropagaion() or stopImmidiatePropagation() while handling event? I am using flex4 with as3.

View 3 Replies

ActionScript 3.0 :: Event Propagation With Masked Objects?

Sep 23, 2009

I have just learnt about event propagation and have made a few successful tests. However, I have encountered a problem when trying to use event propagation with several MovieClips that are masked and nested in a movieclip. The display list like so:
hd_cont > cndMask > cndThumbs > 9 movieclips with instance names box0, box1, etc etc.
I am attempting to scale the 9 movieclips at the bottom.

So I have tried:
Code:
hd_cont.addEventListener(MouseEvent.MOUSE_OVER, boxGrow);
hd_cont.addEventListener(MouseEvent.MOUSE_OUT, boxShrink);
function boxGrow(e:MouseEvent):void {
TweenLite.to(e.target, 1.5, {scaleX:1.5, scaleY:1.5, ease:Strong.easeOut});
e.target.alpha = .5;
[Code] .....

But when I reference the cndMask I get a
Code:
TypeError: Error #1010: A term is undefined and has no properties.
at gallery_fla::MainTimeline/gallery_fla::frame3()
message in the output panel.

View 3 Replies

ActionScript 3.0 :: Propagation - Single Event Handler To Handle The Double Click

Jan 20, 2011

I have a couple of Sprites on my screen and I want to write a single event handler to handle the double click on any of those Sprites. The following approach works for every event type except DOUBLE_CLICK:

[Code]...

To make it work, because in my application I will have lots of Sprites. In my opinion, a single event and the target property are more efficient than hundreds of event listeners. Am I right or should add event listeners to every Sprite?

View 4 Replies

Actionscript 3 :: Disable Mouse Event (click) Whilst Actions Are Peformed?

Apr 10, 2012

I'm currently design an application that when a button is pressed it expands to display further information.A major issue I am faced with is that if the button is pressed whilst contracting so that it expands again, the co-ordinates are saved from when it was clicked, meaning it will never return to its original state.

I either need a way of disabling the mouse click on the button whilst the TweenMax is doing its job in contracting the button, or by extracting the coordinates from an array. I've managed to get the array of coordinates from my menu class into the main class, but can't work out the best way in order to stop the problem from occuring.

[Code]...

View 1 Replies

Flex :: ComboBox Click Event Conflict With Its Container?

Aug 11, 2011

I want change the HBox's style when click any object inside this HBox. I set handle for click event of HBox, and then I found it very difficult to select item in the combobox in this HBox.When I click the combobox, it drops down its item list, and HBox style changed, then combobox drop up very quickly, I have no time to select an item in the Combobox.Here is my codes, is there any way to avoid this problem?

<mx:Repeater id="itemRepeater">
<mx:HBox id="itemHBox" styleName="active" click="onItemClick(event);">
<mx:ComboBox id="cb1" dataProvider="{dp}" close="closeHandler(event);"/>

[code].....

View 1 Replies

Flex :: Adobe - Navigator - 3rd Tab Is Not Initialized When Click On The First Tab Link Button

Nov 2, 2010

I have a flex application mxml file with 3 tabs.the first tab having the link button to select the value in the 3rd tab. Suppose, i have a link button in first atab. And the 3rd tab contains the combobox with values:"basic", "advanced". by default the vaule is displaying "default". When i select the linkbutton on the first tab, the "advanced"should be displayed in the comboBox on the 3rd tab. and the problem is , when click on the first tab link button , at that time the 3rd tab is not initialized. So it is not displaying the "advanced" in the comboBox. selecting the 2nd time on the link button it is displaying fine. But not first time. code: thirdTab.comboBoxId.selectedItem.data = 1;

View 4 Replies

ActionScript 3.0 :: Mouse Event Propagation - Capture Independent Mouse Clicks On Both Of These Two Movie Clips?

Jan 22, 2009

I have a "large" movie clip and "small" movie inside a "large" movie clip but on it's let's say upper right corner:

Code:
largeMc.addChild(smallMc);[

If i try to catch Mouse.DOWN events on them the following way:


Code:
largeMc.addEventListener(MouseEvent.MOUSE_DOWN, largeClicked);
smallMc.addEventListener(MouseEvent.MOUSE_DOWN, smallClicked);

Then of course both event are captured no matter where i click.Is it possible to capture independent mouse clicks on both of these two movie clips and if so, how can i do that?

View 3 Replies

ActionScript 3.0 :: Mouse Event Propagation - Capture Independent Mouse Clicks On Both Of Two Movie Clips?

Jan 22, 2009

i have a following situation: I have a "large" movie clip and "small" movie inside a "large" movie clip but on it's let's say upper right corner:

Code:
largeMc.addChild(smallMc);

If i try to catch Mouse.DOWN events on them the following way:

Code:
largeMc.addEventListener(MouseEvent.MOUSE_DOWN, largeClicked);
smallMc.addEventListener(MouseEvent.MOUSE_DOWN, smallClicked);

Then of course both event are captured no matter where i click.Is it possible to capture independent mouse clicks on both of these two movie clips and if so, how can i do that?

View 5 Replies

Flex :: Call Function By Any Event Happen In Mx:html Container In Windowed Application

Mar 7, 2012

I am working with Flex 4 windowed application. I have a mx:HTML container with location attribute like [URL]. That abc.html has a html button and i want when that html button is clicked then a flex windowed application function should be called.

Dummy Flex 4 windowed application screen shot: [URL]

View 1 Replies

Flash :: Error #2044: Unhandled Error: Whilst Using URLLoader Even With IOErrorEvent Event Listener

Feb 15, 2012

I am occasionally getting flash popup this error:

Error #2044: Unhandled error:. text= my code is here:

[Code]...

View 1 Replies

Flex :: Photo Gallery - Resizing Image Whilst Keeping It Central

Mar 4, 2010

I am using a mx:Resize effect to change the width of an image in Flex (leaving the height to look after itself) but I want the image to remain vertically centered on the page. Whilst I could calculate the aspect ratio of the photo, and work out the new y value to keep it centred, I would have to include a mx: Move effect too, and I am hopful that Flex has a simpler way. This is for a photo gallery where images are loaded at run-time, and swapped about.

So I really would like to avoid recalculating the aspect ratio and vertical position every time the updateComplete event fires, I tried putting my image inside a mx: VBox with verticalAlign="middle", thinking that the box would do all the centering for me, but this only seems to happen when the app first starts - i need it to gradually adjust the position during the period where the effect plays (to keep it central even when part-way through).

Here's a stripped-down example (which doesn't work):
<mx:Application xmlns:mx="[URL]" layout="absolute" width="600" height="600">
<mx:Resize id="fxResize" target="{imgPhotoA}" widthTo="350" duration="500" />
<mx:Button x="10" y="10" label="Resize" click="fxResize.play()" />
<mx:VBox id="boxPhotoA" x="100" y="20" height="500" width="350" verticalAlign="middle" borderStyle="solid" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:Image id="imgPhotoA" width="60" maintainAspectRatio="true" source="[URL]"/>
</mx:VBox></mx:Application>

View 2 Replies

Flex :: Prevent Container In ItemRenderer From Exceeding Width Of List Container?

Jul 2, 2011

In a Flex Mobile project I have a simple itemRenderer where I'm trying to create an "bubble" texting effect, similar to ichat or iphone (just so you get what im going for). But if the text is longer than the screen it runs off, rather than just going down a line.

If I set Group thats holding the rectangle(to create the bubble effect) and the label to 100% it works and keeps it from exceeding the list containers bounds, BUT the group is always at 100% and looks bad, I'm trying to keep the "bubble" JUST AROUND the text.

Anyway so, at the top of my itemRenderer I tried specifying:

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

And here's my layout I figured since msg_container has a width of 100% I was hoping bubble_lable_group would just not exceed that but...it doesnt...it just runs off. I tried setting a max width but that does not allow you to input percents. And just to say it 1 more time. I know if i set bubble_lable_group width to 100% it works, and keeps it from going off the edge, but then the rectangle "bubble" stretches all the way across and just looks bad.

<s:VGroup id="main_container" horizontalAlign="left" paddingBottom="10" paddingTop="10"
verticalAlign="top" width="100%">

[Code]....

View 1 Replies

Actionscript 3 :: Stop Labels Disappearing On Flex Pie Chart Between Segment Selections Whilst Interpolating?

Feb 12, 2011

I have a flex pie chart:

[Code]...

Basically, what annoys me is that when I click a segment to activate the interpolated event, the datatips disappear for it's duration. Whilst this is only half a second, it still detracts from user experience. Is there anything I can do to avoid it??

[Code]....

View 1 Replies

Flex :: Dynamically Adding Container To A Dynamic Container

Sep 21, 2011

I have a loop that goes through data from a book and displays it. The book is not consistent in it's layout so I am trying to display it in two different ways. First way(works fine) is to load the text from that section in to a panel and display it. The second way is to create a new panel (panel creates fine) and then add collapsable panels(nested) to that panel. Here is the code from the else loop.

else if (newPanel == false){
// simpleData is just for the title bar of the new panel
// otherwise the panel has no content

[Code]....

The error I get is: ReferenceError: Error #1069: Property panel4.4 not found on components.readTest and there is no default value.

I have tried setting the "name" property instead of the "id" property.

View 1 Replies

Flex - Hide Container Of A Viewstack Container?

Dec 23, 2010

I have a viewstack container w/ 3 views: red, black, and blue. How can I completely hide the black & not include it?

[Code]...

View 2 Replies

Flex :: Drag Circle From One Container To Another Container?

Jan 13, 2012

I am creating an flex Air project,so mxml file will run. I have circles in one Big circle at one side and will be same on other side.

Now how to drag any circle from any Big circle to other side. Or it could be like any two container having circles, then how to drag and drop circle?

For one circle i am able to do drag and drop.But I want one Big circle on left hand side and one big circle on right hand side .And small circles with class names will be in these big circles.Now i want to drag and drop those small circles in big circles.Big cicles should not move. Even i have tried this code in actionscript

package
{
import flash.display.Sprite;
import flash.events.MouseEvent;

[Code].....

But in this i want big circles should not move and small circles should only be dragged.

View 1 Replies

Flex :: Moving Children Of A Container (defined In MXML) Inside An "inner Container"

Jan 27, 2010

I'm currently working on a custom component which extends Canvas (let's call it SuperCanvas) ; it's basically a container that let you zoom & pan its contents. It would be too long to explain why, but I can't use scrollRect, so I was forced to declare a Canvas object (called innerCanvas)... inside my SuperCanvas (I know, not very nice =/) I would like to know if there's a proper way to "redirect" the creation of my component's children in this canvas.

[Code]...

View 1 Replies

ActionScript 3.0 :: Container Receives MouseOut Event From Within?

Aug 24, 2008

I'm having a Panel container with buttons and other controls in it. When the mouse moves over one of the container's children (e.g. a button), the Panel receives a MouseOut event where the target and currentTarget properties reference the Panel itself. That causes me problems. I only want the Panel MouseOut event when I leave the panel, not when I enter a child of the panel. Are there any way to turn that off?See example:

Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

[code].....

View 4 Replies

Flash :: See A Double Variable Initialized To Some Value?

Apr 24, 2009

Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273? Is JavaScript's math broken? many, many other questions, for every language and platform, all with the same answer.

trace( ">> " + (399.6-(Math.floor(399.6))) );
prints out
>> 0.6000000000000227

View 2 Replies

Flash :: Separate Event Handling From A Container And It Child

Jan 2, 2012

I want to separate event handling from a container and it child. So as you can see, my source code is very simple :

[Code]...

View 2 Replies

ActionScript 3.0 :: Add Event.resize To Some Display Object Container In Both Of Them?

Sep 1, 2010

lets say i have 2 classes in the same package.and i add the same event listener to each of them, for example i add event.resize to some display object container in both of them.how can i prevent the code attached to that listener to execute in one of the classes if that event happens?

View 2 Replies







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