A Flash Developer Resource Site

Search:

Type: Posts; User: wombatLove

Page 1 of 12 1 2 3 4

Search: Search took 0.20 seconds.

  1. Replies
    2
    Views
    393

    In this example you'll find a move clip in the...

    In this example you'll find a move clip in the library which contains the shape and code for movement on the first frame. This should hopefully get you started.
  2. Replies
    3
    Views
    547

    The long version. // Threshold will be the...

    The long version.
    // Threshold will be the cutoff between what is considered slow and fast
    var Threshold:Number = 0.2; // Measued in "stage units" per second

    // Record mouse position and...
  3. Replies
    3
    Views
    547

    This example uses two text boxes on screen named...

    This example uses two text boxes on screen named speedometerDisp and thresholdDisp to show the output.

    // Threshold will be the cutoff between what is considered slow and fast
    var...
  4. Replies
    12
    Views
    653

    OK, since dude threw in the comment about timing...

    OK, since dude threw in the comment about timing I thought I'd chip in my two cents.

    From past experience with other programming languages, it stands to reason that indexed lookups should be the...
  5. Replies
    3
    Views
    629

    OK, same concept, but these lines just make me...

    OK, same concept, but these lines just make me cringe!
    // use getDay() to see if it's 5 (friday). If not, add on to the
    // date (e.g. May 15 becomes May 16).
    while (fri.getDay() != 5) {...
  6. function top3():Number { var a:Array = new...

    function top3():Number {
    var a:Array = new Array();
    var sum:Number = 0;
    var i:Number;

    // Get four random numbers between 1 and 6 and shove them in an array
    for( i = 0; i < 4; i++ ) { a[...
  7. Replies
    6
    Views
    644

    If you're just looking to remove a character from...

    If you're just looking to remove a character from a string, you can use split and join like so
    var s:String = '1,2,3,4,5,6,';
    s = s.split(',').join(''); // removes commas from s
    trace( s );or as...
  8. Replies
    5
    Views
    521

    Try this... probably more than you need, but can...

    Try this... probably more than you need, but can break any string at any number of spaces using any seperator you choose. Commented so you can see what's going on.
    function splitter(...
  9. Replies
    2
    Views
    666

    If you're using HTML, you can use the HTML code...

    If you're using HTML, you can use the HTML code of "& #247;", else you have to create the character. The example below assumes you have two text boxes, one called test, the other test2. The...
  10. Replies
    2
    Views
    350

    When you tell Flash var1 = var2 you're actually...

    When you tell Flash var1 = var2 you're actually copying a reference of the array and not the actual values, so technically var1 points to the same memory as var2. Use the concat operator to copy the...
  11. Mad, It's OK... I figured as much, but wanted to...

    Mad, It's OK... I figured as much, but wanted to throw my two cents in. Thought it might be something to look in to after you get further in to your project. I've been down the same road many times...
  12. I know this is really after-the-fact, but I...

    I know this is really after-the-fact, but I haven't been on the boards in a long while. Have you considered using an array of objects? Same principle and a multi-dimensional array, but allows you...
  13. Replies
    3
    Views
    417

    You must first tell flash that you want it to be...

    You must first tell flash that you want it to be an array, then you should have no problems.
    _global.testArray = new Array();

    for( var i = 0; i < 5; i++ ) {
    _global.testArray[i] = "test" + i;...
  14. Thread: Bug?

    by wombatLove
    Replies
    2
    Views
    470

    When you precede a number with 0 in flash it is...

    When you precede a number with 0 in flash it is treated as an octal (that's base 8). Therefore, 01, 02, 03... will all work, but 08 and 09 won't since you can only have 0-7 in octal. Try this
    var...
  15. Replies
    3
    Views
    406

    Wow, a 3-minute bump and an hour bump. Easy way...

    Wow, a 3-minute bump and an hour bump. Easy way to get up the post counter, though, huh? :)

    Seriously, though... personally I'd use classes to create Inventory objects that can be moved from the...
  16. Replies
    11
    Views
    537

    True... textFormats are not for animating text...

    True... textFormats are not for animating text but for setting font attributes (so you'd even be capped at 144em). The examples above are for setting the text and forgetting about it, not for...
  17. Replies
    11
    Views
    537

    You can actually pull something like this off...

    You can actually pull something like this off
    this.createEmptyMovieClip("myText_mc", 0);
    myText_mc.createTextField("word_txt",0,20,100,100,100);
    myText_mc.word_txt.text = " Hi Britni";
    ...
  18. Replies
    11
    Views
    537

    In actuality, the difference between madzigian's...

    In actuality, the difference between madzigian's last bit of code and what I posted depends on if you plan on changing the font size while it's animating or not. There are subtle differences between...
  19. Replies
    4
    Views
    418

    Check out the attached FLA (in MX2004 format). ...

    Check out the attached FLA (in MX2004 format). The important part is the calcDist function. The rest is used to track mouse clicks and update the points. Adjust the milesPerPixel and ourSpeed...
  20. Replies
    11
    Views
    537

    this.createEmptyMovieClip("myText_mc", 0);...

    this.createEmptyMovieClip("myText_mc", 0);
    myText_mc.createTextField("word_txt",0,20,100,100,100);
    myText_mc.word_txt.autoSize = true;

    myTF = new TextFormat();
    myTF.size = 72;
    ...
  21. Replies
    2
    Views
    477

    Check out my post from 11/30/2005... should get...

    Check out my post from 11/30/2005... should get your endings for you. Old Post
  22. Replies
    3
    Views
    336

    Most likely the code was originally written...

    Most likely the code was originally written before import became a reserved word. It is an easy fix, but I'm sure you'll catch it... I mean you wrote a Flash file which deals with gravity and wind...
  23. Replies
    10
    Views
    433

    Well, no wonder why your code isn't choppy......

    Well, no wonder why your code isn't choppy... putting a single loop in an onEnterFrame would take forever to run. If you wanted to pre-initalize an array of say 60 elements in a movie running at...
  24. See notes in red onClipEvent(load) {...

    See notes in red
    onClipEvent(load) {
    deltaY=10;
    }
    onClipEvent(enterFrame) {

    // Try adding traces here
    trace( "Enemy: " + this._y + " and ship " + _root.ship._y );
    // I think you'll find...
  25. Replies
    10
    Views
    433

    A for loop evaluates to this // testing // for(...

    A for loop evaluates to this
    // testing
    // for( i = 0; i < 60; i++ ) { trace( "hi" ); }
    // becomes

    i = 0;
    goto evaluate;
    label: code
    trace( "hi" );
    label: endloop
Results 1 to 25 of 281
Page 1 of 12 1 2 3 4




Click Here to Expand Forum to Full Width

HTML5 Development Center