dcsimg
A Flash Developer Resource Site

Search:

Type: Posts; User: jbum

Page 1 of 20 1 2 3 4

Search: Search took 1.03 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
    501

    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
    501

    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
    508

    Note: Offering money for services is against...

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

    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
    445

    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
    454

    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
    793

    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
    535

    messageString = "

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

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

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

    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
    467

    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
    1,358

    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
    1,463

    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
    391

    Change this bit: ...

    Change this bit:

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


    to this:

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

    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
    350

    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
    1,358

    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
    934

    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
    335

    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
    443

    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
    378

    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
    831

    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
    831

    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