ActionScript 3.0 :: Creating A Series Of Solid Rectangles?
Jul 13, 2009
Fairly new to ActionScript 3. I am creating a series of solid rectangles which will be acting as butttons for my site, a new rectangle is created by looping through an XML List, 1 rectangle for each title in my List. They will be displayed 1 above another down the left hand side of my screen.
What I want to do, if possible, is create a vanishing point on the right hand side of my screen which the rectangles will use to alter their perspectives.Obviously the rectangles with a far different Y position to the vanishing points, will display with a greater perspective.
I have 2 movieclip class's. A ball which you control a series of rectangles that the ball "lands" on.
using a hittest, when the ball "hits" the rectangle movieclip it stops directly on top of that rectangle.
I have 3 rectangles all linked to the same class containing the hittest.
My problem is that when I move the ball across each rectangle, it does not land in the same place each time. I believe this is because since I'm using an ENTER_FRAME event, the hitCheck doesn't coincide with the ball's true first contact, and sometimes makes the ball move a little lower than desired.
I have the following AS code to draw a single rectangle using mouse, but I need a different code that allows drawing multiple rectangles and the selection/exclusion of individual rectangles like a modeling tool (eg.: MS Visio).
I've had to create the following code to get a series if loading movies to work properly. Each loaded movie is basically a series of automatically looping images controlled by external xml. I found that without adding the unload movie on each button action the first movie loaded kept playing over any subsequent movies loaded. However its rather long winded and if the amount of movies increase it really is going to be very large. How to create an efficient funtion that does the job in a more effective way:
I am making a flash video game. You will have control of a spaceship that is going to go to space. I made a 550x30,000 JPG file in photoshop to use in flash as the background for the game. 30,000 pixels is about what I need to make a good scale of the earths atmosphere because earths atmosphere is about 36,000 feet high and I was goign to use a scale of 1 pixel = 1 foot.
When I import the jpg to flash and test the movie instead of my background all I see a a plain red box in the movie window. It fills the whole stage. This led me to think that there could be a pixel limitation. If so what are the limitatoions and how can I get around them?
I've trying to make blocks solid so my character can walk across the blocks and not go straight through it ive looked around for around 12-13 hrs at the moment and im still stuck.
I'm trying to simply draw a solid shape consisting of various other shapes, however, when I overlap two shapes, the overlapped area becomes transparent again. For instance:
Code: var myShape:Shape = new Shape(); myShape.graphics.beginFill(0x000000); myShape.graphics.drawCircle(10, 10, 25); myShape.graphics.drawCircle(20, 10, 25); myShape.graphics.endFill(); this.addChild(myShape);
The above code is AS3, but I believe the same thing happens for AS2 as well. The overlapping area between the two circles is not clack.
I am currently creating a game in which the character is stationary in the middle and the world moves in relation to the character. When the character is not moving and not touching anything, I need the world to shift upward to meet the character and stop on collision detection. The problem is I have no idea how to conceptually make this work.
making assets "fall up" and stop when colliding with an object (basically reverse gravity).
I have buttons that load SWF files. when i test the SWF they have a solid background. However, if i use a button to open the swf they have transparent/no background, yet you can still see the contents of the swf.
How do i get the SWF to have a solid background when opened by buttons?
I'm building a map editor for a project and need to draw a hexagon and fill it with a solid color. I have the shape correct but for the life of me can't figure out how to fill it. I suspect it may be due to whether the thing is a Shape, Sprite or UIComponent. Here is what I have for the polygon itself:
import com.Polygon; import mx.core.UIComponent; public class greenFillOne extends UIComponent {
how to make a flash background go from solid to transparent? I know how to make it transparent all of the time, but I want the SWF to play, the background is there, and when it's done I need it to fade away...
I'm trying to duplicate this type of mouse trail. I can't tell if it's deforming a movie clip or drawing separate objects on the stage. I can duplicate it at slow speeds, but at a fast speeds I have no idea how they're doing it.
The MouseEvent.MOUSE_MOVE is way to slow on the update to draw exactly where the mouse is going so I tried using curveTo to create a curve but unfortunately you still hit a point where you get a sharp angle.
I have series of Bezier curves that I want to revolve about an axis to form a solid model in Papervision3D.How would I do this? Has someone created a class for Papervision that can revolve a curve to form a solid?
I'm using Arial for my content font. I'm trying to set it up so that there's pretty solid edging.
Code: var antiAliasEntry_1:Array = new Array({fontSize:12.0, insideCutoff:0.61, outsideCutoff:-3.43}); var arialTable:Array = new Array(antiAliasEntry_1); TextRenderer.setAdvancedAntialiasingTable("Arial", "none", "light", arialTable);
I think it's that insideCuttOff needs to be smaller, and outsideCutOff needs to be further in the negative direction. But when I do that, there's no much of an effect. Here's what my text looks like now:
I am just starting with 3d flash concepts and I was checking this tutorial:[URL]I wonder if there is a tutorial showing the same movement but with a solid cube. I fact, what I want to achieve is this effect:[URL]
For example, I have a transparent png file, the shape is a car.In the png file, I only draw the white border shape.Outside and inside the border are all transparent.
I want to use actionscript3 code to show the car object with different color, it means only fill color inside the border, and for the outside of the border, keep transparent.How to do that?
So far, the simplest workaround is to prepare many images with PhotoShop, but it's not good enough for me. When I have many shapes and use many colors, I've to prepare many many images.Add more details:(Because I'm using white border, you may not see the basic png file if your background of browser is white)
Is there way to use bitmap fills instead of solid colors for the Coloring Book by Zelwyn?I want to color shapes with bitmap fills. If the user changes his mind, then he could recolor the shape with a new bitmap.It would be the exact same as the coloring book, except using image bitmap fills.
I'm having an issue with solid backgrounds showing up behing transparent PNGs in Flash. I know this isn't a lot to go on, but I have no idea what is going on here, My client sent me the attached image.. This is what they are seeing (the green box behind the top of the vehicle). I am not seeing this. Apparently this box, and other similar boxes show up during image transitions.
I am using Tweens to fade between different models and colors of the vehicle. I was originally using Caurina/Tweener, and experienced similar issues myself, but since switched to using the built in tween class, and am not seeing any problems anymore, but apparently my client is.You should be able to see the attached image. You can also view the demo link, to see if you see any issues yourself with the PNGs fading in and out....(you'll have to sit through the intro, then click EXPAND on the final frame)
Is there anyone that can write a really basic physics engine including 1 ball and 1 solid object?
So it should be 1 ball and then 1 solid object like a box. The box should be completely solid, the ball shouldn't be able to go through the box, it should just stop when hitting it at any angle.
I'm making a top view zombie survival game in AS3. I want to spawn the enemies in waves defined by "frames", or the difference between a bigger rectangle and a smaller one within it, like a picture frame. Right now here is my code, which is pretty inefficient. I was wondering if there was a better way. This code doesn't work right either, all the enemies spawn in the bottom right of the screen:
public static function waveOne():Point { var inner:Rectangle = Waves.WAVE_ONE_RECTANGLE_1; var outer:Rectangle = Waves.WAVE_ONE_RECTANGLE_2;[code]....
In CSS, we have a box model to define how border, margin, padding, and fill contribute to the total width and height of a rectangle. I'm porting some of my HTML/CSS design into Flash and can't quite figure out what Flash's box model is. In Flash, I've created a rectangle with gradient fill and a non-scaling 1 pixel stroke. I'm trying to get pixel-perfect positioning and sizing, but the experience has been unpredictable. I'm not really seeing a pattern to the following questions. The answer really changes depending on the exact circumstances.
When you set x and y both to be 0, where does the border lay? Is it off the screen? Is it being cut in half by the origin? Or is it completely visible?When you set width to 100, is the fill 98 wide or 100 wide?What happens to the 1px thick border when the rectangle is not positioned at whole number coordinates?
Example:
var sh:Shape = new Shape(); sh.graphics.lineStyle(1.0, 0x00FF00, 1.0, false, LineScaleMode.NONE); sh.graphics.beginFill(0xFF0000, 1.0); sh.graphics.drawRect(0, 0, 100, 100);
[code]....
I tried to create a 100x100 square at x:10, y:10. When I measured the total width and height in Photoshop, it came out to be 101x101.One would either expect the final dimensions to be 100x100 (border on inside) or 102x102 (border on outside).
I created a small rectangle and made it into a symbol movie clip. then I went inside of it and added a small 100x100 image on the left side along with a description of the image on the right side filling up the rest of the space.
I now want to somehow put it in a container that will automatically add a vertical scrollbar on the right side and somehow add more rectangles on top of each other. perhaps the scroll bar wont be initially on the screen until the container fills to have more than 5 rectangles in it or so.
Is there a component I can extend somehow to add this kind of functionality or does one already exist that I can use?