Search:
Type: Posts; User: ninjakannon
Search:
Search took 0.10 seconds.
-
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...
-
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...
-
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....
-
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...
-
Awesome, that's brilliant. Thanks for the info guys!
-
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...
-
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...
-
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...
-
Oh thanks! That should have been obvious.
How would I set up a listener for all MovieClips?
Movieclip.prototype.addEventListener doesn't work.
-
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...
-
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...
-
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...
-
I've fixed my problem, no need to help any more. ;)
-
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,...
-
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...
-
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:
...
-
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...
-
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...
-
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:
...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
|
Click Here to Expand Forum to Full Width
|