A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: event handler

  1. #1
    Hi all,

    I am defining some functions in the first frame which should be executed on some button actions or changehandler. But the problem is that whenever my movie is coming to the first frame the function is getting executed. How to stop that and how to make it executable only when the button is pressed.

    Thanks in advance...

  2. #2
    Senior Member
    Join Date
    May 2002
    Posts
    248
    The function shouldn't get executed on the first frame unless you're calling the function in the first frame also. Regardelss, you should try to avoid playing the frame which constructs the function more than once. It's making the flash player recreate the function every time, and that's probably not neccessary. Can you loop to frame 2 instead of frame 1?

    -Dan

  3. #3
    Hi,

    I am defining the function in this way :

    function mlchangefont() {
    _root.myTextFormatml1 = new TextFormat();
    _root.myTextFormatml1.font = _root.main.formatmc.mlformat.mlfontlist.GetValue() ;
    _root.main.link1.inlink1.ml1.setTextFormat(_root.m yTextFormatml1);
    }


    mlchangefont is my changehandler for combo box. But before changing thru the combo box, whenever my movie is coming to the first frame the first font of the list is getting changed.

    Hope you understood the problem...

  4. #4
    Senior Member
    Join Date
    May 2002
    Posts
    248
    Is there other code in frame 1 that changes the contents of the combo box? if so, that would trigger the mlchangefont function.

    -Dan

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