ActionScript 3.0 :: Palette Swapping The Ninja?
Apr 27, 2010
I'm a pixel artist struggling with AS3.I want to load a sprite sheet from file, actionscript through the five rows of colors in the upper left to identify the five palattes (by default, the sprite sheet is colored using the first palette), then recolor the entire sprite sheet according the one of the five palettes, setting magenta to transparent. The end result being the ability to do this...
I can do loops and arrays, but I don't know how to actually cycle through the PNG identifying and replacing colors. I've loaded the sprite sheet and scrolled the palette out of view using scrollRect, but nothing else.
Code:
//Scale the screen x3
scaleX=3;
scaleY=3;
[code]....
View 4 Replies
Similar Posts:
Nov 29, 2011
Well we've all probably seen the "Mortal Kombat" ninja before. But how possible is it to do this with AS3 using a bitmap in a mc. I have searched all over the place for a tutorial on how to go about this but I can't seem to find anything that suites my needs. Do you think Flash has the power to do this at runtime for a game?
View 14 Replies
Jan 23, 2011
I have scoured google for every phrase combination I can think of. Right now, my ninja moves left, right, and jumps how I want him to. Unfortunatly the movement code is located under an onEnterFrame event, so it only plays the first frame of his walking/jumping animation. I found a tutorial at [URL] that looks like it has promise, but I cannot get it to work with my current setup. (Not to mention it has SERIOUS flaws itself) How can I make it so the ninja animates all the way through during his walking phase??
View 1 Replies
Mar 24, 2010
I must create a GUI for a ninja game.
View 1 Replies
Sep 24, 2011
I use a custom color palette in Flash CS5.5, it was originally created in flash 8. I have it saved as default in the swatches tab. Every time I create a new document it loads this original color palette. But after I save the file, close it and re open it, it always loads the web 216 palette.
View 1 Replies
Feb 28, 2009
How do you shift the colors of a bitmap image, with a red/yellow cloud, so that red becomes orange, then yellow, then orange, then red again? The yellow should go trough the same process, but start and end with yellow. Same with all the other colors in between.Kind of like when you play with the hue-setting in photoshop, but instead of looping trough the whole spectrum, it only loops trough red>orange>yellow>orange>red.
View 7 Replies
Oct 29, 2010
I'm having some problems porting a palette shifted animation system from J2ME to Flash. The system is used within a game that construct characters from separate body parts for e.g. head, left arm, legs, eyes, mouth etc. These can then be tinted and animated. Each of these body parts is coloured using a look up table. There is the original palette, then there are 18 other palettes that can be used to tint the image. This way you can configure different looking characters without having hundreds of different images. Each palette has 398 colours, there are 18 different palettes in total.
Each body part contains a small amount of colours, usually around 10-20. Colour A1, Colour B1 etc... Then the body part can be tinted using another set of colours, for eg Colour A3, B3, C3 etc.. It's simply a 2D array. (I have screenshots that help explain if needed) Now I've been trying to use PaletteMap, without success. I believe it uses a full colour palette (i.e. 255 vals per colour), and can't simply change colour A1 to colour A3 etc.
I also tried threshold, but that doesn't seem to be fit for purpose. getPixel / setPixel is way too slow for my purpose. It needs to be pretty fast as each body part is animated. I have a lot of flash programming experience, but never at such a low level! I might have been using paletteMap / threshold incorrectly, but the adobe docs leave a lot to be desired!
View 0 Replies
Jan 8, 2012
This is my drawing code that I have now, and I wanna be able to use the color picker palette to chosse between color red, green and blue.
[Code]...
View 9 Replies
Jan 10, 2012
This is to be exported into a movie, so not an Actionscript question. I'm making a parody of a fighter-game scenario. One character looks like Subzero and the other like Scorpion. They're the same models but one should be colored differently. They're comprised of symbols such as arms and legs to make a larger overall character animation. There are several animations of them, for kicks, punches, bobbing, etc. Now, I know that if I went in and edited the colors, that all instances would change accordingly. Duplicating the symbol doesn't work because they share the same inner symbols. Is there a method for "deep" duplication? A tint doesn't work because essentially I only want to change the color of some of the components.
View 7 Replies
Feb 9, 2009
I want to make a custom color palette on my paint project that I am developing. Also need 'paint bucket tool ' functionality.
View 0 Replies
Jul 14, 2010
I want to create a flash document that allows me to change the colous of an image using a colour palette of my own. I am a complete beginner and have no idea where to start this, hence i would need to know what to do and how to do it. I basically want the image to be a simple 2d image that i will create using different layers in photoshop and import them into flash, the layer images will all be one colour so the colour of the whole layer changes. so the colour palette will be on the side of this and when i click on an image and then a colour the image changes to the colour i clicked.
View 3 Replies
Jun 15, 2010
We are creating an ecommerce site for my business and am trying to create a flash file that will allow the end user to select a color from a palette of 64 different swatches that they would like their item to be so it processed it into the order. I only need to create the flash file so they can select the color.
View 4 Replies
Nov 14, 2009
I want to use a comboBox from which the user selects a colour theme. When the item is selected, I want it to run a function that will then change various item's attributes. I don't know where to store the new attribute values though. I tried storing them in comboBox item under DATA but that didn't work. I also tried having a function as data which didn't work either.
View 1 Replies
Sep 16, 2004
Anyone knows a good color palette source? something with a choice of, i don't know, 20 or so colors.. So the user can select the color he wants..
View 2 Replies
Jul 3, 2008
I'm trying to get this script running. It's to make a menu consisting of 5 buttons next to each other. When one of the buttons is clicked, it swaps position and color with the most left of the sequence. The gap created by the transition is either filled with a simple swap, or having all the buttons left of the gap slide to the right.So I figured I'd arrange all the buttons in an array. Here's my script
Code:
#include "mc_tween2.as"
function setup() {
[code]......
View 11 Replies
Nov 16, 2009
I am currently working on a project of a commercial flash box thing for their website.I have a thing where I need a bunch of images to wipe in this certain way. They are in mc's, and just sitting there, while I have squares moving on top of them doing the wiping. I need to know how to swap these image mc's out when it hits a certain frame e.g. frame 70.
View 1 Replies
Feb 2, 2010
I'm trying to figure out how to have a movie clip randomly replaced every time the page is refreshed. I have 4 clips that I want to have appear in the overall movie, but swapped in and out randomly. Also, I want these clips to play once, then stop, but continue to show the last frame of the clip for the remainder of the time that the main movie is playing. I must be placing the stop() in the wrong place or something. I tried placing one inside the original movie clip before I published it, it works on it's own, but not when I place it in the timeline of the other movie. No matter where I put that stop command, it doesn't seem to work.
View 1 Replies
Oct 7, 2009
I'm trying to swap movieclips in and out of an area, rather than loading an endless number via attach/getNextHighestDepth. Is there a way to swap my attached movieclip A with a new attached movieclip B, so that either clip A or Clip B is loaded, but not both? Because my current program uses attached files of identical size that overlap, I didn't realize there was a problem until things slowed down. I checked my number of objects in the debug list between hitTests and lo and behold, the list of objects got longer each time, even though to the viewer, it looked the same.
View 4 Replies
Sep 28, 2010
I upgraded recently to Adobe CS5 from MM Flash 8 so that I could recover some newer Flash components that were developed in a newer version. This all seemed to go with out any issue. However, once in CS5, I noticed twice that an images switched to another image in the library. So I had two copies of the image and one image that went missing. I solved this by just updating the image that was corrupted.
I was on a crunch for this project and was working 16hr days, so I just left my computer on over night with CS5 open. I published the presentation and sent it for approval. Once everything was approved closed CS5.
When I reopened it many, (around 30ish) of my images have been corrupted the same way. I went back to my previous backups and the last 8hrs worth also have the corruption.
Is this something I can easily and permanently fix in this demo or as long as I use it will it keep on screwing up?Is this issue only with images or is my action script also likely to be corrupted?
View 6 Replies
Oct 11, 2010
I simply want to be able to write a function within a class that swaps a button or movie clip on the stage (that sits within another movie clip)with another button/movie clip that is located within the library.I have attempted the addChild() method but that doesn't seem to be working so well...e.g.clipOnstage.myBtn.addChild("libraryClip")....was just hoping it would replace the mc that is already within the display object container (kind of like what loadMovie used to do in as2)
View 4 Replies
Feb 17, 2009
I basically have a large bar of items that fills up dynamically, they are all added to a dispCont movieclip as a container. When you click on one it gets pulled to the front, scales up and I want all the unselected Items to blur or become semi transparent. So i figured i could just tween the dispCont object, however this affects whatever is brought to the front, so i want to switch that into a new MovieClip called centerCont. Here is the code, ive been trying different things, I could just use a little input.[code]when I click on it because i am trying to set event.target.parent = centerCont;otherwise, uncommented and that removed i get Code:1118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.display:DisplayObject.
View 0 Replies
May 15, 2010
For starters, I may be going about this all wrong, but I have two PNG bitmaps that I have embedded into my script:
[Embed(source="pic1.png")]
private var Image1:Class;
[Embed(source="pic2.png")]
private var Image2:Class;Now I can addChild and removeChild to get them on and off the screen, but this seems cumbersome.
View 7 Replies
Jul 7, 2010
I have got an animation using 4 jpeg pictures which are of course stored in my library...I use them multiple times in the animation and I need to change them from time to time but I dont want to swap them manually in flash. The ideal solution for me would be if I could write some code that is able to swap this images in library for those I have in folder where swf is saved. here you can see my animation for better understanding: [URL]
View 2 Replies
Aug 30, 2010
How do you go about swapping depths in AS3? I've got a movieClip (allContent_mc) that contains a bunch of other movieClips(mc1, mc2, etc.) that expand in size when clicked on. However, when they are expanded I need to make sure that the one being viewed is on top. The control to expand each clip lives within each clip itself. Ideally, when the expand code (below) is executed, I'd like to make sure the clip's depth supersedes all others. I'm keeping all the clips together in one larger clip because the larger clip is living inside a scrollPane component. Pretty sure I'm just not defining the path to the clip correctly.
ActionScript Code:
function goOpen(e:MouseEvent):void{
this.setChildIndex (square_mc , this.numChildren - 1 );[code]...........
View 7 Replies
Mar 5, 2004
How you'd swap; after storing, _x /_y position values of movie clips on button instances ie. onClick ..... Let's say I had four 4 movies and 3 buttons the (first movie looking like a button but is active so it's not clickable at that point) mc1, mc2, mc3, mc4 when the movie loads they are in that order. When the user clicks mc2 or 3 or 4 it slides into the _x position of mc1, and mc1 slides into the _x pos. where mc2/3/ or 4 just was (they swap).... then the user clicks mc4 or 3 or 1 and it swaps pos. with mc2 and so on.... all this done with a smooth easing transition. An example similar to this is the navigation module on [URL].
View 10 Replies
Mar 8, 2005
I have an image (possibly in an MC), which I would like to change, depending on the section the user is in. Basically I am looking for something like what the Swap Symbol command does.. swapping the symbol with another one.
View 1 Replies
Jul 30, 2008
I have a list component being populated by XML. In the XML, it contains characters like & " etc.. I have a function that will replace that with its proper character like & and "
[Code]...
View 1 Replies
Sep 17, 2010
I am working on a Flash / AS3 project which has several audio tracks and starts off with an intro track. When the user clicks a button a window opens and the audio track changes, the new audio track continuously loops until the user closes the window. When the window is closed the audio track switches to a default audio track which is similar to the intro track. The problem I am having is that when the user clicks on the button and the window opens, the audio track plays as expected, but when it reaches the end, it doesn't loop, instead the intro track starts to play instead (and loop I assume).
Here is the code I am working with:
Code:
package {
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.MouseEvent;
import flash.media.Sound;
[code]....
I included trace statements to track what the value of "music" is doing. It appears that when the function repeat() occurs, "music" always seems to default to the intro music "audio/track-intro.mp3".
View 1 Replies
Jan 6, 2005
I want to swap depths on movieclips overlaying each other but instead of the new clip on rollover just popping up over the other one, i want it to fade into the top.
here is an attached .fla file in mx2004 format.
for those not using 2004, here is the code:
PHP Code:
but1.onRollOver = but2.onRollOver = but3.onRollOver = but4.onRollOver = function() { this.swapDepths(getNextHighestDepth()); };
Also, is there a way to streamline this code so i dont have to type the button instance names every time i add another?
View 6 Replies
Mar 5, 2004
Just was wondering if anyone had any idea on how you'd swap; after storing, _x /_y position values of movie clips on button instances ie. onClick ..... Let's say I had four 4 movies and 3 buttons the (first movie looking like a button but is active so it's not clickable at that point) mc1, mc2, mc3, mc4 when the movie loads they are in that order.
When the user clicks mc2 or 3 or 4 it slides into the _x position of mc1, and mc1 slides into the _x pos. where mc2/3/ or 4 just was (they swap).... then the user clicks mc4 or 3 or 1 and it swaps pos. with mc2 and so on.... all this done with a smooth easing transistion.
View 10 Replies