Canvas, click events for the child objects

I am trying to record an event for each child object.
and I use the following code

http://livedocs.Adobe.com/Flex/3/HTML/Help.HTML?content=events_08.html
in the part of the examples (second example)

However, I am dynamically add custom Image objects extended and when click on a displayed Image and check for its type if its correct type, it would just return false.
Alert.Show ((event.target_est_dans_MyAClass).toString ());

When clicking on one of the children is opposed and display the event.target.name and it's just also displays a silly 'FlexLoader74' or whatever number. Somehow, it loses its properties or the type of the object.

Is there something that I am missing?

The loaded image, you click on IS what would return with event.target. It is added to your image class extended as a child of this class. So it's probably that you want to do:

Alert.Show ((event.target.parent_est_dans_MyAClass).toString ());

Keep in mind that if EMBED you your images in your image personalized instead compile-time class, then you can check for this as you did before:

Alert.Show ((event.target_est_dans_MyAClass).toString ());

TS

Tags: Flex

Similar Questions

  • Add on Click event for the button

    Hi Experts

    I have a button in my INDD file. Now, I want to add behaviors show/hide buttons when you click the button. How I can do this via Javascript ID CS5 Windows.

    Thanks in advance

    Concerning

    Arul

    Hi Arul,

    Here is the solution for your problem:

    var myDoc = app.documents[0];
    var myBtn = myDoc.buttons[0];
    
    var bShw = [myDoc.buttons[1], myDoc.buttons[2]];
    var bHid = [myDoc.buttons[3], myDoc.buttons[4]];
    
    var addBeh = myBtn.showHideFieldsBehaviors.add();
      addBeh.behaviorEvent = BehaviorEvents.MOUSE_UP;
      addBeh.fieldsToShow = bShw;
      addBeh.fieldsToHide = bHid;
    

    Do not forget that the bShw and acachees are arrays of keys.

    Hope that helps.

    --

    Marijan (tomaxxi)

    http://tomaxxi.com

  • How do you attribute the click event of the object created dynamically?

    This is probably an easy question to answer:

    I'm iteration in an XML list, I created via a HTTP Service to load the XML file.  For each object, I want to create a LinkButton which will link to a URL.

    However, since I created the LinkButton object in ActionScript instead of MXML, I can't understand how to assign a click event, for example navigateToURL()

    How to assign as the LinkButton should do the mouse click?

    I know that someone will be able to answer this, then... Thanks in advance!

    myLinkButton.addEventListener(MouseEvent.CLICK,myClickFunction);
    

    and your event listener function

    private function myClickFunction(e:MouseEvent):void{
                        //do something
                   }
    
  • Kill the MouseEven.CLICK event when the mouse is held down?

    I studied games on Facebook and trying to emulate mouse events management. For example, in ChefVille, you can click on the objects and drag them around. But if you hold the mouse down you pan all the game environment and when you release the mouse button a click is NOT on the object under the mouse. In my tinkering the click event will be triggered by the release of the mouse button, no matter how many time keep the button pressed. How can I keep the trigger CLICK event if the mouse is held down for a certain period of time?

    I don't know that you can cancel a CLICK event in the middle of what is happening (click = MOUSE_DOWN followed MOUSE_UP), but you can start a timer on the MOUSE_DOWN event and its event handler to set a Boolean variable that can make your event HANDLER function used to decide or not to treat a CLICK event.

  • Related XML element for the Address object tags

    Hi all

    I'm trying to insert a child object address related, in an account object. I have successfully done a test, but now I can not all data in the field "Address 2" because it says that the item is not defined in the EAI integration.

    Someone at - it a complete list of tags for the Address object? I already tried 'Address2', 'Address_2' and 'StreetAddress2', but none of this seems to work.

    I also resorted to the use of the service API to get mapping for the Account object and RelatedAddress object. object mapping has just returned to me the shipping and billing address fields while the object of RelatedAddress reported that there was.

    I hope someone can help me out here, because trying to find the element tag name is driving me crazy!

    Hello!

    In the WSDL of account, you have the ListOfAddress object. If you use it, fill in the field "StreetAddress2" should work...

    Max

  • button refresh Foxfire did not work when clicked on for the past two weeks

    button refresh Foxfire did not work when clicked on for the past two weeks

    Hi, see controls customize Firefox, buttons and toolbarsand click on restore default settings.

    If this does not help, Try Firefox Safe Mode to see if the problem goes away. Firefox Safe mode is a troubleshooting mode that temporarily disables hardware acceleration, restores some settings and disables add-ons (extensions and themes).

    If Firefox is open, you can restart Firefox Safe mode in the Help menu:

    • Click the menu button

      click Help

      then select restart with disabled modules.

    If Firefox does not work, you can start Firefox in Mode safe as follows:

    • On Windows: Hold down the SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac: Hold the option key during the startup of Firefox.
    • On Linux: Exit Firefox, go to your Terminal and run firefox-safe-mode
      (you may need to specify the installation path of Firefox for example/usr/lib/firefox)

    When the Firefox Safe Mode window appears, select "start mode safe."

    If the problem is not present in Firefox Safe Mode, your problem is probably caused by an extension, theme or hardware acceleration. Please follow the steps described in the section Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems to find the cause.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. This might help others with the same problem.

  • Capture the click event of the button 'back' on DateTimePicker

    How to capture the click event of the button "return" on the DateTimePicker control.

    Show us in the form DateTimePicker.doModal)

    I know that this response is late, but if someone else is asking about this.

    doModal() returns a Boolean value and returns false if the user clicks Cancel.

    I hope this helps.

  • How to access the child object of a movieclip

    Hi, I made the pictures dynamically and I access Bastien is child movieclip

    var totalThumbs:Array = new Array()

    var ThumbMC:MovieClip()

    var childThumb:MovieClip()

    var xpos:Number = 10

    for (var i: Number = 0; i < 10; i ++) {}

    ThumbMC = new thumbOb() //thumbOb is the movieclip in the library class

    addChild (ThumbMC)

    ThumbMC.x = xpos

    childThumb = new animationclip() //animationclip is the movieclip in the library class

    ThumbMC.addChild (childThumb)

    ThumbMC.addEventListener (MouseEvent.Click, thumbClick)

    XPos += 100

    }

    function thumbClick(event:MouseEvent):void {}

    event.target.childThumb.gotoAndPlay ("clicked") < < THIS ERROR SHOWING

    }

    There are a number of errors in what you show so I have to imagine that you are not in strict mode minimum of coding.  You should avoid using event.target and event.currentTarget are using, otherwise you are likely to find the target, it's not what you expect it to be.  currentTarget is always linked to the object that has the assigned listening port, not children of that object (using target may end up doing).

    When you add dynamically content, targeting usual syntax parent.child does not work.  You start to use other means of access to the child.  One way is to store the child in another reference (like a table) and directly target.  Another way would be to use the getChildByName() method... Here is an example of using this approach...

    var xpos:Number = 10;

    for (var i: Number = 0; i<10;>
       
    var ThumbMC = new thumbOb();  thumbOb is the class movieclip in the library
    ThumbMC.num = i;
    addChild (ThumbMC)
    ThumbMC.x = xpos
       
    var childThumb = new animationclip() //animationclip is the movieclip in the library class
    childThumb.name = "childThumb" + String (i)";
    ThumbMC.addChild (childThumb)
       
    ThumbMC.addEventListener (MouseEvent.CLICK, thumbClick)
    XPos += 100
    }

    function thumbClick(event:MouseEvent):void {}
    var childThumb is MovieClip (event.currentTarget) .getChildByName ("childThumb" + String (event.currentTarget.num));.
    childThumb.gotoAndPlay ("clicked");
    }

  • MouseEvent.CLICK blocked by the child bitmap problem

    Hey guys.

    If anyone has experienced this problem or is sufficiently educated so that you can come up with a working solution then please post here.

    Good so for now I have 2 SWF files. A swf is the main swf, which contains a class called Avatar. This class extends Sprite and has 1 child, which is a bitmap image.

    What I do is load the child swf file into the main swf, create an object of the Avatar class and pass the Avatar object down to the child swf file.

    The child swf file takes this object and adds it to a Sprite object as one of its children. Then I add an event listener for MouseEvent.CLICK to Sprite (the one containing the Avatar sprite) object that is in the child swf file.

    Now when I click on the Avatar inside the Sprite image in the child swf file. Do not fire the mouse click event.


    If you can shed some light as to why this happens, I would be very grateful.

    Thank you.

    Difficult to say without seeing a code.

    As you describe it - it should work. How do you know that MOUSE_CLICK is not pulled?

    In addition, there are masks?

  • Components customized QML: management of the events of the child controls

    The tutorial here:

    https://developer.BlackBerry.com/Cascades/documentation/UI/custom_components/custom_components_tutor...

    Shows how to use the alias so that you can read the values of the properties of the child controls.

    It would be good to have a code example that shows how to hang children change events. For example, if your custom control has a control segment, how to make the custom control user be notified when there is a click on segment control event or when the value of this control is changed.

    Signals can be easily created in QML and exposed from a QML file that is customized to be listend to another. The following article explains the basic process:

    https://developer.BlackBerry.com/Cascades/documentation/UI/signals_slots/index.html

    In its simplest form, a signal is created in QML using the following format:

    signal signalName (variableType variable1,...)

    In the QML implementation of this custom control file, you will now have a manager of signal onSignalName created automatically for you.

    I covered this topic in my last webcast and created a sample file that looks like this:

    https://developer.BlackBerry.com/Cascades/documentation/videos/index.html

    Beta 1: Astonishing UIS using the new framework of BlackBerry 10 - part 2

    The sample was created against the Beta 1 of the NDK for BlackBerry 10 but the QML (TaskControl.qml) file should work fine in the beta 2 release. If you are having trouble please post it here and I will consider.

    Kind regards

  • LVOOP: Common accessor for the child classes?

    I am reletively new to LVOOP and OBJECT oriented programming in general. I used very simple classes as a replacement for clusters several times, and now I have an architecture intended to convert most of my code into classes, dynamic distribution screw and similar.

    However, I run in to an issue, which basically boils down to laziness: I really don't want to do a lot of the same dynamic send screws I want to have a VI parent to be able to write a piece of data common to all children. Preference gives an error if the child does not have this data element.

    I guess it's quite similar to dynamic distribution, but without having to write a DD VI for each class.

    Is it possible to have the VI parent to access the data of the child? If so, how?

    Here is an example of my hierarchy:

    Test.lvclass (parent)

    DC_test.lvlcass (data: test number, 2D, time stampresults)

    Transfer_Curve_test.lvlcass (data: results of tests settings, 1 d, timestamp)

    Breakdown_test.lvlcass (data: test number, 3D, timestampresults)

    ... 28 another test

    As you can see, the data type only common between them is the timestamp. I want to be able to use a VI in the parent class to write data in the child class.

    You have it backwards autour.

    The data that is common belongs to the parent class, not the class of the child.

    Data that are not common may not be processed by the parent class and must be transformed by the child class.

    You don't need to CREATE truly dynamic shipping screws for a common data type.  If you just don't set the VI at all, it will be called the parent instance.

    Shane.

  • Update for the child entity Siebel.

    Hello

    Here is the answer of the OPA. Here the overall entity is Action. There is "Time Tracker" entity which is 'actiontime' in relation to the overall entity.

    <? XML version = "1.0" encoding = "UTF-8"? >
    -< SiebelMessage MessageId = "" IntObjectName = 'Strategy of automation Response' MessageType = 'Object' IntObjectFormat = "Hierarchical Siebel" > "
    -< response >
    -< name of the entity 'global' = >
    -name of the entity instance = 'global' row 'global' = >
    -< relationship name = "actionexpense" deducted = 'false' known = "false" >
    < target name = "ExpenseTracker-8SIA-7Z0YG" / >
    < target name = "ExpenseTracker-8SIA-7Z0YH" / >
    < / relationship >
    -< relationship name = "actionsr" deducted = 'false' known = "false" >
    < target name = "SR-2SIA-12FN7" / >
    < / relationship >
    -< relationship name = "actionpart" deducted = 'false' known = "false" >
    < target name = "PartTracker-8SIA-7Z0YJ" / >
    < target name = "PartTracker-8SIA-7Z0YI" / >
    < / relationship >
    -< relationship name = "actiontime" deducted = 'false' known = "false" >
    < target name = "TimeTracker-8SIA-7Z2VR" / >
    < / relationship >
    -< attribute status = 'value' name = "EntitledActivity" type = "boolean" >
    < value > true < / value >
    < / attribute >
    -< attribute status = 'value' name = "Standard_Hours" type = "number" >
    < value > 10.0 < / value >
    < / attribute >
    -< attribute status = 'value' name = "Overtime_Hours" type = "number" >
    < value > 7.0 < / value >
    < / attribute >
    < / entity instance >
    < / entity >
    -< name of the entity 'Right' = >
    -name of the entity instance = row 'right-2SIA-10W58"="10W58">
    -< relationship name = "entitlementservicedetails" deducted = 'false' known = "false" >
    < target name = "ServiceDetails-8SIA-7Z0NS" / >
    < target name = "ServiceDetails-8SIA-7Z0NR" / >
    < / relationship >
    -< relationship name = "contract_contractentitlement_rev" deducted = 'false' known = "false" >
    < target name = "Contract-2SIA-10W4N" / >
    < / relationship >
    -< attribute status = 'value' name = "EntId" type = "text" >
    < value > 2SIA-10W58 < / value >
    < / attribute >
    < / entity instance >
    -name of the entity instance = row 'right-2SIA-10W56"="10W56">
    -< relationship name = "contract_contractentitlement_rev" deducted = 'false' known = "false" >
    < target name = "Contract-2SIA-10W4N" / >
    < / relationship >
    -< attribute status = 'value' name = "EntId" type = "text" >
    < value > 2SIA-10W56 < / value >
    < / attribute >
    < / entity instance >
    -name of the entity instance = row 'right-2SIA-14NLC"="14NLC">
    -< relationship name = "contract_contractentitlement_rev" deducted = 'false' known = "false" >
    < target name = "Contract-2SIA-14NKX" / >
    < / relationship >
    -< attribute status = 'value' name = "EntId" type = "text" >
    < value > 2SIA-14NLC < / value >
    < / attribute >
    < / entity instance >
    < / entity >
    -< name of entity "SR" = >
    -name of the entity instance = row "SR-2SIA-12FN7" = "12FN7" >
    -< relationship name = "global_actionsr_rev" deducted = 'false' known = "false" >
    < name target = 'global' / >
    < / relationship >
    -< relationship name = "srcontract" deducted = 'false' known = "false" >
    < target name = "Contract-2SIA-10W4N" / >
    < target name = "Contract-2SIA-14NKX" / >
    < / relationship >
    -< attribute status = 'value' name = "SRStatus" type = "text" >
    Open < value > < / value >
    < / attribute >
    -< attribute status = 'value' name = 'OpenDate' type = ' date' >
    < value > 17/11/2003 < / value >
    < / attribute >
    < / entity instance >
    < / entity >
    -< name of entity 'ExpenseTracker' = >
    -name of the entity instance = row "ExpenseTracker-8SIA-7Z0YG" = "7Z0YG" >
    -< relationship name = "global_actionexpense_rev" deducted = 'false' known = "false" >
    < name target = 'global' / >
    < / relationship >
    -< attribute status = 'value' name = "ExpenseType" type = "text" >
    < value > airfare < / value >
    < / attribute >
    -< attribute status = 'value' name = 'Amount' type = "number" >
    < value > 33.0 < / value >
    < / attribute >
    < / entity instance >
    -name of the entity instance = row "ExpenseTracker-8SIA-7Z0YH" = "7Z0YH" >
    -< relationship name = "global_actionexpense_rev" deducted = 'false' known = "false" >
    < name target = 'global' / >
    < / relationship >
    -< attribute status = 'value' name = "ExpenseType" type = "text" >
    car rental < value > < / value >
    < / attribute >
    -< attribute status = 'value' name = 'Amount' type = "number" >
    < value > 123,0 < / value >
    < / attribute >
    < / entity instance >
    < / entity >
    -< entity name = "PartTracker" >
    -name of the entity instance = row 'PartTracker-8SIA-7Z0YJ"="7Z0YJ">
    -< relationship name = "global_actionpart_rev" deducted = 'false' known = "false" >
    < name target = 'global' / >
    < / relationship >
    -< attribute status = 'value' name = "PartNumber" type = "text" >
    2250 X < value > < / value >
    < / attribute >
    -< attribute status = 'value' name = "AssetNumber" type = "text" >
    < value > AA2250-001 < / value >
    < / attribute >
    < / entity instance >
    -name of the entity instance = row 'PartTracker-8SIA-7Z0YI"="7Z0YI">
    -< relationship name = "global_actionpart_rev" deducted = 'false' known = "false" >
    < name target = 'global' / >
    < / relationship >
    -< attribute status = 'value' name = "PartNumber" type = "text" >
    2250 X < value > < / value >
    < / attribute >
    -< attribute status = 'value' name = "AssetNumber" type = "text" >
    < value > AA2250-001 < / value >
    < / attribute >
    < / entity instance >
    < / entity >
    -< name of the entity 'Contract' = >
    -name of the entity instance = row "Contract-2SIA-10W4N" = "10W4N" >
    -< relationship name = "contractentitlement" deducted = 'false' known = "false" >
    < target name = "Right-2SIA-10W58" / >
    < target name = "Right-2SIA-10W56" / >
    < / relationship >
    -< relationship name = "sr_srcontract_rev" deducted = 'false' known = "false" >
    < target name = "SR-2SIA-12FN7" / >
    < / relationship >
    -< attribute status = 'value' name = 'ContractId"type ="text">
    < value > 2SIA-10W4N < / value >
    < / attribute >
    < / entity instance >
    -name of the entity instance = row "Contract-2SIA-14NKX" = "14NKX" >
    -< relationship name = "contractentitlement" deducted = 'false' known = "false" >
    < target name = "Right-2SIA-14NLC" / >
    < / relationship >
    -< relationship name = "sr_srcontract_rev" deducted = 'false' known = "false" >
    < target name = "SR-2SIA-12FN7" / >
    < / relationship >
    -< attribute status = 'value' name = 'ContractId"type ="text">
    < value > 2SIA-14NKX < / value >
    < / attribute >
    < / entity instance >
    < / entity >
    -< name of the entity 'TimeTracker' = >
    -name of the entity instance = row "TimeTracker-8SIA-7Z2VR" = "7Z2VR" >
    -< relationship name = "global_actiontime_rev" deducted = 'false' known = "false" >
    < name target = 'global' / >
    < / relationship >
    -< attribute status = 'value' name = "Time_Tracker_Cost" type = "currency" >
    < value > 275,0 < / value >
    < / attribute >
    -< attribute status = 'value' name = "Total_Overtime_Hours" type = "number" >
    < value > 7.0 < / value >
    < / attribute >
    -< attribute status = 'value' name = "BillingRateType" type = "text" >
    < value > Normal < / value >
    < / attribute >
    -< attribute status = 'value' name = "Total_Standard_Hours" type = "number" >
    < value > 10.0 < / value >
    < / attribute >
    -< attribute status = 'value' name = "Time_Tracker_Price" type = "currency" >
    < value > 175,0 < / value >
    < / attribute >
    < / entity instance >
    < / entity >
    -< name of entity 'ServiceDetails' = >
    -name of the entity instance = row "ServiceDetails-8SIA-7Z0NS" = "7Z0NS" >
    -< relationship name = "entitlement_entitlementservicedetails_rev" deducted = 'false' known = "false" >
    < target name = "Right-2SIA-10W58" / >
    < / relationship >
    < / entity instance >
    -name of the entity instance = row "ServiceDetails-8SIA-7Z0NR" = "7Z0NR" >
    -< relationship name = "entitlement_entitlementservicedetails_rev" deducted = 'false' known = "false" >
    < target name = "Right-2SIA-10W58" / >
    < / relationship >
    < / entity instance >
    < / entity >
    < / answer >
    < / SiebelMessage >


    I need to update the Action and Time Tracker BC in the Siebel.

    Action - (attributes: Standard_Hours, Overtime_Hours)

    Time Tracker - (attributes: Time_Tracker_Cost Time_Tracker_Price)

    I use the engine of Transformation of data EAI for transfform data. But the child node is not built.

    Please help me.

    Thank you
    Amol

    Unfortunately we have not all people who are very experienced with Siebel on this forum. It seems to me that it should be possible using the Transformation engine. The other option is to transform the XML into a PropertySet, retrieves the values that you want to update, and then update in the appropriate component of the company.

  • Facing problem in the CLICK event of the PANEL

    Hello
    Am facing a problem with the event click on the PANEL.

    During the click event try to change the background color of this one.
    Inside this group got many components such as DATAGRID, LIST etc, when I click on these components and alsoo bottom panel is changed.
    I want the background of the Panel must be changed when I click PANEL only... not on its internal components...

    How to do this... code used to change BG is give below...

    tempPanel.addEventListener (MouseEvent.CLICK, changeBG);

    public void changeBG(event:MouseEvent):void
    {
    this.styleName = "selectedPanel"; some CSS style
    }

    Hey get...

    event.currentTarget.drawFocus (true);

    This will help to draw the border for the selected component...

  • Flow of events for the head-scratching?

    There is a lot of talk about how the new event stream makes easier communication between classes. This sounds swell, but nowhere is well explained. All the examples I find concerns dispatching of events within the same class or looped through a customEvent, but I need a way to tap into this event for communication flow backward.

    I have a document mainGUI class which distributes subclasses of my application. How can I configure a listener in mainGUI which brings together some events of any of his children or grandchildren? And how do I use this line to display the properties of the object?

    It's good now. I managed carefully dissecting Lee Brimelow's excellent oopscrollbar at gotoandlearn, do a bunch of reconfigurations. Seems AS3 is not that you are wicked Uncle after all.

  • How to view resource for the user object?

    Hello

    I have the following requirement:

    1. the user connects to select 'Requests', then resources.
    2. select Grant resource, select 'Users', add the users, select resources, then click on continue.
    3. IOM has a page with the selected user name, selected resources, and the submit"" button.

    Is it possible to have a step between 2 and 3, in which IOM would show the resource object form, so that the applicant can select an organization and an expiration date? Or he could be on page 3, and the user can change the resource by adding the Organization and expiration date?

    These 2 are the fields for this resource.

    Thank you

    Khanh

    Have you checked automatic backup on the resource object in the Console Design?

    If so, uncheck the box which and try...

Maybe you are looking for