coloring multiple frames in Flash Professional CC - actionscript-3

I'm brand new to Flash Professional and wanted to make a short 10 second clip. Instead of looking into using tweens and symbols (I wish I did) I used Flash Professional as a flip book, illustrating sketches for each keyframe.
I'm now in the colouring process and want to know if there is a way to colour an object (I've drawn with the brush tool) throughout multiple frames. is this even possible?
I understand there are some short cuts to repetitive tasks using ActionScript. But, once again I am brand new to Flash Professional and haven't tried anything in the ActionScript. I do however have a very basic knowledge of HTML coding and some javaScript if it helps at all…
If there is an alternate solution like exporting the file to another Adobe program that has a "colouring multiple frames" feature, that would be great too.

Sorry to say, to do that, you WILL have to work with symbols. However, this is an easy fix.
Select the object you want to color, click Modify--> Convert to Symbol. Give it a good name, and set it to MovieClip. Click OK.
Now, in the Library panel, double-click the icon next to your symbol name. Color as you wish.
There are multiple ways to put this on your timeline. You could replace each instance of that drawing with the symbol. Or, better, you could create a new layer with only one keyframe (and regular frames after that to the end of your animation. Place your object on that layer, and then remove all the old versions of that drawing.
NOTE: You will need to be mindful of where in the stack you put layers, as that sets the z-index of everything on that layer.

Related

AS3 replace string/text with image characters

i am developing the code for a simple game in AS3 and i have all the graphic assets made by a designer.
He wants all the textual messages (i.e. win, lose, lives, etc.) to be done exactly as in the original photoshop drawing, they have lots of visual fx on them.
Since these messages inside the game are dynamic, I tried to use normal textfields and replicate the visual fx with Flash filters, but the result is not even comparable.
I think i could try to export from photoshop a spritesheet with the all the image characters, or the single image characters one by one, and replace my old textfields with sprites/movieclips in which i would load the specific image characters based on the string i need to show to the enduser, but i don't know precisely how to do it.
Does anyone have some hints on how to achieve this result? Better to use a separate class and image library? I googled online hoping to find some class or method alike to customize a little for my needs, but unfortunately i haven't found anything!
You could add all the graphics to the library exporting them with each name.
Than call them when needed creating a MC. If useful, you could store the names in an array and use it to simplify your script (it depends on usage)
Ok, after some more research, i found out my main problem in not finding answers to my problem was the terms of research i was using.
I was erroneously looking for "AS3 string replace with images" or "text replace with images in Flash", while the correct question was: "how to use a BITMAP FONT in AS3".
I was sure someone else had to do what i'm trying to do (like in old games where texts were all image sprites) but i didn't know how to find it!
So, this is the solution i found, i still have to refine the workflow but it's a good starting point:
Create a custom Bitmamp font using the SHOEBOX tool in conjunction with photoshop, where you will be able to apply all the raster fx you want (here's the tutorial: http://renderhjs.net/shoebox/bitmapFont.htm)
You will obtain a .fnt file (descriptor) and a .png image (font characters atlas)
You will need to flip the png image vertically: apparently, a lot of bitmap text engines work with flipped characters, and i found this one to be working like this as well
Once you have these files, use the BMFontRenderer AS3 class to embed your bitmap font into an AS3 project of your choice (tutorial here: http://blog.bengarney.com/2011/12/07/fast-bitmap-fonts-in-flash/)
I hope it will be useful for others who may need to replace standard text in Flash with font images.

AS3 - What are the different methods of rendering animation on the screen?

I'm a beginner to AS3 and programming in general, but have learned enough that I want to now start learning how to render animations on the screen. These are the methods that I know of from two days of "researching" on google.
I'm not in a situation where I could afford to take courses from an educational institution, so my only means of learning are through online sources.
Update an objects x or y positions in a loop on every frame. Very basic. Of course any kind of advanced animation (say, showing a character running) is not possible with this method alone.
Using Flash and creating animation on a movie clip's timeline and, combined with moving the position of the object we can achieve some proper animation this way. However I cannot afford Flash, so this is not an option available to me. It also doesn't seem to be a popular option among more experienced programmers either (I think, due to having poor performance when lots of objects animating on the screen?)
Using a sprite sheet and then blitting the relevant image from the sprite sheet onto the screen.
Is there any other way to put an image from a sprite sheet onto the screen other than blitting?
And what other methods of rendering animation are available?
Some online websites claim that blitting is all I'll ever need, but I want to know all the options available so I could choose the most appropriate one for any given situation.
Any help would be appreciated :)
Another option for blitting is Stage3D. Take a look at Starling for 2D animations.
Blitting would be my best opinion. The only other thing I can think of is manually taking the images from the sprite sheet and putting it into each frame of an animation.
To render animation, you can create a frame in a MovieClip and convert it into a MovieClip and name the frame 'running'. Then you need to create an Enter Frame event where the MovieClip's instance name is 'Guy' and in the code on the function write 'Guy.x += 5;' to make your MovieClip go 5 pixels to the right every frame and also in the function write "Guy.gotoAndStop('running');"
Use TweenMax engine for better animation purposes. Easy coding, more Animation!!

ActionScript 3 movieclip with interchangeable images

I'm creating a game using Flash Develop and ActionScript 3.0 and I can't figure out how to make a "Character Creation" menu, in the sense that, I want to animate a movieclip full of images (head, torso, arms, etc.) and then change out any image with another.
So I'd like players to be able to choose what kind of sunglasses they want their character to have, for example, and the different sunglasses will keep the animation that I made with the original ones.
From what I know so far I can export a movie clip as a .swf and use it as such, but how do I change out images and keep the animation?
Any suggestions are greatly appreciated.
Thanks!
I don't know how much actionscript you know.. but if you just want an idea how to do it and not the whole thing in code...
I would personally make different movie clips for the different parts of the body that can be changed and then change frames in that move clip. For example one movie clip with different hairstyles, one with (sun)glasses and so on.. and then just go to then next frame in the "hairMC" to change the hairstyle.
The way I'd do it is to create MovieClips that all implement the same Interface and then have other MC's higher up that know how to use the particular Interface. For example, if you had an IArm, it might know how to swing and how to grasp (and it might grasp by using an IHand). A fat ITorso might attach the arms at a different spot than a thin one.
And your Character might have an IHead, ITorso, etc. When you created a Character, you could either pass in these components via the constructor (I'm not a big fan of constructor arguments for Views, but it's one way to do this), or you can expose setters on your Character that allow you to set these properties one at a time.
This gives you tremendous flexibility in how to put your character together--none of the pieces know precisely how the others are put together, but the methods they need to operate on are in place, so you can put in any implementation you can think of.

Working with Graphics in Actionscript

i haven't worked with graphics until now.. so I have not much ideas about using graphics objects in flash cs6.
I want to move this character depending if the person has pressed a button and stop his movement once the button is released. I looked up on how to go about this process.. so far one thing that kept coming up was to turn my spritesheet into graphics.. but after that i couldn't really find anything on how to integrate this into actionscript. Plus when I convert an object into graphics it doesn't give me options to assign it a class name. so can somebody give me a good breakdown on what is the purpose of these graphics objects? and how should I go about making a sprite move?
Disregard information concerning sprite sheets. These are used as a completely different method of graphics rendering that I'm not going to cover here; for more advanced, high performance applications and games.
When you say Graphics, I am assuming that you mean you've created some drawings that you've converted to a Graphic like this:
These types of objects are used purely for timeline animation. What you want to use here is the type MovieClip. When you use this type, you'll be able to give the object a class name like you mentioned:
After doing this, you'll be able to refer to that library symbol in ActionScript like this:
var gr:MyGraphic = new MyGraphic();
addChild(gr);

AS3 - Moving a line through guide

I'm trying to animate a nodal with flash for teaching purposes. This is what I want to animate:
My questions:
How can I move the line through a guide?
Can guides hold z positions, so I could make the rope's top and bottom parts more real?
Can a vector image (rope) move through a guide path?
Which way is this possible, strokes or brushes?
Does as3 scripting support "decorated brush" effects?
Is there a simpler way to do this such as sandy or awake3d or beziercurves?
If you're using the IDE like CS4 or CS5 there are some menu options to do this. I only use a text editor and Flex SDK to compile. While I know what you're talking about, I can't really answer this one since I don't have the program. There's plenty of tutorials on the subject, however.
I believe the path-following tools in CS* only follow (x,y) coordinates. No Z values in the menus, but you can code them yourself. Again, I don't have the program, but from the tutorials I read it looks like no.
I suppose it could. Instead of a line drawing like you have here, you could simply use an image of one rope segment (as in a picture of rope whose length is equal to one twist of the rope), then apply transformations to get the correct 3D perspective.
Basic flash programs only draw fills. You can, however, run a shader program (called pixel bender) within flash which will draw strokes for you.
Not on it's own, no. But there is nothing stopping you from programming your own decorated brush class.
Bezier curves are probably the way to go.