help in setTimeout function

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default help in setTimeout function

    I want to pass the argument in the function called in setTimeout function.
    Below is the code snippet.

    public function histogramDataPointClick(dataPointObj:Event):void
    {
    var duration:Number = 5000;
    setTimeout(executeEvent(dataPointObj),duration);
    }
    public function executeEvent(dataPointObj:Event ):void
    {
    var index:int;
    var message:String;
    message="";
    selectedDataPoint1=dataPointObject.currentTarget.s eries;

    for(var i:int = 0; i<
    selectedDataPoint1[0].selectedIndices.length; i++)
    {
    index=selectedDataPoint1[0].selectedIndices[i];
    message = message+"
    "+protocolTrendData[index].valueOf().trialPhase;

    }


    Alert.show("Selected Trial Phase"+message);



    dispatchEvent(new Event("histogramDataPointClick"));
    }
    If I am trying to do that then I am facing error 1067:Implicit coercion of a
    value of type void to an unrelated type Function.


    error 1067

    can anybody help me in that?

    Thanks





    smonika15 Guest

  2. Similar Questions and Discussions

    1. setTimeOut
      How do I use setTimeOut to open one html file, keep it open for 15 seconds, close it and then open a second html page? All your help is...
    2. note 33714 added to function.register-tick-function
      please can anyone help me to discover if this function can be used to make a chat ---- Manual Page --...
    3. Reduce SetTimeout value on dhtml popup menus
      See the technote, "How to set the length of time a Pop-up Menu remains visible" at...
    4. Reducing the setTimeout value of dhtml popup menus
      Does anyone here know how/where to reduce the SetTimeout value in the fireworks-generated javascript code (client-side or server-side) for dhtml...
    5. note 33132 deleted from function.register-shutdown-function by sniper
      Note Submitter: markus@malkusch.de ---- I can't agree with nick at nickjoyce dot com. I use php 4.2.3 on linux and my shutdown function is...
  3. #2

    Default help in setTimeout function

    I want to pass the argument in the function called in setTimeout function.
    Below is the code snippet.

    public function histogramDataPointClick(dataPointObj:Event):void
    {
    var duration:Number = 5000;
    setTimeout(executeEvent(dataPointObj),duration);
    }
    public function executeEvent(dataPointObj:Event ):void
    {
    var index:int;
    var message:String;
    message="";
    selectedDataPoint1=dataPointObject.currentTarget.s eries;

    for(var i:int = 0; i<
    selectedDataPoint1[0].selectedIndices.length; i++)
    {
    index=selectedDataPoint1[0].selectedIndices[i];
    message = message+"
    "+protocolTrendData[index].valueOf().trialPhase;

    }


    Alert.show("Selected Trial Phase"+message);



    dispatchEvent(new Event("histogramDataPointClick"));
    }
    If I am trying to do that then I am facing error 1067:Implicit coercion of a
    value of type void to an unrelated type Function.


    error 1067

    can anybody help me in that?

    Thanks





    smonika15 Guest

  4. #3

    Default Re: help in setTimeout function

    try:

    setTimeout(executeEvent, duration, dataPointObject);

    setTimeout () function

    public function setTimeout(closure:Function, delay:Number, ... arguments):uint

    Runs a specified function after a specified delay (in milliseconds).

    Instead of using this method, consider creating a Timer object, with the
    specified interval, using 1 as the repeatCount parameter (which sets the timer
    to run only once).

    If you intend to use the clearTimeout() method to cancel the setTimeout()
    call, be sure to assign the setTimeout() call to a variable (which the
    clearTimeout() method will later reference)


    Parameters closure:Function ? The name of the function to execute. Do not
    include quotation marks or parentheses, and do not specify parameters of the
    function to call. For example, use functionName, not functionName() or
    functionName(param).

    delay:Number ? The delay, in milliseconds, until the function is executed.

    ... arguments ? An optional list of arguments that are passed to the closure
    function.



    atta707 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139