A Flash Developer Resource Site

Search:

Type: Posts; User: jbum

Page 1 of 20 1 2 3 4

Search: Search took 0.07 seconds.

  1. Hey Simon, I haven't seen any examples like...

    Hey Simon,

    I haven't seen any examples like this, but I have a pretty good idea how I'd implement.

    I'd first generate a bitmap which corresponds to the surface the ant is travelling on. The...
  2. Replies
    4
    Views
    736

    To react to relative mouse position, use this ...

    To react to relative mouse position, use this



    this.vx = (this._x - _root._xmouse) * 1.5;
    this.vy = (this._y - _root._ymouse) * 1.5;


    To answer your second question. I'm not sure there is...
  3. Replies
    4
    Views
    736

    There are basically three fixes you need to do. ...

    There are basically three fixes you need to do. First, comment out the lines that read

    this.startDrag(false);

    and

    this.stopDrag();

    Next, near the bottom of the script there are two lines...
  4. Replies
    8
    Views
    606

    Note: Offering money for services is against...

    Note: Offering money for services is against board policy. Closing this thread.
  5. Replies
    1
    Views
    485

    A method I commonly use (which works like a...

    A method I commonly use (which works like a global string replace on the string) is:



    yourString.split( 'seachString' ).join( 'replaceString' );


    This was one of a collection of useful...
  6. Replies
    5
    Views
    661

    I added a few lines to the end of your snow...

    I added a few lines to the end of your snow script:




    onClipEvent (load) {
    movieWidth = 700;
    movieHeight = 140;
    i = 1+Math.random()*2;
    k = -Math.PI+Math.random()*Math.PI;
  7. Replies
    3
    Views
    589

    I was able to simplify your onEnterFrame handler...

    I was able to simplify your onEnterFrame handler by using a few trig functions.

    // USEFUL CONSTANTS
    kCorrection = 180; // This is only needed because your cannon is pointing to
    ...
  8. Replies
    2
    Views
    1,111

    theta is the angle of your current spot in the...

    theta is the angle of your current spot in the spiral - you just need to convert it from radians to degrees.

    _root["t"+step]._rotation = theta * 180/Math.PI;

    - Jim
  9. Replies
    2
    Views
    622

    messageString = "

    messageString = "<NEW_CLIENT userName = \"" + userName + "\"/>";
  10. Replies
    5
    Views
    2,189

    Cool! Glad you were able to get your hands dirty...

    Cool! Glad you were able to get your hands dirty :)
  11. Replies
    7
    Views
    770

    Or just bite the bullet. ary = [D1_H0_CUM,...

    Or just bite the bullet.

    ary = [D1_H0_CUM, D1_H0_SWE1, D1_HO_SWE2, // etc... ];

    And next time, name your variables consistently to avoid this kind of nonsense.
  12. Replies
    3
    Views
    556

    Let's say R is the percentage loaded - most...

    Let's say R is the percentage loaded - most preloaders compute this at some point.

    Let's say OX, OY are the original (random positions) of the movie clips. If you haven't stored these in...
  13. Replies
    5
    Views
    2,189

    Aww c'mon, writing parsers is fun! Here's a...

    Aww c'mon, writing parsers is fun!

    Here's a quick & dirty one I just wrote for you.

    This one uses reverse polish notation, and accepts formulas such as

    2 2 +

    2 2 * 4 +
  14. Replies
    15
    Views
    2,089

    Thanks. Keep in mind that it's not the color...

    Thanks. Keep in mind that it's not the color that is the problem - it's the double-spacing and indenting.
  15. Replies
    2
    Views
    474

    Change this bit: ...

    Change this bit:

    getURL(linkArray[i],"_blank");


    to this:

    getURL(linkArray[this.i],"_blank");
  16. Replies
    15
    Views
    2,089

    Just wanted to mention that the [ as ] tag bugs...

    Just wanted to mention that the [ as ] tag bugs are a big reason for my recent inactivity here.

    Just too irritating to have to post unreadable code in an actionscript-centric forum.
  17. He's probably doing it in an enterframe handler,...

    He's probably doing it in an enterframe handler, like so:


    onClipEvent(enterFrame)
    {
    if (Key.isDown(Key.LEFT))
    {
    // handle left key
    }
    if (Key.isDown(Key.RIGHT))
  18. Replies
    2
    Views
    520

    The article is suggesting that in place of a loop...

    The article is suggesting that in place of a loop or recursive function (or other code which takes a long time), you replace it with an onEnterFrame handler, or a function called via setInterval...
  19. Replies
    5
    Views
    2,189

    Unlike some other languages (like Perl),...

    Unlike some other languages (like Perl), actionscript does not provide a function for parsing and executing arbitrary actionscript code. In other words, this does not work:

    result = eval("2 *...
  20. Replies
    1
    Views
    1,292

    When you hit a horizontal wall, reverse the...

    When you hit a horizontal wall, reverse the horizontal velocity, and leech off a little of the energy.

    For example:

    // hit left wall?
    if (this._x < 0) {
    vel_x = -(vel_x * .8);
    }

    The...
  21. Thread: Math and scaling

    by jbum
    Replies
    1
    Views
    412

    I think you want about 77% - not 70%. 1/1.3 =...

    I think you want about 77% - not 70%.

    1/1.3 = .769

    If you post your circle drawing code, I can show you how to modify it to draw the circle at any location.
  22. Replies
    1
    Views
    578

    Assuming all these variables are attached to the...

    Assuming all these variables are attached to the _root timeline, you can do this:

    timeRemaining = _root["timer" + theRound];
  23. Replies
    2
    Views
    477

    First off, to round a number up to the next 100,...

    First off, to round a number up to the next 100, you would do this:

    n = Math.ceil(n/100)*100;

    In your case, however, you don't want to round to 100. In the case of 1152, you want to round to...
  24. Replies
    9
    Views
    1,080

    Yeah, change this line as follows: ...

    Yeah, change this line as follows:

    this.arrow._rotation = Math.atan2(dy,dx)*180/Math.PI + 90;
  25. Replies
    9
    Views
    1,080

    Cool - remember that your arrow must point to the...

    Cool - remember that your arrow must point to the RIGHT when it is at zero rotation, in order for that code to work.
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4




Click Here to Expand Forum to Full Width

HTML5 Development Center