Adobe Dreamweaver Forums



Last 10 THreads :         Snippet Pod Problems (Last Post : Pat@ffic - Replies : 0 - Views : 1 )           »          CFGRID, please help (Last Post : The ScareCrow - Replies : 1 - Views : 2 )           »          How can I make an image to stay at the bottom of abrowser? (Last Post : Greg Lafrance - Replies : 1 - Views : 2 )           »          Change custom Vector class to new Vector class in player10 (Last Post : flexstone - Replies : 0 - Views : 1 )           »          Need help with image slide show using xml (Last Post : shariha - Replies : 0 - Views : 1 )           »          Array with For Loop Basics (Last Post : MediaMackenzie.com - Replies : 6 - Views : 7 )           »          FW CS3 doesn't work with new scanner (Last Post : SonoranSites - Replies : 0 - Views : 1 )           »          Array of Queries (Last Post : Ian Skinner - Replies : 2 - Views : 3 )           »          Confirmation email entered twice and identical (Last Post : Baxter - Replies : 1 - Views : 2 )           »          Not Recognizing XML File (Last Post : andrewmcgibbon - Replies : 1 - Views : 2 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-04-2008, 09:00 AM
Handycam
 
Posts: n/a
Diggs:
Default Removing an object from inside the object class?

I have an class with event listeners wired for dragging the object. I want to
add an event to this class to delete the object from the stage.

I create the object like so:
private function makeItem():void {
var foo:ItemImage = new ItemImage("assets/model810.png");
picArea.addChild(foo);
}

I know I can remove it from the parent app with picArea.removeChild(foo), but
how do I do it from with the class?

If I add an event listener like:
this.addEventListener(MouseEvent.DOUBLE_CLICK, deleteMe); inside my class,
what's the command for the instance to remove itself?



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-04-2008, 09:00 AM
Handycam
 
Posts: n/a
Diggs:
Default Re: Removing an object from inside the object class?

Makes sense, yes. Is there no way to trigger this action from the child?

My issue is that the main app is going to spawn my class, add the image path
to it.

The class has code to allow it to be dragged around, etc. If there user
decides he wants to "delete" the object he added, I was hoping to perhaps allow
for an "option-click" or something similar on the object to remove it.

How would you recommend I do that?

Reply With Quote
  #3 (permalink)  
Old 11-04-2008, 09:00 AM
LuigiL
 
Posts: n/a
Diggs:
Default Re: Removing an object from inside the object class?

That button should broadcast an event so the parent can react by removing the child.
Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 10:23 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk