A Flash Developer Resource Site

Search:

Type: Posts; User: ninjakannon

Page 1 of 16 1 2 3 4

Search: Search took 0.10 seconds.

  1. Replies
    3
    Views
    2,347

    I use the virtual keyword to make it clear which...

    I use the virtual keyword to make it clear which methods I intend to or have overridden. I know that there's no difference to the compiled code, but it's nice to make it really clear.

    Just...
  2. Replies
    3
    Views
    625

    Oh, you're half right about the first one being...

    Oh, you're half right about the first one being incorrect (I thought it was strange!). There's no error, but it functions very strangely.

    I've done some more testing; getting some... interesting...
  3. Replies
    3
    Views
    625

    Vector of Vector

    As we all know you can define and instantiate vector like so:


    var a:Vector.<Type> = new Vector.<Type>()

    But what if we want a Vector of Vectors? Well Vector.<Vector> obviously doesn't work....
  4. Replies
    1
    Views
    464

    Just specify the scale mode of the stage: ...

    Just specify the scale mode of the stage:


    Stage.scaleMode = StageScaleMode.EXACT_FIT; // Will reshape your content

    // or:

    stage.scaleMode = StageScaleMode.SHOW_ALL; // Will leave white...
  5. Thread: Pointers

    by ninjakannon
    Replies
    4
    Views
    459

    Awesome, that's brilliant. Thanks for the info...

    Awesome, that's brilliant. Thanks for the info guys!
  6. Thread: Pointers

    by ninjakannon
    Replies
    4
    Views
    459

    That would actually be a good way of doing it -...

    That would actually be a good way of doing it - minimising the RAM used. So perhaps you're right; good thinking!

    I would expect there is some documentation about this somewhere, although I can't...
  7. Replies
    5
    Views
    581

    Oh I see. Well I'd created a listener in the...

    Oh I see. Well I'd created a listener in the class in the meantime so I'll just have to leave it at that.

    That's irritating though, surely it would have been more memory efficient to allow...
  8. Thread: Pointers

    by ninjakannon
    Replies
    4
    Views
    459

    Pointers

    Say I create 2 sprites.

    var s1:Sprite = new Sprite();
    var s2:Sprite;

    Then I set s2 = s1. Now, when I alter any properties of either s1 or s2, the property of both instances changes.

    So what...
  9. Replies
    5
    Views
    581

    Oh thanks! That should have been obvious. How...

    Oh thanks! That should have been obvious.

    How would I set up a listener for all MovieClips?

    Movieclip.prototype.addEventListener doesn't work.
  10. Replies
    5
    Views
    581

    Class.prototype?

    In AS2 you could say something along the lines of:

    MovieClip.prototype.onPress = function() { // Statements }

    But I can't figure out how to achieve the same effect with AS3. I'd need to create...
  11. The only method I can think of that might work...

    The only method I can think of that might work wouldn't even be great.

    You'd need 3 arrays. One that would contain the instances you'd like properties applied to (such as myInstance.myChild). The...
  12. Replies
    4
    Views
    424

    I don't mind at all, Chris. Okay, instead of...

    I don't mind at all, Chris.

    Okay, instead of using one MovieClip I used two, one nested inside another. First, draw whatever you want inside the nested mc. Then get the bounds of this nested mc...
  13. Replies
    4
    Views
    424

    I've fixed my problem, no need to help any more....

    I've fixed my problem, no need to help any more. ;)
  14. I'm not sure I quite understand your problem. ...

    I'm not sure I quite understand your problem.

    If a layer on the timeline it is 'above' another layer then it's content will initially be 'above' layers 'below' it. You can, using ActionScript,...
  15. Replies
    4
    Views
    424

    [F8] Center a Drawn Object

    Hi,

    If I use the ActionScript drawing commands to create any shape inside a MovieClip, how would I position the shape such that its center is at (0, 0) in the MovieClip?

    Bare in mind the shape...
  16. Replies
    0
    Views
    391

    [F8] Curved Path of Spinning Ball

    Hi,

    I have a ball on the stage, it has properties vx (x velocity), vy (y velocity) and vr (rotational velocity - ie side or English spin).

    In an onEnterFrame function the following occurs:

    ...
  17. Replies
    20
    Views
    1,103

    This is REALLY strange. I know what's...

    This is REALLY strange.

    I know what's happening, just not why.

    Stick this after the variables have been declared:

    currentImage = previousImage = -1;
    For some reason the while loop in the...
  18. Replies
    20
    Views
    1,103

    Math.random() returns a random decimal number...

    Math.random() returns a random decimal number from 0 to 1.

    Your image names are stored in an array where the first element is 0.

    So if you take Math.random(), multiply it by 3 and round the...
  19. Replies
    20
    Views
    1,103

    It's because you hadn't defined imagesDisplayed....

    It's because you hadn't defined imagesDisplayed.

    Stick this with the other variable definitions:

    var imagesDisplayed:Number = new Number();

    Also, change the pause function to this:
    ...
  20. Replies
    20
    Views
    1,103

    Don't worry about changing it. I meant that, if...

    Don't worry about changing it. I meant that, if you do use a variable, you've got to remember to set it at the start. (So: var maxImages:Number = 3; )

    It's just coincidence! The first few times I...
  21. Replies
    20
    Views
    1,103

    Copy and pasted from the file, changes made: ...

    Copy and pasted from the file, changes made:



    // Load and fade in a random image
    function randomImage() {
    imagesDisplayed++;
    // Make sure the image is not the same as before
    while...
  22. Replies
    20
    Views
    1,103

    I'm not sure why the second image would 'pop' up,...

    I'm not sure why the second image would 'pop' up, as you say. After all, it's alpha is set to zero when created for the first time.

    If you wanted to limit the number of images that displayed you...
  23. Replies
    20
    Views
    1,103

    Glad to help! If you're talking about the...

    Glad to help!

    If you're talking about the white space you see at the beginning... That's unavoidable. If you haven't got any images to show you've got to show the background.

    A workaround would...
  24. Replies
    20
    Views
    1,103

    I've fixed it. :D I had forgotten that each...

    I've fixed it. :D

    I had forgotten that each image was automatically unloaded when the next image was loaded to the same layer.

    I fixed this by sticking each image inside a separate movieclip...
  25. I've had a tinker with the file and done, I...

    I've had a tinker with the file and done, I believe, something like what you'll be after.

    I hope you have flash 8 or later, as I've attached a Flash 8 version (with AS1.0 and using Flash Player 6...
Results 1 to 25 of 394
Page 1 of 16 1 2 3 4




Click Here to Expand Forum to Full Width

HTML5 Development Center