Note that there are some explanatory texts on larger screens.

plurals
  1. POFunction's parameter variable as object
    primarykey
    data
    text
    <p>Is there a way / I would like to know how to use a variable dynamically. My idea is to have a movieclip calling a function at the same time passing a parameter. The parameter value will then be pass to the function for more script.</p> <p><strong>How to make use of the function's parameter variable, use its value to execute as instanceName.method with in the function?</strong></p> <p>Sample Code, I have two movieclip with instance names, box1 and box2. once, any of the movieclip is press, the function will execute.</p> <pre><code>// movieClip, instance name : box1 on(press){ _root.functionName(this._name); } on(release){ stopDrag(); } </code></pre> <ul> <li>movieClip, instance name : box2, has the same code.</li> <li>there identity is being passed to the function through "this._name"</li> </ul> <p>Finally, here is the code for the function. I trace "b" in order to know its value. Added startDrag() to be able to drag the movieclip. "How can I able to trace "--drag "+b while dragging the movieclip?"</p> <p>Thank you in advance. I have thought of using this code. Is this allowed?</p> <pre><code>function functionName(b){ trace(b+" selected."); startDrag(b); b.onMouseMove = function(){ // &lt;---- please help trace("--drag "+b); } } </code></pre> <p>The code may look simple and useless :) This is not really the code I am working with. I am just trying to get the proper line to execute onmousemove inside a function.</p> <pre><code>function functionName(param_var){ object.eventMethod = function () { // some code here. } } </code></pre> <p><strong>CAN I MAKE USE OF THE PARAMETER VARIABLE AS OBJECT?</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload