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


Similar Posts:


Flex :: Why Need To Use Event Propagation

Feb 25, 2010

Why we need to use event Propagation?

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

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

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

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

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

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 :: Adding Objects To A Masked Layer?

Dec 16, 2010

Say I have a flash project, with 3 layers (a, b, c). Layer C is the background, and A has a couple of shapes that masks B. Now I'm just wondering if there's a way to add my objects (MovieClips) to the stage using AS3 and still maintain the masks coming from A, seeing as merely putting my code in Layer B doesn't do the trick

View 3 Replies

Professional :: Exporting Masked Objects Into After Effects?

Mar 18, 2010

ive made a project of equalizers playing going up and down as e.q do.when i export the swf file its plays perfect but when i import it into after fx the e.q are static there is no motion.just the objects that are not masked are animating.

View 5 Replies

Professional :: Masked Objects In Flash Export Non Animated?

Mar 21, 2010

is there a logic explanation why my flash projects when exported as an avi or quicktime etc etc the objects that were masked are not animated? and what do i have to do in order for project to be as i see it when i test the movie and it appears fine.

View 7 Replies

Professional :: Masked Objects In Flash Export Non Aminated?

Apr 11, 2011

is there a logic explanation why my flash projects when exported as an avi or quicktime etc etc the objects that were masked are not animated?and what do i have to do in order for project to be as i see it when i test the movie and it appears fine

View 1 Replies

ActionScript 3.0 :: Masked Objects - Don't Respond To Drag And Drop?

Dec 30, 2009

I have a drag and drop project using bitmaps that were masked using fireworks. All bitmaps are PNG (fireworks files) and one object is GIF. All objects were converted to movie clips.

PROBLEM: All movie clips from PNG's can be dragged, but they can't be dropped. However, the GIF movie clip responds to both drag and drop.ActionScript worked when all movie clips had GIF's. Is this problem because they objects were masked or for any other reason?

Note: Objects were masked because their border is very fussy and cropping them doesn't help with the quality of their image.

var startX:Number;
var startY:Number;
var counter:Number = 0;[code]...

View 2 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

ActionScript 3.0 :: Events - Propagation Equivalent For Siblings?

Aug 4, 2009

So I've got a project that loads some bitmaps and plonks each one on the display list with some events to allow me to drag them and click-to-front. It works fine by and large but if the bitmap is a PNG with transparency then normally clicking on a transparent bit will still trigger the events. I can get round that with a quick check of the pixel's alpha using hitTest no problem.

The issue I have is if there is a bitmap behind the front one showing through then I can't click on that. From Flash's POV I'm still clicking on the front-most clip as there is still something there, even if it is technically invisible, so the event is triggered 'properly'. From my point of view I want to click through that clip on the one behind it, like they were paper cutouts on a table.

I can't disable the top layer's mouseEnabled property because it still needs to listen for events. Either I need something like event propogation only with siblings on the display list or I'm going to have to maintain a list of all the relevant clips and keep checking they're under the mouse pointer. Obviously I'd rather the former at the latter is a kludge.

View 2 Replies

Certain Event Changing Objects Such As Character?

May 3, 2011

Is it possible to swap an object such as the player character after a certain event? Say, the player absorbs ten circles, her character is now upgraded to a character with a larger radius.

View 1 Replies

ActionScript 3.0 :: Click Event On Two Objects On Top Of Each-other?

Oct 5, 2009

I need to be able to know when a container is clicked and when a button on the container is clicked. I am loading a swf with buttons into a container sprite. If I add a click event to the container it does not get triggered when a button in the loaded swf is clicked. if I add mouseChildren false to the container the it gets triggered. What I need is both the button in the loaded swf to work as well as the click event on the container.

View 2 Replies

ActionScript 3.0 :: Add An Event Listener On Objects 1, 2, And 3?

Jan 14, 2011

I have been stumbling on Events - specifically, broadcasting the events across different objects.

I want to be able to add an event listener on objects 1, 2, and 3; then, have object 4 dispatch one event type and have objects 1-3 correctly hear it and act.

For example, consider the following:

//this is my custom class
package RedCirclePackage
{

[Code].....

It works, and I get 3 Alert messages. Now, I understand that dispatching an event to a specific object will work (and thats why using the three lines of code above works), but I want to dispatch a general "foo" event using one line of code and give the ability for all objects to key off that "foo" call and not one specific object.

Is it possible to dispatch a general "foo" event and have ALL objects able to receive the call, or am I stuck with dispatching events for every specific object I want to receive it?

View 4 Replies

ActionScript 3.0 :: Use Same Event Listener For Many Different Objects?

Jul 29, 2011

I've got a project where a lot of buttons are created. Each one has different instance name but all have the same roll over/roll out animation.

Is it possible to only use one roll over/out event listener for all of the buttons?

View 2 Replies

Removing Event Listeners And Null Objects?

May 14, 2009

I was just wondering--and it's probably an obvious question really--if I make an object null and that object had one or more event listeners registered, are the listeners removed?

for example:

Actionscript Code:

object.addEventListener(Event.SOME_EVENT,callBack);
function callBack(evt:Event):void
{
object = null;

[Code].....

In this case have I removed 'object''s listener when I made the object null?

View 1 Replies

ActionScript 3.0 :: Event Bubbling - But Not For Display Objects?

Apr 6, 2010

I'm wanting to bubble events between a few custom classes, however, they are not Display Objects.Is there any quick and easy way to do event bubbling, without needing a display list?Or perhaps another way than needing to manually listen for each event that is attached and "relay" it every time it is dispatched?

View 1 Replies

Flex :: Custom Event - Cross Domain Objects

Sep 14, 2011

I have an object being passed between flash and flex using the a custom event. I am importing a library in flex containing a copy of the object's class. The classes are identical. But when I attempt to access the object in flex I get this error:
TypeError: Error #1034: Type Coercion failed: cannot convert com.cackleberries.data.api::ApiObject$ to com.cackleberries.data.api.ApiObject.

This function is passed into flash as a callback from AIR / flex
public function airEventHandler(type:String, data:Object):void {
switch(type) {
case "air_api_call":
if(data) {
if(data.hasOwnProperty("apiObject"))
[Code] .....

I am getting the error when I pass the apiobject to serverApi.makeApiCall. That function takes a ApiObject as its parameter. Initially, the data object is created with with the apiObject key with a ApiObject as the value (done in flash).

View 1 Replies

Actionscript 3 :: Handle Event For Nonvisual Objects In Flex?

Nov 7, 2011

I am trying to perform two way binding e.g I have a button (out of many controls), on its selection, I am showing the values of its diff properties(like height, width etc) in some textinput. This one way process works fine.But the reverse process doesn't work. i.e When I select some button, and try to change its dimension by entering some value in height, width textinputs, the dimension are not changed.

private void Form1_Load(object sender, System.EventArgs e)
{
//Create some data and bind it to the grid

[code].....

View 1 Replies

Actionscript :: Flash - Pass Objects To A Loader Event

Dec 12, 2011

What is the recommended way of passing objects into the eventhandlers of a Loader?

var l:Loader = new Loader();
var o:Object = new Object();
l.tag = o; // i imagine something like this

[Code]....

View 2 Replies

ActionScript 3.0 :: Event Handler To Serve Multiple Objects

Oct 29, 2009

I would be grateful if anyone could point me in the right direction for this question: I have an event handler that is called by multiple objects onClick - ie, I have several objects which I want to respond in the same way onClick. I was wondering if there was a way of amalgamating all the calls to this event handler into one call: at the moment I have:

[Code]...

View 8 Replies







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