A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] Can Objects/MovieClips hold functions?

  1. #1
    Senior Member Ex-Ess's Avatar
    Join Date
    Nov 2002
    Location
    York (England)
    Posts
    588

    resolved [RESOLVED] Can Objects/MovieClips hold functions?

    Hello all!
    I have the following code:
    Code:
    var dwm:mc_dwm = new mc_dwm();
    dwm.mapName = myMap2;
    dwm.xtile = 5;
    dwm.ytile = 1;
    dwm.wdth = 18;
    dwm.hght = 17;
    dwm.startFrame = "guitar";
    dwm.fnct = function():void{trace("here")};
    mc_dwm() is a movie clip in my library which is added to the stage using the addChild method.

    Is there a way to call the dwm.fnct function?

    Thanks

  2. #2
    Senior Member Ex-Ess's Avatar
    Join Date
    Nov 2002
    Location
    York (England)
    Posts
    588
    Just in case anyone else is trying to do this I figured out that you can use:

    Code:
    function myObject(){}
    var obj:Object = new myObject();
    dwm.fnct.call(obj);

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center