dcsimg
A Flash Developer Resource Site

Page 3 of 3 FirstFirst 123
Results 41 to 58 of 58

Thread: ARGH!...help on multiple arguments for asfunction...

  1. #41
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You misunderstood the word "imported". I have attached a sample.
    Attached Files Attached Files
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  2. #42
    Member
    Join Date
    Jun 2004
    Posts
    94

    Not sure...

    what are you showing in the example?...I'm missing the point, sorry...

    A bit more on embedded text...seems as if you have a monospaced font in a static textbox...spaced out correctly...select a portion of text and place a URL in the link box...all spacing goes away!...how wonderful is that?!?

    So, it looks as if an invisable button is the only way to go...

  3. #43
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    The only thing I show in the example is how to use the invisible button, so it stays with the text, since that was your problem. i don't care about the font, alias status or whatever in this example.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  4. #44
    Member
    Join Date
    Jun 2004
    Posts
    94

    Ah!

    Now I understand...ok...

    Thanks!

  5. #45
    Member
    Join Date
    Jun 2004
    Posts
    94

    How to translate the asfunction...

    when it was dynamic text, I was able to call the function myTest using the asfunction...re: <a href="asfunction:myTest,trtjb.jpg,90,187,1">

    How can I translate this to be used on a button?

    myBut.onRelease = ???

    Thanks and more thanks...

  6. #46
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    PHP Code:
    but.onPress = function ()
    {
        
    myTest ("testmovie.swf"1002001);
    };
    function 
    myTest (myMovie:Stringpos_x:Numberpos_y:NumbermyLevel:Number)
    {
        
    _root.createEmptyMovieClip ("a"myLevel);
        
    _root.a._x pos_x;
        
    _root.a._y pos_y;
        var 
    mc:MovieClip _root.a.createEmptyMovieClip ("mc"1);
        
    mc._lockroot true;
        
    mc._alpha 0;
        
    mc.loadMovie (myMovie);
        
    // 
        
    _root.onEnterFrame = function ()
        {
            var 
    speed:Number 2;
            if (
    mc._alpha 100)
            {
                
    mc._alpha += speed;
            }
            else
            {
                
    delete this.onEnterFrame;
            }
        };

    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  7. #47
    Member
    Join Date
    Jun 2004
    Posts
    94

    As always...

    very cool...thanks, thanks, thanks!

  8. #48
    Member
    Join Date
    Jun 2004
    Posts
    94

    Just can't get it to work...

    I have this code on the first frame of the main movie...

    clip.createEmptyMovieClip ("clip1", 1);
    clip.clip1.loadMovie ("moogie.swf");
    function myTest (myMovie:String, pos_x:Number, pos_y:Number, myLevel:Number)
    {
    _root.createEmptyMovieClip ("a", myLevel);
    _root.a._x = pos_x;
    _root.a._y = pos_y;
    var mc:MovieClip = _root.a.createEmptyMovieClip ("mc", 1);
    mc._lockroot = true;
    mc._alpha = 0;
    mc.loadMovie (myMovie);
    //
    _root.onEnterFrame = function ()
    {
    var speed:Number = 2;
    if (mc._alpha < 100)
    {
    mc._alpha += speed;
    }
    else
    {
    delete this.onEnterFrame;
    }
    };
    }

    moogie.swf gets loaded...I have this code on the first frame of moogie.swf, along with the button called Mybut...the button is seen. but nothing happens when pressed

    Mybut.onRelease = function ()
    {
    myTest ("openpic.swf", 40, 60, 1);
    };

    I'm pretty sure I'm making a mistake as to where the code goes...
    Last edited by Motty99; 07-02-2006 at 05:06 PM.

  9. #49
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    check _lockroot in the help files.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  10. #50
    Member
    Join Date
    Jun 2004
    Posts
    94

    Ah...cryptic!

    Ok...from what I read, I would have to tell the loaded SWF to access the main movie's timeline, and not it's own...makes sense...so I tried this...

    mc._lockroot = true

    in the loaded SWF's timeline...still didn't work...

  11. #51
    Member
    Join Date
    Jun 2004
    Posts
    94

    Scratch that...reverse it...

    I think I'm backwards in my expanation...

    From what I've been reading, I need to place this into the loaded SWF...

    this._lockroot = true;

    Sound right?...I can't test until I hit home later...

  12. #52
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Either that or clip.clip1._lockroot = true;
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  13. #53
    Member
    Join Date
    Jun 2004
    Posts
    94

    Nope...

    this._lockroot = true; or clip.clip1._lockroot = true; do not work...

    again this goes into the SWF with the button?...I have this in that movie...

    clip.clip1._lockroot = true;

    myBut.onRelease = function ()
    {
    myTest ("openpic.swf", 40, 60, 1);
    };

    with the button named myBut...

    and the code in the first frame of the movie that does the importing...

    _root.a.removeMovieClip ();
    clip.clip1.removeMovieClip ();
    //
    stop ();
    clip.createEmptyMovieClip ("clip1", 1);
    clip.clip1.loadMovie ("moogie.swf");
    //
    function myTest (myMovie:String, pos_x:Number, pos_y:Number, myLevel:Number)
    {
    _root.createEmptyMovieClip ("a", myLevel);
    _root.a._x = pos_x;
    _root.a._y = pos_y;
    var mc:MovieClip = _root.a.createEmptyMovieClip ("mc", 1);
    mc._lockroot = true;
    mc._alpha = 0;
    mc.loadMovie (myMovie);
    //
    _root.onEnterFrame = function ()
    {
    var speed:Number = 2;
    if (mc._alpha < 100)
    {
    mc._alpha += speed;
    }
    else
    {
    delete this.onEnterFrame;
    }
    };
    }

    Any ideas?...

  14. #54
    Member
    Join Date
    Jun 2004
    Posts
    94

    Unhappy Just spinning...

    I post the files in hope that you can sort this out...
    Attached Files Attached Files

  15. #55
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You had a lot of mistakes in moogie.fla. Here is the script.

    myBut.onRelease = function ()
    {
    _level0.myTest ("bl.jpg", 40, 60, 1);
    };
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  16. #56
    Member
    Join Date
    Jun 2004
    Posts
    94

    Now I'm confused...but happy!

    no _lockroot?...

  17. #57
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    No if your movie looks like this. If you have other things with _root in that movie add
    this._lockroot = true;
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  18. #58
    Member
    Join Date
    Jun 2004
    Posts
    94

    But I do...?

    I do have a _root call in the myTest function...when I was testing this morning (at work now), I was unable to get my mask to work with this (the blue rectangle is masked so the gradent used in the myTest call from moogie.swf (using a test.swf instead of bl.jpg)...if this makes sense...

    I did not have time to test a lot, but just wondering if the way the code is written will support a mask to myTest?


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