A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How to pass 2 values with asfunction

  1. #1
    Senior Member
    Join Date
    Oct 2004
    Location
    Biograd, Croatia
    Posts
    179

    How to pass 2 values with asfunction

    I have a textfield into which i wanna load some text and a movie clip into which I wanna load a new jpg file!

    I can`t seem to get them both to work at the same time! Anybody tried this before!

  2. #2
    ___________________
    Join Date
    May 2004
    Posts
    3,174
    code:
    asfn = function (str) {
    a = str.toString().split("_");
    prf(a[0], a[1]);
    function prf(x, y) {
    _level0.tf.text = x;
    _level0.createEmptyMovieClip("mc", 1).loadMovie(y);
    }
    };
    this.createTextField("tf", 0, 0, 0, 200, 20);
    this.tf.html = true;
    this.tf.htmlText = "<a href=\"asfunction:asfn, sometext_somejpg.jpg\">2 params passed with asfunction</a>";


  3. #3
    Senior Member
    Join Date
    Oct 2004
    Location
    Biograd, Croatia
    Posts
    179
    I managed to do it myself by passing 2 parameters with asfunction and only one parameter in the custom function! Very weird!

    I was thinking about doing it the way you describrd but surprisingly the solution I described worked! Thanx, anyways!

    EDIT:Seems not after all!

    I guess I`ll use your approach!
    Last edited by toltec7; 01-12-2005 at 07:29 AM.

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Check Passing multiple function parameters at the bottom of this page...

    http://www.macromedia.com/support/fl...asfunction.htm

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