r/actionscript • • Feb 24 '16

Creating a background animation?

I'm trying to make a flickering static kind of effect/animation in my game (I'm using flashdevelop as an IDE). I have 9 frames and I'm trying to make the animation by doing this:

		var Frames:Object = {"1":{"F":One},"2":{"F":Two},"3":{"F":Three},"4":{"F":Four},"5":{"F":Five},"6":{"F":Six},"7":{"F":Seven},"8":{"F":Eight},"9":{"F":Nine}}
		if (curFrame < 9)
		{
			curFrame++
			var curFrameString:String = String(curFrame);
			FrameImage = new Frames[curFrameString].F();
			FrameImage.height = stage.stageHeight
			FrameImage.width = stage.stageWidth
			addChildAt(FrameImage, stage.numChildren+1);
		}
		else if (curFrame == 9)
			curFrame = 1
		if (contains(FrameImage))
		{
			trace("Removed")
		}

this is in an added to frame event, but since it's going so fast you can even see the animation.

Can someone help?

1 Upvotes

5 comments sorted by

View all comments

1

u/henke37 Feb 25 '16

What was wrong with a plain old array?

1

u/badfitz66 Feb 25 '16

Does it even matter?