ActionScript 3.0 :: All TextFields Displaying As Squares?
Mar 18, 2011
I learned about the date class yasterday and made a lil app that will tell me when the next recess at school will be. It worked great when I ran it at home, but now when I try to run it at school all the letters in the textfields displays as squares, the numbers still work tho. The only difference I can think of is that at home i use CS5 and at school is use CS4, the font is embedded in the fla.
Every time I draw a gradient box throuh the code (I use a lot of them for the backgrounds with dynamic colours) I can just pray that it shows on the stage. Most of the time it does, but some times it doesn't. The trace statement is lying to me that the graphics is on the stage.
I resize dynamically a textfield to the height of the text in it. Most of the time it resizes correctly, but some times it doesn't, and makes my next line of text invisible. The trace statement again is lying to me that the textfield was resized.
Is there any way to make sure that my code is executed correctly or at least to find the error and fix it?
The example of the text animation and dynamic background I use is here: [URL]
This issue is my constant pain, and has set my project back some time. I'm creating a message system for my game, it's supposed to record events that happened during travel, 3 vars per message (topic, in game date, content)All the vars are in an external as file and a public class. The problem is they return blank in the mc's textfields while displaying correctly on the main timeline textfields at the same time. This is the code sitting inside the mc that doesn't work.
Code: import Variables; var variables:Variables = new Variables(); function setMsgSlot (e:Event) {[code]....
on the main timeline, even in the same frame, works perfectly, and i can't figure out why.
At the moment, everything is output to stage in one big clump. But I can't figure how to make each text field display on separate lines. Messing with the y value doesn't seem to do the trick nor do line breaks in the XML.
Code: var dtxt:TextField; for (var i:uint = 0; i < occID.length(); i++) { dtxt = new TextField();
[Code]....
The purpose of this code is to create a dynamic textfield or a movieclip with values from an XML file to be added to stage as options in a drop down menu. Putting them in a text field or movie clip would allow me apply mouse events, etc. I'm a novice coder and so I'm just trying to feel out the best way I can handle it at the moment!
I'm trying to do a transition that you've probably seen many times. Transitioning one image to another using a grid of squares where each square fades at a slightly different time.I've made a complex movie clip made up of several other movie clips with all the squares fading at the rate I'm looking at. When I just play the color squares it works fine, but the minute I turn that master movie clip into a mask for the image I loose the transition/fade completely--just an on off thing.
I have a problem with arranging some thumbs in column when I resize the stage. The problem is that it is arranging the last square in line half outside the stage and you can see only a half.
How do you go about drawing only the outline of squares using drawTriangle. Currently I am using lineStyle to draw my lines but obviously that outlines each triangle. I know i can just draw Squares out using drawRect with no fill but that seems like a waste.
Now I could do with some hints as to how this should be done Hopefully someone will help me out here.
Ok, basically I have a map (a jpg/gif file), which should be divided into squares (like a chessboard). Each square has a coordinate (X, Y) and other pictures should be shown on top of a map square - like a small house or something (also a jpg/gif file).
It should also be possible to hide some (most) of the squares from view - like with a black square on top or whatever. Perhaps Flash should also make some lines between each square to divide them.
Furthermore only a part of the map should be shown through a window (using a mask, I guess) as the map could be large and buttons at the edge could be used to scroll the map.
I would like to link the red squares to the blue square in 3D with CS4 only (please no papervision or sandy...)I'm very closed to the solution but I still have a wrong z (visible when you move the mouse to a corner for instance)
So far my code takes hex codes out of tweets containing a certain hashtag, and draws a square of that hex code colour. If someone were to tweet a new set of hexcodes while you were looking at the site, you would have to manually refresh the page to see the new squares.
I'm doing a tutorial from Adobe Flash CS4 classroom in a book. They're suggesting the following: "create buttons that allow users to switch between painting ellipses and painting squares". I've created the class files for the cirlcle and the square and I've set two hot keys to switch between painting circles and rectangles(it does not work) Now I'm trying to create the buttons.
package { import flash.display.MovieClip; public class Rect extends MovieClip { public function Rect(w:Number = 40,h:Number = 40, color:Number = 0xff0000) { graphics.beginFill(color); [Code] .....
If an image is 800 by 600, copy the image's bitmap data and divide the image into, say, 20 by 20 squares, each having a reference to be manipulated later. Im guessing you have to use bitmapdata for that, unfortunately I dont know how to copy bitmapdata from an image's arbitrary x and y coordinates and for a certain width/height.
I'm trying to fill a grid with different size squares, randomly, and have no overlap. I want my grid to be 100px by 100px. I've tried creating a matrix array (10x10), holding x and y values. My square size is either 10x10, or 20x20. I loop through the matrix randomly picking a square (x,y position) and placing one of the two squares. All of this works fine, but obviously the squares start to overlap.
This is the type of outcome I'm looking for: I tried adding each square to an array, then checking if the current square placed collides (hitTestObject) with an already placed square. This eventually hits true every time, because the square placed matches the same square when placed in the array. Does anyone know of a way to accomplish this? Place each square but do not have overlap?
I put together this code that builds a container that contains boxes(squares) in an ordered way. Problem is when I rotate the container, the boxes don't stay in their order. (something to do with swapping depths I think) . In fact, they look a bit confusing. Just create a movieClip 24 x 24 and Name it Box. Create another movieClip and name this one Container. Save them in your library. Then just copy this code and compile. You know the routine.
I am wondering what that effect is called or how to achieve it where let's say I have 6 squares, 3 on top, 3 on the bottom(2x3 matrix) and where if I click one, it gets bigger, and all the other ones get smaller. The problem here is the how they get bigger. If I click the middle square in the top row, it should stay in it's position and grow where as If If I click the bottom right one, it should grow towards the far left side. I'm guessing the registration point needs to be changed dynamically?
I'm actually coding this in Java (with which I have just a few days experience), but as far as the logic goes, I thought this would still be an appropriate place. I'm making a Tetris-eque game and having trouble with rotation. Each shape (rectangle, L, "step", etc) consists of 4 or 5 smaller squares (image below), and I want to be able to rotate the pattern of squares 0, 90, 180 and 270 degrees around a designated point.
x = originX + cos(angle) * radius; y = originY + sin(angle) * radius;
I thought I understood these, but apparently not, since I can't seem to get it working� For each shape, I would declare the x, y coordinates for each of its smaller squares, relative to one another. Then, I'd send these values to a function that should take the pattern and rotate it according to the specified angle. In Java (to the best of my knowledge), the upper-left is always the "registration point" for graphics. So, I set the relative coordinates for the squares of each shape such that the left side of the leftmost square is at x = 0 and the top side of the uppermost square is at y = 0. Here's an example, the shape of a plus sign (+).
Code: //top-center x = squareWidth; y = 0;
[code]....
no rotation (just the shapes)and this is what happens when I implement the rotation adjustment.
I want to create a bunch of squares appear in a grid-like fashion but not row by row. I'd like more of a diagonal effect.
Here's the code I have so far:
[code]...
So this sort of works in the sense of it creates a vertical row and a horizontal row. But I need it to actually kind of 'wipe' diagonally across the page.
in Minesweeper, if you click on a square that has no mines surrounding it, the game will continually find all of those types of squares and the surrounding numbered squares.
I've had some trouble with this, because I either run into infinite recurrence or...well just a bunch of stuff.I've had a lot of different ideas and ways to do this...but I'm thinking:
1. If the square your clicked on is empty (no surrounding mines) put it into an array.
2. Loop: if the array isn't empty, reveal all surrounding squares, put all unnumbered squares into the array, remove squares previously used.
Code: function getAmountOfMines(square:Object):Void { var numMines:Number = 0; nSquare = _root.gameBoard["Square" + (square.getDepth() - gameWidth)];
i have many squares inside a movieclip, and i remove random some of this squares, what i need id: get the real with and heigth of my movieclip, after the squares are removed, i do a little exemplo, and anexed here,
I got 1 movieclip, in that movieclip I got 1 image in 1 layer and in other layer I got one matrix of squares. So then when I mask the image I only get only the images by squares. I am trying to had a motion so that some squares shine over the time.
I am trying to make a Grid that is equal to the width and the height of the flash movie. I have a movieclip called box which is 30x30, and want it to repead along the x to form columns and along the y to form rows so that it makes a big rectangle of smaller squares. For some reason it looks like this:
one after the other in a clockwise manner, so that they form one big enclosing square. In my script, I have a square called cell_mc that I would like duplicate instances of cell_mc to enclose to form a bounding box. I would like the duplicate instances to be drawn one by one in a clockwise direction:
ActionScript Code: // Get depth var depth:Number = this.getNextHighestDepth();
Working on a new project for a client who requested a content transition similar to the one found on this template (the moving squares one).So far, I was thinking of using BitmapData to create some squares at the required positions .
what's the main idea behind 3D in Flash. I mean, I've seen a lot of scripts to make rotating squares or triangles or whatever, but never managed to understand how they were made.
I'm trying to make a plasma fractal (as a self-challenge, I made the sierpinski triangle, Koch snowflake, Mandelbrot set, Julia set, and dragon fractal. If you want the code, PM/reply.) Here's the code of frame 1:
I'm work with PS and AI and am a begginer with Flash and currently I'm making this clean cool looking header for a server I play on. This is what it to looks like: [URL]. However I don't know how to make the small squares motion, I want them to "spawn" around the text with alpha slowly growing, not behind the text so it's clean and to move outwards and slowly disappear.
I am trying to draw a set number of squares in a grid type layout and have pretty much gotten it to do what I want. The problems is that I want to be able to manipulate each square individually later on and I'm pretty sure I need to assign each one a unique instance name.something like "square_0_0" all the way down to "square_10_10" (it's a 10x10 table of squares).how do assign a unique instance name to each square as it's added to the stage? I attached the code I currently have running.