A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 31

Thread: New Methods

  1. #1
    Deathbringer sylkro's Avatar
    Join Date
    Oct 2000
    Location
    London
    Posts
    202

    Post

    Hey all...

    Nothing to do with Flash MX but there's a MASSIVE website which provides a whole set of actionscript snippets which you can cut and paste into your FLA's which are absolutely awsome. The code works in F5 and hopefully MM will have taken some of the most useful ones and built them into MX. Given that AS should retain the same format (save as F5?) then the code will be valid in MX.

    the url is :

    www.layer51.com/proto

    i know this sounds like site promo, and let me reassure you it is... (it's not mine though...) but it's just so f%#$@@# usefull y'all should know about it if you don't already.

  2. #2
    World Kit Vote Holder Abelius's Avatar
    Join Date
    Feb 2002
    Location
    US
    Posts
    963
    yeah, it's awesome. I bookmarked it last night. Gotta go through it, probably throughout the weekend... (specially if it keeps on raining like today in Miami, hehehe...)

  3. #3
    Deathbringer sylkro's Avatar
    Join Date
    Oct 2000
    Location
    London
    Posts
    202
    yeah yeah Miami... we're stuck in london.
    ...
    at least it's not raining... ha!

  4. #4
    World Kit Vote Holder Abelius's Avatar
    Join Date
    Feb 2002
    Location
    US
    Posts
    963
    Lucky you!

    BTW, I spent good part of 1999 in Southampton...

  5. #5
    Senior Member
    Join Date
    Oct 2000
    Posts
    310
    Originally posted by sylkro
    Hey all...

    The code works in F5 and hopefully MM will have taken some of the most useful ones and built them into MX. Given that AS should retain the same format (save as F5?) then the code will be valid in MX.
    any ones in particular that you would like added?

    mike chambers

    mesh@macromedia.com

  6. #6
    Information Architect Subway's Avatar
    Join Date
    Feb 2000
    Location
    Switzerland
    Posts
    4,779
    Originally posted by MikeChambers
    Originally posted by sylkro
    Hey all...

    The code works in F5 and hopefully MM will have taken some of the most useful ones and built them into MX. Given that AS should retain the same format (save as F5?) then the code will be valid in MX.
    any ones in particular that you would like added?

    mike chambers

    mesh@macromedia.com
    I would like an 2 or more dimensional array

    Fredi

  7. #7
    Information Architect Subway's Avatar
    Join Date
    Feb 2000
    Location
    Switzerland
    Posts
    4,779
    An other one (I've sent it to Mike)

    ____________

    Hi Mike,

    I have one question about the HTML-textfield functionality.

    Is it possible in Flash MX to use the href tag in HTML-textfields to
    execute AS functions? I ask you this cause I'm concepting a big message
    board with Flash (MX) and it would make the experience of it perfect if I
    could run functions from a flash-textfiel href link.

    I'm absolutly sure this extra functionality would make so much more
    possible with a good usability.

    Cheers, Fredi Bach (aka Subway)
    ____________

  8. #8
    Senior Member
    Join Date
    Oct 2000
    Posts
    310
    Originally posted by Subway
    [

    I would like an 2 or more dimensional array

    Fredi [/B]
    i am not sure what you mean, you can do that in flash 5.

    mike chambers

    mesh@macromedia.com

  9. #9
    Senior Member
    Join Date
    Oct 2000
    Posts
    310
    Originally posted by Subway
    An other one (I've sent it to Mike)

    ____________

    Hi Mike,

    I have one question about the HTML-textfield functionality.

    Is it possible in Flash MX to use the href tag in HTML-textfields to
    execute AS functions? I ask you this cause I'm concepting a big message
    board with Flash (MX) and it would make the experience of it perfect if I
    could run functions from a flash-textfiel href link.

    I'm absolutly sure this extra functionality would make so much more
    possible with a good usability.

    Cheers, Fredi Bach (aka Subway)
    ____________

    i believe that this is possible in flash 5, but was an undocumented feature and a litte buggy.

    i would do a search on the flashcoders archines at:

    http://chattyfig.figleaf.com

    mike chambers

    mesh@macromedia.com

  10. #10
    Information Architect Subway's Avatar
    Join Date
    Feb 2000
    Location
    Switzerland
    Posts
    4,779
    Thx Mike,

    2D Arrays ... I know you can do it, but it's not very practical. Something like that would be perfect --> myarray[xpos][ypos][zpos] = true;

    Fredi

  11. #11
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    Is that not a 3d array? And you can do that in F5 can you not?

  12. #12
    Deathbringer sylkro's Avatar
    Join Date
    Oct 2000
    Location
    London
    Posts
    202
    Hi mike,

    Emm.... yeah loads... like:

    Movieclip.pointAt(x, y);
    Movieclip.pointAt(_root.myMC);

    takes an x, y coordinate or Movieclip and points at it...

    ...

    String.multiSplit("x", "y");

    splits a string according to the first parameter, then the splits all the results according to the second.

    ...

    String.noCache();

    Adds a "?noCache=<date><time>" to text files so as to reload them fresh every time, or no cache-ing...

    ...

    and tons tons more...


    i've uploaded a text file, and i've commented the ones i personally find usefull. the code's not in the file, so you'll just need to reference it back to the website if you approve it.

    www.fadetoblue.com/Comments.txt

    there aren't any XML ones because i've never had to use the Object. so by all means, if people check the site for ones they want and you guys at macromedia can find the time to go through the code and add these in it would be great.

    would these be present in MX or is it too late to recall?

    Thanks,

    (ps... i'm no way the author of those mentioned above..)
    [Edited by sylkro on 03-07-2002 at 09:33 AM]

  13. #13
    Senior Front End Developper
    Join Date
    Dec 2000
    Location
    Montréal
    Posts
    568
    If shipment is due in 8 days, it's probably gone gold, so too late... but even so, I don't think they would just add features that late into prod...

  14. #14
    Deathbringer sylkro's Avatar
    Join Date
    Oct 2000
    Location
    London
    Posts
    202
    a small downloadable patch couldn't hurt!

    but could you please please include a new _class property so instead of:

    foo = typeof(thing); // returns "object"

    have:

    foo = thing._class; // returns "movieclip" or "array" etc..

    Also, is there any way in MX2 we could have an dialog box which would allow us to add keywords that the AS Editor could highlight? so if we do:

    Array.prototype.newMethod = function {
    //
    }

    we could ask it to highlight in blue ".newMethod"?

    that would be great Mr Chambers! thanks!

    --------

    ps: for those interested in the class thing, here's how you do it (just paste this in frame 1 and it's available accross all timelines):

    Array.prototype._class = "Array";
    Movieclip.prototype._class = "Movieclip";

    etc .. for all other objects. Since the Math, Mouse, Selection objects don't require a constructor, they don't really need a _class property.
    [Edited by sylkro on 03-07-2002 at 11:23 AM]

  15. #15
    Information Architect Subway's Avatar
    Join Date
    Feb 2000
    Location
    Switzerland
    Posts
    4,779
    It's only for download in 8 days, so it is maybe posible to add little extras.

  16. #16
    Senior Member
    Join Date
    Oct 2000
    Posts
    310
    Originally posted by sylkro
    aAlso, is there any way in MX2 we could have an dialog box which would allow us to add keywords that the AS Editor could highlight? so if we do:

    Array.prototype.newMethod = function {
    //
    }

    we could ask it to highlight in blue ".newMethod"?
    you can do this in MX.

    mike chambers

    mesh@macromedia.com

  17. #17
    Deathbringer sylkro's Avatar
    Join Date
    Oct 2000
    Location
    London
    Posts
    202
    excellent! thanks, and for the new methods... do you think it would be possible to add some before the release?

  18. #18
    Senior Member
    Join Date
    Oct 2000
    Posts
    310
    Originally posted by sylkro
    excellent! thanks, and for the new methods... do you think it would be possible to add some before the release?
    no, it is too late to add new methods at this point, however :

    1. i wanted to see if there were methods that people wanted and were added

    2. it is much easier to include your own methods now. there is a central directory / folder for include files, and you can add your own methods to the ActionScript window (including code completion and color coding).

    btw, these are all great suggestions. if you have time, please submit them to:

    http://www.macromedia.com/support/email/wishform/

    we read all submission and it helps us determine what features to put into future versions of flash.

    mike chambers

    mesh@macromedia.com

  19. #19
    Information Architect Subway's Avatar
    Join Date
    Feb 2000
    Location
    Switzerland
    Posts
    4,779
    Originally posted by MikeChambers
    and you can add your own methods to the ActionScript window (including code completion and color coding).

    Thx a lot MM! That's great! Really, really great!

    Fredi

  20. #20
    Deathbringer sylkro's Avatar
    Join Date
    Oct 2000
    Location
    London
    Posts
    202
    thanks Mike, well, i don't think we'll be needing that form for the moment since i'm happy already!

    also is there a way to turn off the alert which says there probably an infinite loop? i got the message while loading huge textfiles and after hours of code debugging, i tried the "proceed" function and it worked fine... (i then split the text file and got some enhanced string methods)


    next question:
    this is the code i have (kudos R. Penner):

    Mouse.isDown = function (num) {
    var num
    return asNative(800,2)(num);
    }

    ----

    we can use it like this because it couples a few event handlers without messy variables:

    onClipEvent(mouseMove) {
    if (Mouse.isDown(1)) {
    trace("dragging left mouse button");
    }
    }

    or:

    onClipEvent(mouseDown) {
    if (Mouse.isDown(1)) {
    trace("left press");
    } else if (Mouse.isDown(2) {
    trace("right press");
    } else if (Mouse.isDown(3) {
    trace("middle-mouse press");
    }
    }

    I think you can anticipate the question... will there be a documentation on the asNative functions?

    Pleeeeeese?

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