Passing data to event handler function

I am trying to pass value to the event handler function but I
am getting the following error. Can someone please tell me what I
am doing wrong?
1067: Implicit coercion of a value of type void to an
unrelated type function
here is the code
private function myClickListener(myid:int):void{
Alert.show("The button was clicked");
public function handleStringResult(event:ResultEvent):void{
catInfo = event.result as ArrayCollection;
for each(var o:Object in catInfo){
var b:Button = new Button();
b.label = o.FILLCOLOR;
b.id=o.CATID;
b.setStyle("fillColors",['#'+o.FILLCOLOR,'#'+o.FILLCOLOR]);
b.setStyle("color","#FFFFFF");
b.setStyle("fontFamily","Arial");
b.setStyle("fontSize",8);
b.setStyle("textRollOverColor", "red");
b.addEventListener(MouseEvent.CLICK,
myClickListener(o.CATID));
myvbox.addChild(b);
]]>

"Merlyn MM" <[email protected]> wrote in
message
news:[email protected]...
> Sure, Here is the code. I am very new to flex and if my
code doesn't make
> sense
> then please let me know the correct way to do this. I
really appreciate
> you
> taking time!
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
> layout="absolute"
> backgroundColor="#FFFFFF"
> initialize="myService.getcategories.send()">
> <mx:WebService id="myService"
> useProxy="false"
> wsdl="
http://devsite/rc/category.cfc?wsdl"
> showBusyCursor="true">
> <mx:operation name="getcategories"
> result="handleStringResult(event)"
> fault="Alert.show(event.fault.message)"/>
> <mx:operation name="getsubcounties"
result="handleStringResult(event)"
> fault="Alert.show(event.fault.message)"/>
> <mx:request>CATID</mx:request> //need to
pass category ID here
> </mx:operation>
> </mx:WebService>
>
> <mx:Script>
> <![CDATA[
> import mx.collections.ArrayCollection;
> import mx.rpc.events.ResultEvent;
> import mx.rpc.events.FaultEvent;
> import mx.controls.Alert;
> import mx.controls.Button;
>
> [Bindable]
> private var catInfo:ArrayCollection;
>
> private function myClickListener(myId:String):void{
>
> myService.getcounties.send() // I need to send catid
here to the
> webservice
> }
>
>
> public function
handleStringResult(event:ResultEvent):void{
> catInfo = event.result as ArrayCollection;
> for each(var o:Object in catInfo){
> var b:Button = new Button();
> b.label = o.FILLCOLOR;
> b.id='btn'+o.CATID;
>
>
b.setStyle("fillColors",['#'+o.FILLCOLOR,'#'+o.FILLCOLOR]);
> b.setStyle("color","#FFFFFF");
> b.setStyle("fontFamily","Arial");
> b.setStyle("fontSize",8);
> b.setStyle("textRollOverColor", "red");
> b.addEventListener("click", myClickListener);
> myvbox.addChild(b);
> }
> }
> ]]>
> </mx:Script>
I'd change it to this:
private function myClickListener(e:Event):void{
//I don't see where you're using the ID, but to get it,
//use this code:
var myID = e.currentTarget.data;
myService.getcounties.send() // I need to send catid here to
the
webservice
public function handleStringResult(event:ResultEvent):void{
catInfo = event.result as ArrayCollection;
for each(var o:Object in catInfo){
var b:Button = new Button();
b.label = o.FILLCOLOR;
//note that you couldn't have used your ID
//as a "handle" to anything, so I replaced
//that logic with something you _could_ use
b.data=o.CATID;
b.setStyle("fillColors",['#'+o.FILLCOLOR,'#'+o.FILLCOLOR]);
b.setStyle("color","#FFFFFF");
b.setStyle("fontFamily","Arial");
b.setStyle("fontSize",8);
b.setStyle("textRollOverColor", "red");
b.addEventListener("click", myClickListener);
myvbox.addChild(b);
You could also use a Repeater and set this up in MXML.
HTH;
Amy

Similar Messages

  • I can't remove event handler functions

    Hi guys!
    Please help to remove event handler functions of a
    FLVPlaback. I add some functions for an FLVPlaback instance and
    that's why doesn't work the control panel (play button, pause
    button and so on) Here is a link:
    http://sexaid.fw.hu/vg/vg.html
    to understand simply the problem. thx every ideas!

    I would prefer not to announce the URL to the world on this forum, but I can say the old website still starts with the standard .Mac URL http://web.mac.com/username/iWeb and the new one until I set up to use my own domain was the same I believe.
    Empty the Cache has no effect I can still go to the URL and explore the various pages.
    I do not think that the .Mac websites are hosted from the iDisk location as I have defiantly deleted them from my iDisk and I have rechecked every file in the iDisk for any sign of them also my new iWeb '08 website never appeared in the iDisk. I would presume that the .Mac websites are hosted from a particular location on the Apple servers and I need to some how pull them off separately because publishing another new site with iWeb '08 has just left me with two sites and the old one remains and does not exist in iWeb '08 so I can unpublish it.

  • Passing parameters to event triggered functions

    hi all,
    i have created a button and added EventListener.
    as mybutton.addEventListener(MouseEvent.CLICK,clickSt art);
    when i implement the clickStart (event:MouseEvent) function i
    want to pass
    an array ,a String to this function as parameters .how can i
    do this.
    is it possible or not.
    thanx.

    Well, not in that way.
    The function automatically receives a parameter when you
    create a callback with that function by "addEventListener", such
    parameter is datatyped as the event type you defined in the
    callback, in your case "MouseEvent". If you want to pass more data
    when the function is called then you have to create your own event
    class because almost all events just inform when something has
    happened and send limited information. You can check the
    documentation about creating a custom event class, there is a lot
    of info about the topic.

  • Use movie clip event handler function, but not via an event

    Let's say I have the following code:
    var initObj = new Object();
    initObj.mood = "happy";
    mc = attachMovie("mcBox","instBox",100,initObj);
    mc.onPress = boxPress;
    function boxPress() {
    trace("Box mood: " + this.mood);
    Now, let's say there are times that I want to call boxPress()
    other than when the onPress event happens. In other words, I want
    to call boxPress() for a movie clip via my AS code, but not when an
    onPress event has occurred for that movie clip. Is this possible?
    Or is it possible to simulate or force an onPress event for a movie
    clip so that the handler function gets called for that movie clip?

    addEventListener only works with components in ActionScript 2
    "workingonasite" <[email protected]> wrote
    in message
    news:f1vu8r$92i$[email protected]..
    > So I am trying to get my head around event Listeners.
    When I use this
    > example
    > on a button it works fine:
    >
    > but when I add the same listener to a movie Clip on the
    stage with an
    > instance
    > name of "box", it does not work. Is there something
    basic I am missing?
    >
    >
    >
    > var buttonListener:Object = new Object();
    > buttonListener.click = function(eventObj:Object) {
    > trace("click");
    > };
    > mybutton.addEventListener("click", buttonListener);
    >

  • Passing data into event

    Simple Question: I have text controls that I wish to take values from when a button is pressed. Using Events, how do I get values and store them...

    Are the values needed in any other portion of the program other than when the button is pressed? If not, you could place the controls within the event structure so that their values are only read when the button controlling the event structure is read. Note, though, that if the values are passed from the event structure to other portions of the program you need to determine the best approach for passing data when the button is not pressed (perhaps passing through a value from the last event).
    In the event that the controls are needed in other parts of the program separate from the event structure you can use local variables to read the current value of the controls.
    I hope this helps.
    John

  • [JS] Event handler function is shown as the result in the ESTK

    I have a ScriptUI tree, with an onExpand event, like this:
    Window1.tvwTree.onExpand  = function (item){
        $.writeln(item.key + " is now expanded.");
    Every time the script is run, I get this in the Javascript console of the ExtendScript Toolkit:
    Execution finished. Result: onExpand()
    First question is: why?
    Second question: What's the best and cleanest way to take care of the onExpand event? I didn't manage to assign a function to the onExpand event, in the same way as I do for parameter-less functions.
    For simpler events, with no parameters, I do it like this:
    Window1.....DropDownList2.onChange = cboNewLanguage_onChange;
    ... but the onExpand event has its "item" parameter to take care of, and I don't manage to assign the function in a similar way. Please enlighten me.
    (Would it be possible to use a prototype approach, for events like this? Getting a common function for all onExpand events...???)
    Thanks,
    Andreas

    Hi Andreas,
    First question: what is supposed to be item.key? Have you extended the ListItem properties?
    The way you assign the onExpand function seems correct to me. The following code should work:
    var myExpandHandler = function(/*ListItem*/ item)
         // this => TreeView
         // item => expanded ListItem
         alert( item.text + ' is now expanded.' );
    myTree.onExpand = myExpandHandler;
    Alternately, you can create a generic handler through the TreeView prototype:
    TreeView.prototype.onExpand = function(/*ListItem*/ item)
         // this => TreeView
         // item => expanded ListItem
         alert( item.text + ' is now expanded.' );
    Works for me in CS4 & CS5+.
    Note: the onExpand function has no event listener counterpart, so you cannot use the form:  <widget>.addEventListener('expand', myEventListener).
    I don't know why your script causes the ESTK console to display "Result: onExpand()". Probably your code contains the corresponding $.writeln somewhere, doesn't it? Also, take into account that if your UI code uses sth like myListItem.expanded = true; then the onExpand handler is called before the win.show(). This may explain unexpected feedback in the console (?)
    @+
    Marc

  • Passing data to event

    Hello,
       I am new to workflow. Trying to configure a workflow.
       I have an event which is getting triggered on change of a change number.
       Workflow which is linked to this event is triggerd.
       But I could not send change number to event , so that it will pass to  workflow container.
       How can I  pass change number to event container , when event is triggered due to change documents.
    Regards,
    satya

    I could not send change number to event
    Well , what you can do is try to create a chnage number parameter to the event for which you want to trigger the workflow....
    Let say I have created a event in the BOR with name RASIE and I have defined one parameter to this event USER, now this user is SY-UNAME.
    There will be a point where you might be rasing the event by using FM SAP_WAPI_CREATE EVENT so here you have to pass the USER to the event container and from event container to workflow..
    YOu need to define the binding between event container and workflow container from the basic data of the workflow...

  • Function calling function passing data

    We have developed an MQSERIES utility that is a function that calls many related functions and its purpose is to perform a variety of MQSeries functions with minimal interaction required by the user. The user provides the message, an activity code (pd for puts, gd for gets, pr for putting requests for replies, etc.) and a couple other parameters. The user gets back the message, a return flag (good, bad, truncated, etc). . Our MQSERIES function is a function of the calling module. Our function has it's series of includes with classes, functions, etc. The calling program needs a couple includes (to define the passed data areas) and a function prototype of our function (void mqcmd090(typefilefdi &, typefilemsg &, typefilemdi &);) and after the user does string copies and so forth into the passed data areas they currently call the function (mqcmd090(currpassarea, currmessage, currquetable);) After our function is called these passed data areas are manipulated by the user's module. They inquire into the return code, they may do activity (with message ids, etc), they manipulate the message and may send it back (replies, etc). Our dilemma is this. The users want our module to be stand-alone. It should be compiled and linked by itself. Their module should be compiled and linked by itself. They don't mind having a couple includes for the common passed structures but our modules should not be a function in theirs.
    How can I compile our function (and how can they call it) so that we can keep the communications going both ways between modules? A system call can't do it because they can send us information but they can't receive information back. If our module needs an upgrade we should just be able to change and recompile ours and their next execution should get the changes.
    I am at a loss and would greatly appreciate any assistance on this matter.
    Thanks,
    Dennis Bartizal

    We have developed an MQSERIES utility that is a function that calls many related functions and its purpose is to perform a variety of MQSeries functions with minimal interaction required by the user. The user provides the message, an activity code (pd for puts, gd for gets, pr for putting requests for replies, etc.) and a couple other parameters. The user gets back the message, a return flag (good, bad, truncated, etc). . Our MQSERIES function is a function of the calling module. Our function has it's series of includes with classes, functions, etc. The calling program needs a couple includes (to define the passed data areas) and a function prototype of our function (void mqcmd090(typefilefdi &, typefilemsg &, typefilemdi &);) and after the user does string copies and so forth into the passed data areas they currently call the function (mqcmd090(currpassarea, currmessage, currquetable);) After our function is called these passed data areas are manipulated by the user's module. They inquire into the return code, they may do activity (with message ids, etc), they manipulate the message and may send it back (replies, etc). Our dilemma is this. The users want our module to be stand-alone. It should be compiled and linked by itself. Their module should be compiled and linked by itself. They don't mind having a couple includes for the common passed structures but our modules should not be a function in theirs.
    How can I compile our function (and how can they call it) so that we can keep the communications going both ways between modules? A system call can't do it because they can send us information but they can't receive information back. If our module needs an upgrade we should just be able to change and recompile ours and their next execution should get the changes.
    I am at a loss and would greatly appreciate any assistance on this matter.
    Thanks,
    Dennis Bartizal

  • Call event handler programatically

    Hi, I have a function that handles a change event from a
    combo box. The problem is that, I also want to call the function
    from within the program, but the function is waiting for a change
    event. Is it possible to call an event handler
    programatically?

    if you're not using the event that is passed to the event
    handler, then you can initialise the event to null, which means
    that Flash won't worry if no event is passed to the event handler,
    and you could either call this as a function or use it as an event
    handler eg:
    function comboChange(event:Event=null):void
    if you were using the event handler(which is probably the
    best idea to target the combo from event.currentTarget rather than
    directly in case you want to extend this handler in future), then
    it might be nicer to do this sort of thing:

  • Event handler documentation

    Is there any better documentation/samples on what event handlers do. I can't see anything that says what variables are passed to an event handler following an event. For example, if a doc close event occurs does the handler get passed username, password, document ID, IP address etc? Or does it just get passed an event ID that you then go and lookup in the APS database.
    This aspect of the SDK seems very poorly documented.
    Thanks in advance for any pointers.

    OK, found some info in the developer guide.

  • Event Handling problem

    Hello everyone.
    i am trying to handle events in the item master date form (150) in order to hide the Item Cost. It is working fine with most of the time using only the UI api. However if doing the following actions, the events are not processed by the application anymore.
    1- Start SBO (2005 sp1 pl18)
    2- Login
    3- Start my add-on with vb.net
    4- Go into the item master data.. (handling events correctly)
    5- Close item master data.
    6 -Go into another form
    7- Close the other form
    8- Go back into item master data --> no events handling is done
    Any ideas???
    Thank you
    Simon
    Source code.
    Public Class ItemCostControl
        Private WithEvents SBO_Application As SAPbouiCOM.Application
        ' Declare Event Filter
        Public oFilters As SAPbouiCOM.EventFilters
        Public oFilter As SAPbouiCOM.EventFilter
        Private Const itemCostField As String = "64"
        Private Const itemCostColumn As String = "22"
        Private Const itemCostGrid As String = "28"
        Private Const formItemMaster As String = "150"
        Private Sub SetApplication()
            '// Use an SboGuiApi object to establish the connection
            '// with the application and return an initialized appliction object
            Dim SboGuiApi As SAPbouiCOM.SboGuiApi
            Dim sConnectionString As String
            SboGuiApi = New SAPbouiCOM.SboGuiApi
            sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
            '// connect to a running SBO Application
            SboGuiApi.Connect(sConnectionString)
            '// get an initialized application object
            SBO_Application = SboGuiApi.GetApplication()
        End Sub
        Private Sub SetFilters()
            '// Create a new EventFilters object
            oFilters = New SAPbouiCOM.EventFilters
            oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE)
            oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED)
            oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_MENU_CLICK)
            '// assign the form type on which the event would be processed
            oFilter.AddEx("150")
            SBO_Application.SetFilter(oFilters)
        End Sub
        Public Sub New()
            '// set SBO_Application with an initialized application object
            SetApplication()
            '// set SBO_Application with an initialized EventFilters object
            SetFilters()
        End Sub
        Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
            Dim oForm As SAPbouiCOM.Form
            System.Diagnostics.Debug.WriteLine("Item Event for " + FormUID)
            If pVal.FormType <> 0 And pVal.BeforeAction = False Then
                Select Case pVal.EventType
                    Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
                        System.Diagnostics.Debug.WriteLine("Item Pressed")
                        hideField(pVal.FormType, pVal.FormTypeCount, itemCostField)
                        hideColumn(pVal.FormType, pVal.FormTypeCount, itemCostGrid)
                    Case SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE
                        System.Diagnostics.Debug.WriteLine("Form Activate")
                        hideField(pVal.FormType, pVal.FormTypeCount, itemCostField)
                        hideColumn(pVal.FormType, pVal.FormTypeCount, itemCostGrid)
                    Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD
                        System.Diagnostics.Debug.WriteLine("Form Load")
                        hideField(pVal.FormType, pVal.FormTypeCount, itemCostField)
                        hideColumn(pVal.FormType, pVal.FormTypeCount, itemCostGrid)
                End Select
            End If
        End Sub
        Private Sub SBO_Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent
            '// in order to activate your own forms instead of SAP Business One system forms
            '// process the menu event by your self
            '// change BubbleEvent to True so that SAP Business One won't process it
            Dim oForm As SAPbouiCOM.Form
            If pVal.BeforeAction = False Then
                hideField(formItemMaster, 1, itemCostField)
                hideColumn(formItemMaster, 1, itemCostGrid)
            End If
        End Sub
        Public Sub hideField(ByVal FormType As String, ByVal FormTypeCount As Integer, ByVal fieldNo As String)
            Dim oForm As SAPbouiCOM.Form
            oForm = SBO_Application.Forms.GetForm(FormType, FormTypeCount)
            oForm.Items.Item(fieldNo).Left = 3000
            oForm.Items.Item(fieldNo).Visible = False
        End Sub
        Public Sub hideColumn(ByVal FormType As String, ByVal FormTypeCount As Integer, ByVal fieldNo As String)
            Dim oForm As SAPbouiCOM.Form
            Dim oGrid As SAPbouiCOM.Matrix
            Dim oItem As SAPbouiCOM.Item
            oForm = SBO_Application.Forms.GetForm(FormType, FormTypeCount)
            oItem = oForm.Items.Item(fieldNo)
            oGrid = oItem.Specific
            If oGrid.Columns.Item(itemCostColumn).Visible = True Then
                oGrid.Columns.Item(itemCostColumn).Visible = False
                oGrid.Columns.Item(itemCostColumn).Width = 0
            End If
        End Sub
    End Class

    Hi, Simon!
    Try setting filters like that:
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE)
    '// assign the form type on which the event would be processed
    oFilter.AddEx("150")
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED)
    '// assign the form type on which the event would be processed
    oFilter.AddEx("150")
    oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_MENU_CLICK)
    '// assign the form type on which the event would be processed
    oFilter.AddEx("150")
    I suppose that the setting method you used, was filtering only et_MENU_CLICK for the 150-form. But other events (et_FORM_ACTIVATE, et_ITEM_PRESSED) were handling for all forms...
    hth,
    Aleksey

  • Calling the on(press) event handler

    Preface
    Typically when you set an event handler function for buttons by code, like:
    mybutton.onPress = function(){
             trace("Hello!");
    you can access and call this event handler function by:
    mybutton.onPress();
    and it will execute the function and trace "Hello!".
    Question
    But when you set event handlers on the button itself, like:
    on(press){
             trace("Hello!");
    is that event function accessible from code? how? I know there would be a property that you can access it by, maybe we can "decompile" an SWF to check out finally which property it stores the event code in, or would any of you have any idea?
    mybutton.onPress();   // This does not work!

    I don't know why, but I think it is like this. When you call the onPress() function, it will find a function called onPress, which is the onPress = function(). If you are just curious to know the answer, it is fine. If you really want to solve the problem, make a function ( for example pressed), and use mybutton.pressed(). And at the on(press) code, simply add pressed();

  • How to load external swf and handle events of external swf by passing data .

    Hi all
    I have to laoad external swf (made in flash).On loading i have to pass data and hndle events which occurs on this swf.
    Can any one suggest me how can I achieve this.
    Regards
    Munira

    Here is one way:
    http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f9c.html
    HTH,

  • TCP Callback function passing data to teststand

    Hi,
    I'm trying to pass data via a TCP Callback function to teststand using the TCP steptype that I downloaded from Ni.
    When I open a connection, container data is passed to the dll on which it creates a connection, the dll in part creates a TCP Callback function.
    The handle obtained from the connection is then passed back through the container data, and the dll returns back to the sequence editor which will execute the next steps.
    The problem is that when the TCP Callback function gets an TCP_READY event it can not pass data to TestStand because it can not access the container data.
    How can this TCP Callback function pass/alter data to/in Testand?
    Thank you...

    Yes ThiCop,
    That's exactly what I want to establish!
    Here is the example code:
    //Function needed by the TCP functions
    int CVICALLBACK MsgHandler (unsigned handle, int event, int error, void *callbackData)
        char receiveBuf[256] = {0};
        char displayBuf[7] = {0};
        char * tempLookup;
        int  dataSize = sizeof (receiveBuf) - 1;
       switch (event)
          case TCP_CONNECT:
             break;
          case TCP_DISCONNECT:
             break;
          case TCP_DATAREADY:
             if ((dataSize = ClientTCPRead (handle, receiveBuf, dataSize, 1000)) > 0)
                   //  Send data from receiveBuf to a variable in teststand ????
                   //  TS_PropertyGetValString (HandleObject, NULL, "Step.Result.Data", 0, &tempLookup);
                   //  TS_PropertySetValString (HandleObject, NULL, tempLookup, 0, receiveBuf);
             else
                   receiveBuf[dataSize] = '\0';
            break;  
     return 0;
    void __declspec(dllexport) TX_TEST TCPConnectF(tTestData * testData, tTestError * testError)
        int                 error = 0;
        int                 TCPerror;
        double           Port;
        double           Timeout;
        char              *HandleLookup;
        char              *ServerAdd;
        char              *CallbackData;
        ErrMsg           errMsg = {'\0'};
        ERRORINFO   errorInfo;
        tsErrChk (TS_PropertyGetValString (testData->seqContextCVI, &errorInfo, "Step.Result.Handle", 0, &HandleLookup));
        tsErrChk (TS_PropertyGetValNumber (testData->seqContextCVI, &errorInfo, "Step.Result.Port", 0, &Port));
        tsErrChk (TS_PropertyGetValString (testData->seqContextCVI, &errorInfo, "Step.Result.IP", 0, &ServerAdd));
        tsErrChk (TS_PropertyGetValNumber (testData->seqContextCVI, &errorInfo, "Step.Result.Timeout", 0, &Timeout));
        tsErrChk (TS_PropertyGetValString (testData->seqContextCVI, &errorInfo, "Step.Result.Data", 0, &CallbackData));
        TCPerror = ConnectToTCPServer (((unsigned int *) &ConnectionHandle), ((unsigned int) Port), ServerAdd, MsgHandler, 0, Timeout);
        if (TCPerror != 0)
         //Get TCP Error Message
           sprintf(errMsg,"%s",GetTCPErrorString ( TCPerror ));
           error = TCPerror;
           goto Error;
        tsErrChk (TS_PropertySetValNumber (testData->seqContextCVI, &errorInfo, HandleLookup, 0, ((double) ConnectionHandle)));
    Error: 
        // FREE RESOURCES
        CA_FreeMemory(HandleLookup);
        CA_FreeMemory(ServerAdd);
        // If an error occurred, set the error flag to cause a run-time error in TestStand.
        if (error < 0)
            testError->errorFlag = TRUE;
            testError->errorCode = error;
            testData->replaceStringFuncPtr(&testError->errorMessage, errMsg);
        return;   

  • Passing parameters to an event handler

    I am successfully using event handlers to respond to user
    inputs(mouse click, enter key, etc.)
    The handler can also use the event objects parameters to
    perform operations based on who called the function. An example of
    this is the target._name, which is apparently passed when the event
    occurs.
    In addition, I have a need to call an event handler from
    within AS to essentially mimic a mouse click or keyboard entry.
    This call from AS is no problem. Just use the event handler
    name. For instance, mc.click(); and the handler is invoked.
    However, with the AS call there is no object passed to the
    handler. This differs from an event-driven call where an object
    identifying the event source is passed to the handler.
    The question is: Can you pass a parameter(s) or object to an
    event handler from a call in ActionScript? I have tried various
    ways, but nothing has worked.
    Does anyone know the insides of event handling and how the
    "eventObject" is passed when
    a user event occurs? Knowing how that works might give some
    clues as to how to pass an object from an AS call.

    You would need to use a modified version of the
    mx.utils.Delegate package. The link below has just that;
    http://www.person13.com/articles/proxy/Proxy.htm

Maybe you are looking for

  • How can i use safari without it crashing on me everytime i open it?

    when i open the safari browser it only stays up for a few minutes until a window pops up and says "safari has stopped working" and "windows is checking for a solution to the problem" and then the browser completely closes. this happens everytime i op

  • Identify Entities for Logical Data Model

    Hi, I donno exactly this is the correct forum for this question. I believe there are database experts here to help me on this. I am in confusion that, phsically the data can be saved in a set of tables (4-5 tables). But different views (User Interfac

  • Make dynamic mc draggable

    Hi All, I have some code to drag and drop a movieclip. The code works ok if it is inside the movieclip and in my old flash photo gallery the clips were put in manually and the photos added by xml. onClipEvent (mouseDown) { if (this.hitTest(_root._xmo

  • My safari is freezing unexpectedly.

    I have checked that I do not have third party add ons and my extensions are fine. This issue has only been occurring for the last couple of weeks. I get the spining pinball wheel and I have to quit and restart for it to work. Any ideas?

  • Cannot cancel Incoming Payment. One of the credit vouchers were cashed.

    Dear Experts, While canceling an incoming payment, I hit the below error message: "Cannot cancel. One of the credit vouchers were cashed." Please note that the deposits for this payment is cancelled. Please help advice! Warmest Regards, Chinho