# Event Propagation Problem

**URL:** <https://forum.kirupa.com/t/event-propagation-problem/326079>\
**Category:** flash\
**Created:** [November 21, 2011, 9:09pm UTC](https://forum.kirupa.com/t/event-propagation-problem/326079 "2011-11-21T21:09:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tyberius7](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@tyberius7](https://forum.kirupa.com/u/tyberius7)\
**Post date:** [November 21, 2011, 9:09pm UTC](https://forum.kirupa.com/t/event-propagation-problem/326079/1 "2011-11-21T21:09:42Z")

</div>

Hello,

I have been using Flash Builder to write an actionscript class (hence stage instances aren’t being automatically declared) and have come across a problem with event propagation and nested movieclip targeting which is probably quite easy to solve but I’ve searched and searched and I am still struggling with it.

My simplified example is as follows:

On my stage I have two movieclips (folder1 and folder2) which are inside a movieclip (folder\_group). In my class I have added eventlisteners to the folder\_group and want to trace the name of the folder I hover over e.g. folder1.

```auto
package 
{
	import flash.display.*;
	import flash.events.*;
	public class Main extends MovieClip
	{
		public function Main()
		{
			var folder_group:MovieClip = new MovieClip();
			var folder1:MovieClip = new MovieClip();
			var folder2:MovieClip = new MovieClip();

			addChild(folder_group);
			folder_group.addChild(folder1);
			folder_group.addChild(folder2);

			folder_group.addEventListener(MouseEvent.MOUSE_OVER, $mouseover);
			folder_group.addEventListener(MouseEvent.MOUSE_OUT, $mouseout);
		}
		private function $mouseover(evt:MouseEvent):void
		{
			evt.target.alpha = 0.5;
			trace(evt.target.name);
		}
		private function $mouseout(evt:MouseEvent):void
		{
			evt.target.alpha = 1;
		}
	}
}

```

This works if I write it in Flash Professional and declare the stage instances automatically but in Flash Builder, which can’t do this, I get the following errors:

> ReferenceError: Error #1056: Cannot create property folder\_group on Main.  
> at flash.display::Sprite/constructChildren()  
> at flash.display::Sprite()  
> at flash.display::MovieClip()  
> at Main()

Whether I use Sprite instead of MovieClip I still get the same #1056 error.

I must not be declaring the movieclips or adding them to the display list correctly. Does anyone have any suggestions?

I am extremely grateful for your help.

Cheers!
