DropTarget check against all objects on the stage

Hey all,
Not sure the best way to do this.  I have a class we will call DropActivity, here is the code
package com.activitycontrol
          import com.activitycontrol.DropCheck;
          public class DropActivity
               // Constants:
               // Public Properties:
               // Private Properties:
               private var _selectedClip:Object;
                    // Initialization:
                    public function DropActivity(/*selectedClip:Object*/)
                    // Public Methods:
                    public function set selectedClip(selectedClip:Object):void
                              _selectedClip = selectedClip;
                    public function stopDraggingMe():void
                                   var dropCheck:DropCheck = new DropCheck();
                                   //dropCheck.checkAgainst = dropTarget.name; ///***********
                                   if (dropCheck.canBeDropped == true)
                                        _selectedClip.stopDrag();     
                    // Protected Methods:
when the stopDraggingMe() method is called from another object (code shown below) I need to see all the objects on the stage to see what objects on the stage my currently selected movie clip is over and assign it to the dropCheck.checkAgainst method (that will be checked against an array to see if it can in fact be dropped, if so set the canBeDropped value to true and therefor run the .stopDrag() ).  I have read using root is not a good coding practice in AS 3.
call to the stopDraggingme() mehod.
private function setDown(event:MouseEvent):void
                         var droppedItem:DropActivity = new DropActivity();
                         droppedItem.selectedClip = this;
                         droppedItem.stopDraggingMe();

No, I think I can use drop target, I just need to use it from the DropActivity class and not a document class. I just don't know how to use it from a non-document class.
"and you need to loop through all displayobjects to see which have a positive hitTest with your dropped object, correct?"
I am trying to say..... ok, what movie clip is currently under the one I have selected,  the drop activity class knows what object I have selcted as it is in the selectedClip variable.  so I need to find out what clip is under it ......... the light just came on!
answer duh......dropCheck.checkAgainst = _selectedClip.dropTarget.parent.name;
thanks a bunch kglad you have helped me out once again, you are the man. I might just have to buy you a beer one of these days.

Similar Messages

  • Can't edit objects on the stage

    Hi,
    I'm stumped helping my colleague on the issue below so I'm logging this question.
    Issue: My colleague is trying to edit a slide but can't edit any of the objects on the stage. However, it works fine when I open the same project on my machine. Is there a setting on her machine that's causing the issue?
    In the screenshot below, check out Slide 2 (selected) notice how:
    in the thumbnail there are multiple objects (white image on the left, blue text caption in the center) on the slide.
    in the timeline multiple objects are available and selectable. All are set to be visible (the little "eye" isn't switched to off).
    when you look at the stage, the only things that we see are the background and a single button.
    The objects also appear fine in Preview.
    On the stage, can "phatomly" select objects, but she can't change the characteristics of them (e.g., change text in a text caption, resize object, move object).
    Screenshot:
    OS: Windows 7
    Captivate: v5.5 (running as Administrator)
    Background info:
    This project was initially created in an older Captivate version (4.0 or 5.0) and is now being edited/updated.
    Last week, my colleague was trying to edit the same project (using v5.0). When she clicked play on the timeline, her audio wouldn't play. When she watched the Preview or tried to edit the audio, the audio would play just fine. Also, on my machine (running v5.5) it worked fine. This prompted me to suggest that she update to v5.5. Alas, it seems this fixed the audio issue, only to create this video issue.
    Thanks,
    - Dino

    Here's a bigger/better quality image. I hope it helps.
    Notice how the Text Caption is selected in the timeline and it's properties are visible on the right. Yet the item itself is nowhere to be seen on the stage. Also, now it seems to have disappeared from the thumbnail.

  • Deleting objects from the stage

    Hi all,
    I've got some items on my stage that I'm removing with
    RemoveChild(). The items no longer show, however, as stated in
    LiveDocs, the item is not actually destroyed. This means any
    bindings/listeners created by that object are still in existence
    and are creating errors (Specifically, I'm getting "The supplied
    DisplayObject must be a child of the
    caller").
    LiveDocs mentions that if I want to actually delete an object
    from the stage entirely, I should use the "delete operator", but
    for the life of me, I can not find any documentation on the
    existence of such an operator. Any advice would be much
    appreciated.
    -Hob

    It IS ridiculously hard to find. Searcing Live Docs for
    delete oprator will turn up a slew of hits, but which is the right
    one?
    This is from old docs, but it is still valid:
    http://livedocs.adobe.com/flash/8/main/00001865.html
    Tracy

  • Hide objects outside the stage

    Hi there!
    I have recently downloaded a sample FLA file and I see the stage is FIXED on top-left side of the flash screen and objects outside the stage does not appear on screen (Like a mask, but there is no mask layer).
    And when I create a new file the stage appears in middle of the screen and objects outside the stage are not masked.
    Would you please help me what should I do in this case?
    (I always use a very big White layer in top of all other layers, to cover out of stage, OR use a mask layer)
    Regards,
       Ali

    Hi!
    Sorry if my question was not clear. here is the link (adobe TV):
    http://downloads.tv.adobe.com/2012-00-24/WebChallenge_FL_3.zip
    I have uploaded that single FLA file to the address below :
    http://www.howallah.com/Mobile.fla
    To simplify my question, each flash scene is indeed divided into 3 sections based on colors (white, light grey, dark grey) as marked below :
    (the Zoom is 20% to cover them all).
    Section 1.  is called Stage (I know)
    Section 2.  it expands automatically as you move an object outside the stage (image, movieclip etc.) and it works like a mask (I dont know the name of this section)
    Section 3.   is something like "out of Scene" (I don't know the name of this section as well)
    What I want to do is sort of FITTING Section 1 (Stage) to Section 2.
    Exactly like the FLA sample file above.
    What is that good for?? to help me only see the stuff INSIDE the stage, without any need to make a mask layer or a LARGE white layer above all layers etc.!
    Anybody knows what I am talking about and having a clue please?
    Regards,
       Ali

  • Undable to drop tablespace ORA-01561: failed to remove all objects in the

    hi,
    i am unable to drop table tablespace how can i do that??
    please advise
    DROP TABLESPACE tbs_tp2 INCLUDING CONTENTS AND datafiles
    ERROR at line 1:
    ORA-01561: failed to remove all objects in the tablespace specified
    Thanks in advance
    siva
    chennai

    Have you tried dropping the objects individually? You can see which objects still belong to this tablespace by using the DBA_SEGMENTS view as shown below:
    SELECT OWNER, SEGMENT_NAME, SEGMENT_TYPE, TABLESPACE_NAME
    FROM DBA_SEGMENTS
    WHERE TABLESPACE_NAME=tbs_tp2;HTH!

  • When releasing a transp. req.not all object in the request could  be locked

    When trying to release a transport request I get error message that "not all object in the request could  be locked. Do you want to release them anyway"
    I found an unreleased request (from someone else) containing few objects from my request. However I do not know the owner of that request (and I can not felete it). What to do?
    If I release the transport anyway what could happen?

    Hi Tina,
    If ur sure that u only want to release object which u have created and not the other objects then proceed in following way.
    1. Go to SE10 and click on create button
    2. u will get a popup select the 3rd radio button(ToC)
    3 Give the decsription of the Tp
    4. u will get  anext screen here in menu select request
    task->object lise ->Include object (new screen) here u select radio button freely selet obkect -> then new screen then selected the radio button selected objet. Here u give ur object and those object will be store in the created request then u can transport
    Regard
    Anees Ahned

  • Adding objects to the stage & acceessing stage properties - I'm a bit confused..

    Hi,
    I'm a little confused on two fronts regarding display
    programming:
    A. What the best way to add objects to the stage?
    B. How to access stage properties.
    I can do both of these when the project is an 'Action Script
    Project', but I'm having trouble when it is a 'Flex Project' (e.g.
    an MXML file). See the two attached files with questions included
    in the comment to see exactly what I mean.
    A. What the best way to add objects to the stage?
    =====================================
    In an action script project that extends Sprite I can just
    call addChild()
    In an MXML project I can add objects to the stage by first
    adding them to a UIComponent, then adding that to the stage.
    1. Is that the best way to do it?
    In this doc:
    http://livedocs.adobe.com/flex/3/html/help.html?content=05_Display_Programming_02.html
    it says that
    quote:
    Each SWF file has an associated ActionScript class, known as
    the main class of the SWF file. When Flash Player opens a SWF file
    in an HTML page, Flash Player calls the constructor function for
    that class and the instance that is created (which is always a type
    of display object) is added as a child of the Stage object. The
    main class of a SWF file always extends the Sprite class
    2. why cant I just add a sprite object direct to the stage
    without the UIComponent?
    3. What is the 'main class', and how can i get access to it?
    B. How to access stage properties.
    =========================
    In an action script project that extends Sprite I can just
    call trace(stage.framerate)
    But in an MXML file I cannot figure out how to access the
    stage properties.
    See the attached code for the things that I tried, but which
    didnt work.
    In the page:
    http://www.actionscript.org/forums/showthread.php3?t=140655
    It says
    quote:
    For stage access you have a couple of rules:
    * natively, only display objects have inherent access to
    stage
    * display objects only have a valid reference to stage if
    they're within the stage's display list (on the screen, after added
    to it with addChild)
    * The only display objects which immediately have access to
    the stage before the use of addChild (in their constructor) are the
    document/application class instance (root) and any instance from
    the library placed on the timeline (not created with AS).
    * Non-display object classes have to be passed or assigned a
    reference to the stage from another object which already has access
    to it - they cannot access it otherwise.
    4. How do I access the stage properties in the MXML project?
    5. I suspect this is related to the "main class", which I
    dont yet understand - is it?
    Sorry for the long post.
    cheers
    tom

    "tom saffell" <[email protected]> wrote in
    message
    news:gd7cm9$d1v$[email protected]..
    > Thanks Luigi - that helps a lot.
    > I hadnt seen the Flex 3 Developer Guide before - it's
    very useful.
    >
    > I now see that I can access properties of the
    application object directly
    > with
    > this.<property>.
    > However, the framerate property cannot be set by
    actionscript, only in
    > MXML (I
    > can set it in the <mx:application> tag). But I
    need to be able to set it
    > programatically, dependent on user input.
    >
    > 5. Is there a way around this?
    > 6. Can I set the stage's framerate to achieve the same
    outcome?
    >
    > I still dont understand why I cannot access the stage
    object. When I call
    > either
    this.stage or
    uic.stage * then I get
    quote:
    Cannot access
    > a
    > property or method of a null object reference.
    My understanding is
    > that I
    > can access the stage object via any display object on
    the display list.
    > I'm
    > confused about this bit..
    >
    > * - uic is a UIComponent that has been added to the
    display list (i think)
    > by
    > calling addChild(uic) from the AS3 within the
    application
    >
    > 7. How do I access stage properties in AS3 in an MXML
    project?
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=05_Display_Programming_10.html
    It seems like possibly your real problem is that you're
    having trouble
    searching the Help effectively:
    http://flexdiary.blogspot.com/2008/07/getting-help-in-flex-builder.html

  • List of all objects in the data dictionary

    How to capture the list of all objects in the data dictionary named like PSDFDI and verify they are granted to the FDIREADR role

    See the database security guide http://docs.oracle.com/cd/B28359_01/network.111/b28531/authorization.htm#BABFHBFH
    Finding Information About User Privileges and Roles
    This section discusses the system views that have the grant information.
    The tricky part of this is that because roles can be granted to other roles the data is hierarchical.
    So start with the grants made to the FDIREADR role. So referring to the doc above;
    select * from role_role_privs where role = 'FDIREADR'will list the roles granted to your role.
    You will want to look at ROLE_ROLE_PRIVS, ROLE_TAB_PRIVS and ROLE_SYS_PRIVS.
    I suggest you walk thru the views manually to see how the information is related. Then write a test script that queries the views for you.

  • Positioning and temporarily hiding objects on the stage

    (Flash newbie here - bear with me...)
    I have two graphic objects on the stage overlapping each
    other. The first I was able to position to the document boundaries
    just fine. When adding the second object, however, the first object
    covers the boundaries so I cannot see them to align the second
    object.
    The question: Is it possible to temporarily hide an object on
    the stage so I can see the stage boundaries to position another? I
    don't see any options that will allow me to do this.
    Thx!

    there is a little colored square on each layer, to the right
    of the layer name, click that square on the layer that the first
    object resides, it will then just show an outline. click it again
    to bring it back. You can also click the first 'dot' next to the
    layer name, it will completely hide the contents of that
    layer.

  • Transport Release Error: Not all objects in the request could be locked.

    Hi all!
    I hope you can help me with this one.
    We need to transport a particular request in our QA and Production client. However, upon releasing of the transport request number, a warning/error message appeared on the screen:
    'Not all objects in the request could be locked. Do you want to release anyway?'
    I tried to display the error and below is the object messages:
    Object messages: R3TR TABU ZLIFNR
    Task F5DK900107 belongs to a different category
    I don't know what that means, but I noticed that there are too many objects under the customizing task which I think is not part of the latest customization. I'm not sure what to do, I hope somebody could give me some advise.
    Thank you very much.
    Regards,
    April

    Hi!
    There are many IMG activities under that same request which is not supposed to be transported to QAS. Is it possible to transfer the IMG activity and other customization into a new transport request? if possible, how?
    I'm thinking if I can just try to change/save again the new configuration to a new transport request number. But if there's an easier way to solve this problem, I will consider that option.
    =) Thank you...

  • Duplicating the motion of an object across the stage

    Suppose I have a single moving object on the stage is it possible to replicate the object at regular intervals across the stage WITH the motion?

    Is this motion achieved through actionscript or is it a tween on the stage? If this is a tween on the main timeline on the stage, then you could make that animation a movieClip and play the movieClip at an interval, maybe using a timer. If the animation is achieved using actionscript then write the animation as a function and call the function at an interval, again, possibly using a timer.

  • Problem removing Objects from the stage in Flash CS4 (AS3.0)

    I have a problem with this code:
    this.addEventListener(Event.ENTER_FRAME, vanish);
    function vanish(event:Event):void{
         if(character_mc.hitTestObject(vanish_mc)){
              vanish_mc.parent.removeChild(vanish_mc);
    There are two overlapping objects on my stage: character_mc and vanish_mc.
    As soon as i start the scene[Ctrl+Enter] vanish_mc is VISUALLY removed. But the code still sees a collision somehow. How can i Entirely remove the object vanish_mc?
    Thank you for help and advice.

    Ah I think the problem is what my problem not which I proposed, my bad I was trying to keep it simple.
    the remove code in my problem actually looks like this:
    if(character_mc.hitTestObject(this["dollar_mc_"+String(i)])){
         removeChild(this["dollar_mc_"+String(i)]);
    I wanted it to be that way so I could add infinite "dollar_mc_" ' s without writing myself to death with code and or getting confused.
    Imagine it like a game where a character it picking up dollars, which would disappear once they intersect.
    And that exactly is what gives me that argument.
    Do you know a way i could write this code, or do you suggest to leave it that way...because it does run and work im just getting this argument while debugging.
    Thank you for all the help~

  • Accessing display object on the stage from another class

    I've googled this to no avail, I've only found how to manipulate the stage itself and not a display object on it, and I'm noob enough to not be able to figure it out from there. :/
    I have a movie clip on the main timeline with instance name displayName. I created a button that should change what frame displayName goes to (in order to...did you guess it?! diplay the Name of the button. Awesome. )
    So I am trying to write the code in a reusable fashion and have the buttons all linked to a class called GeoPuzzle. Inside GeoPuzzle I instantiate a touch event and run the code. However, the function has to be able to change displayName in the main part of the timeline and, of course, the compiler says displayName doesn't exist because I'm in a class and I'm talking about the stage.
    Here is the simplified code in the class:
    package  com.freerangeeggheads.puzzleography {
        import flash.display.MovieClip;
        import flash.events.TouchEvent;
        public class GeoPuzzle extends MovieClip {
            //declare variables
            public function setInitial (abbrev:String, fullName:String, isLocked:Boolean):void {
                //set parameters
                this.addEventListener(TouchEvent.TOUCH_BEGIN, geoTouchBeginHandler);
            public function GeoPuzzle (): void {
            public function geoTouchBeginHandler (e:TouchEvent): void {
                   e.target.addEventListener(TouchEvent.TOUCH_END, geoTouchEndHandler);
                   //some other methods
                   nameDisplay.gotoAndStop(e.target.abbrev);
            public function geoTouchEndHandler (e:TouchEvent): void {
                //some other methods
               nameDisplay.gotoAndStop("USA");
    The lines in bold are my problem. Now this code doesn't actually execute as is so if you see an error in it, yeah, I have no idea what the problem is, but it DID execute before and these lines still gave me trouble so I'm trying to troubleshoot on multiple fronts.
    How can I tell displayName to change it's current frame from within display object class?
    Thanks!

    if displayName is a GeoPuzzle instance, use:
    package  com.freerangeeggheads.puzzleography {
        import flash.display.MovieClip;
        import flash.events.TouchEvent;
        public class GeoPuzzle extends MovieClip {
            //declare variables
            public function setInitial (abbrev:String, fullName:String, isLocked:Boolean):void {
                //set parameters
                this.addEventListener(TouchEvent.TOUCH_BEGIN, geoTouchBeginHandler);
            public function GeoPuzzle (): void {
            public function geoTouchBeginHandler (e:TouchEvent): void {
                   e.target.addEventListener(TouchEvent.TOUCH_END, geoTouchEndHandler);
                   //some other methods
                   this.gotoAndStop(this.abbrev);
            public function geoTouchEndHandler (e:TouchEvent): void {
                //some other methods
               this.gotoAndStop("USA");

  • Access object on the stage using an as3 widget

    I am trying to use a FlashPro as3 widget and Captivate 6, to toggle an image on the Captivate stage (hide/show) and can't find enough information on how to access the stage objects.
    I can use 
    var numKids:int = parent.parent.parent.numChildren() 
    to see the number of children (of the stage object?) , but can't seem to figure out how to hide or show the child objects (image, button or anything).
    My image names in my Captivate Project are Img_Einstein1 and Img_Einstein2.  They reside on a blank slide along with two buttons and another widget.
    I have looked at Tristen's web site and found a lot of useful information, but I guess I am just not putting it all together.  Because I am a contractor I can't use the Widget Factory or purchase outside widgets.
    Any help will be greatly appreciated!

    On 6 you don't have shared actions yet. I don't understand the explanation with 20 and 10. There are several examples of toggle buttons on my blog. For showing/hiding here a simple one:
    http://blog.lilybiri.com/blog-after-posterous-clickclick

  • Accessing display objects via the stage var

    I'm passing a stage reference to my class, but when I try to
    access a movieclip on the stage I get an error.
    this gives me an error:
    var mc = targetStage.myMovieClip;
    Thanks!

    var myClass = new MyClass (this.stage);
    That would be the same thing, this.stage would refer to the
    Stage instance. Each .swf has one Stage instance. In a Flash
    project, the stage has one child, the MainTimeline instance.
    MainTimeline is basically a big MovieClip, and it contains all your
    objects, scenes and timelines you create in Flash.
    So, if you instantiate from the main timeline itself (either
    on a frame script or Document class) you are already inside
    MainTimeline, which is what you want to pass along a reference to,
    so you would pass in "this" as Colin said, or "root".
    Colin mentioned that MovieClip(root) would work anyway; if I
    understand he is referring to the fact that every DisplayObject
    (such as MovieClips and SimpleButtons created in Flash) already
    have a "root" property that usually refers to the MainTimeline
    instance. However, your class "MyClass" does not extend
    DisplayObject so there is no root property available, which is why
    you need to manually pass in a reference to the root
    timeline.

Maybe you are looking for

  • When I shut off the computer, firefox say's trouble with ending, and then it won't save my bookmarks that i had prior. I'm losing a lot of work why is this? It won't save my bookmarks.

    when on websites, after certain time the computer freezes for time, the firefox commit charge seems to get too high to work properly. When I shut my computer to reboot, i lose my bookmarks that i had placed in my bookmark files. I lose a lot of work.

  • Thread pool library

    Hello all, Does anybody know an open-source library that provides a thread pool with the following behavior? When a task is submitted... if (there are idle threads in the pool) {     use an idle thread to execute the task. } else {     if (currentThr

  • Subroutine call from SAP Script

    Hi, I need to calculate required/outstanding qty. hence am passing existing values of reservation#/item# and issued qty. both req/out qty are returned blank by the code. please help. Following is my code segment for a external routine call from SAP S

  • How to make movable tab ?

    Hi, I have some question with Tab. I want to make any tab that it can be moved . like Eclipse editor tab, Net beans editor tab.. I try to make tab selection on mouse drag, but It works only change to selected tab index. I think that movable tab imple

  • Automatic Red Eye on Import causing major issues

    Hi everyone, I am a new user to PSE 7 and the other night I was bringing all my photos into the organizer.  I chose to use the automatic remove red eye on import and to suggest stacks.....everything seemed to go fine, but i noticed after the import t