ActionScript 2.0 :: Prototype - Creating Polygons Based On Array
Mar 14, 2008
Basically I have a prototype that creates polygons based on an array. works well. I then have another prototype that's supposed to create polygons using said polygon prototype.
So the below is:
1 - the polyMaker prototype
2 - an array of arrays ($arrowListB). basically each array item should be a new polygon.
3 - the problematic genArrows prototype.
What it should do is loop through the $arrowListB array and create a container clip ($cont). Within each container clip it should make a $arrowClip to be used in making the polygon (an arrow actually). It works until I get to the line after creating the movieclips:
Code:
$arrowClip.polyMaker(..arguments..)
Once I put that line in, it only makes one polygon and doesn't create the other (7 in this case) movie clips. I'm not sure if I'm just not referencing correctly or what.
[Code].....
I'm relatively new to AS3. There's one thing that I don't quite understand about Sprites. I'm making a tile based game, and all the tile graphics for a level are inside one movie clip in each frame. Would I be able to go about creating multiple sprites based on the frames in said movieclip's timeline I would I have to go through and make a separate library graphic for each.
I created a prototype function for the Array object. It's supposed to load and parse an XML file, then take all the values from the XML file and convert them to objects, which I then want to push to the array that called the function. However, I can't seem to get it to work.The function itself seems to work, but the push to the array does not. (code below)
Array.prototype.xmltoArrObj = function( path ) { var xmlurl:String = "nav/" + path + ".xml"; var attr:String = "";
I have a game with a variety of ship types. My Ship class has a static array holding one of each of the types in it. Whenever I make a new Ship (other than when initializing this array), I want to make it a clone of one of the existing Ship objects in my prototype array.
1 - How can I run through all the properties in one Ship object and assign them to a second Ship object?
2 - How can I see if a property is an object or a basic type like String or int? Some of the objects in my Ship class need to be cloned, and some are just references that need to stay the same.
Is it possible to, if you have an array of class names like ActionScript Code: var city01names:Array = ["pic_01", "pic_02", "pic_03" ...] make a new array which would read these names, instantiate them, and push them into a new array containing the instances of all these pictures, which I could then use for a slideshow?
Lines and polygons generated from a database..possible ? we have done so, that one can have e.g. spots populate a map in Flash with their positions coming from an xml feed database. The map having been drawn in Adobe/macromedia Freehand then imported into Flash.If we wish to show areas, e.g. development sites, can those areas likewise be shown from a database, perhaps the points that form the edge of the area being indicated by eastings and northings co-ordinates held in the database ? If someone alters a co-ordinate, the area then changes shape without being 'drawn' or edited using the usual tools.What of fills and alpha values, can they be controlled from a database ? If we wish to show traffic flow by having a line get fatter, can line width be altered via a database ?
I'm making a Flash game, and I've encountered a really weird problem while trying to draw a polygonal shape in Box2D.
Here's the code I use:
var fixtureDefs:Array = new Array(); ... var fDef:b2FixtureDef = new b2FixtureDef(); fDef.density = 0;
[code]....
Where vertexArray is a valid array containing 4 b2Vec2 vertices, making up a convex shape.The problem is, when I test, collisions don't work right for that body. Most other objects -enemies, user-controlled characters - pass straight through, as if the body isn't there at all. Some raycasts pass through as well.
Infuriatingly enough, one kind of bodies I have (a custom enemy) somehow does detect the body and collides with it. The raycasts that particular kind of enemy attempts do work - when your character hides behind the polygon, it's like they can't see him.The other weird thing: when I try the same code, only go for SetAsBox instead of SetAsArray, it works exactly as it should.I'm using a custom ContactListener class, but I haven't done any contact filtering (unless it's possible to do that without realising).I'm using the Flash 9 version of Box2D 2.1a.
I am looking for a easy way to convert Autocad polygons to swf files. Is there a converter for that? Or is there an intermediatory format that can be used to convert from polygons to the adobe flash swfs. Each polygon would be a swf file.
I have .ppm files which are the result of using a segmentation algorithm on images of things.These basically look like a jigsaw puzzle of randomly colored funny-shaped segments. I'd like for each segment to be selectable.I want them to change color on mouseover, so I can't just use bitmapData. getColorBounds (that's the best thing I could find searching for possible solutions).As far as I know, the best way to make a specific shape selectable is to draw a polygon using graphics.lineTo, etc. Assuming that that is true, is there any way to draw a polygon that roughly follows a jaggedly-shaped area of a certain color? Or is this just not something flash can handle?
how to reorder an array based on the information contained in another array. What my script is currently doing is detecting all the attached monitors I have and then ordering them based on their left bounds. However I then want to reorder the screens location in the array based on whether the user has selected that display or not. If the user has selected it, by clicking a button, the button movie clip will be on frame two, if they haven't been chosen it will be on frame one. So what I am doing is then creating two separate arrays, chosen screens and not chosen screens, and then combining them into one.
Code: if(displayButton.currentFrame==displayButton.totalFrames) { //sort the chosen ones into an array
[Code]....
My problem now is being able to reorder a separate array which contains all the screens, called screenArray, based off of that. screenArray currently returns [Object Screen], [Object Screen], [Object Screen], etc... and is in the order of 1,2,3,4,5,6. How do I take then and get it to be equal to the order of my displayButtonsChosen Array of 1,3,5,2,4,6?
I would like to display a SVG layer (polygons) over the openlayers tiles in a HTML page, or alternatively, load my SVG in flash and have the OL tiles rendered into flash as well.
I have an array called dropTarg1 which stores dropped-in items.I want to loop through this array and in a textfield, display each array item on a new line of this text fieldI think I need to use something like Array.join("/n") but I can't get it working properly. I hope that the /n would create a new line of the text field called reviewBoxContentText.
I have to create dynamic content based on content uploaded to site and I need to know best tools for this.In a nutshell. User uploads images. Images embeded into existing video and animated. New video produced for download So far I have looked at Flash Media Server, Flex etc but not sure what the best tool is for the server side production of content. I know I can produce the custom MXML and AS files based on content uploaded and using the Flex SDK I can render these into a SWF. What I don't know is if There are limiatations to this in the context of what I want to achieve For instance can a product like Flash Media Server do something similar.Transcoding is also required hence the interest in FMS.
I have an image with seven distinct colors. I would like for each color to be linked to a separate html page if clicked. Can flash link to a page based on the color of the area clicked?
I would like to create a demonstration through a web browser of our phone application. I can us Flash to create the demo but I want to avoid using Flash for compatibility reasons. I was thinking I could use HTML + CSS + JS. I want to know if anybody else have experience with this. I am open to the idea of using HTML5 but need to be pointed to the right direction to research.
What I am trying to accomplish is creating a flash based form. Basically a form that people fill out if they want to book an event. so there would be several fields to fill out. Name, Date and Time of Event, Contact Number, ect. there would be text fields to fill out and combo boxes. I just want a simple form where people fill out that info, it makes sure that everything is filled out before submitting. then when you submit it, it sends the info to a master email... where we can check it and get the info. does any one know of anything similar that i can use as reference to help me accomplish this?
I have a simple xml/flash portfolio script (similar to the one in the xml/flash) tutorial and the problem is my pics are not uniform in size. This is probably an easy problem but how would I get flash to create a mc getting the size from either the xml (manually put it in the xml) or automatically get it from the jpeg?
I'm currently working in Flash mx 2004 and am creating a version of 'what happened in history today'. So my final layout will have the following iobjects.
Heading: 'current date' Title: 'On this day in History' Text box: Which displays the right description from a text file. history.txt Image box: which displays a pic related to the current date.
I know basic Flash but have been playing around for ages am having real trouble getting things to work correctly. The main priority is to get the text loaded based on the current date. I have an images folderwhere the pictures are stored with files names related to date i.e. 14feb.jpg and my history.txt file is set out with a line for each date. i.e., 14feb=Valentines Day etc.
I'm trying to make a little program. It works right now by drawing the top shape to the dark gray area, where it then copies itself and changes color. The new shape can be re-dragged as well. What I want to do now is add a dynamic border when I click on the new object, I want the box to adjust to an appropriate size. And on mouse release I want the selection border to disappear on the new shape. I want the selection border to be dashed much like you find in many of Adobe's programs, if at all possible. Attached is my .fla file
In a nutshell, the swf contains four ads (which link to portions of the site) and each ad uses the Timer element, displaying it for 5 seconds before moving on to the next one. Everything has come together nicely (although I'd like to clean up the code and use classes at a later date - I'm currently taking AS training from Lynda.com).
What's giving me trouble right now is the navigation bar. What I want to do is create four numerical buttons that a) change color during a mouse roll over b) change color for a corresponding ad (for example, when the third ad displays, the number "3" changes from white to gray to show that it is active and goes back to white when the fourth ad comes up).
Right now, I'm at a loss as to what to do. I've tried making the numbers buttons, but I can't control color changes unless I create two sets of buttons: one with white numbers, one with gray numbers.This also makes for some really bizarre Actionscript coding ideas (ex: after I code the function for the gray nav buttons, I have to code functions that make the white buttons work - but this ends up screwing with the ad cycles). I tried making them as movie clips, but I lose the ability to assign a large hit area like I can with buttons.
I have created some code in Actionscript 3 following various tutorials which is a simple media player linked to an XML file for the source information.I have found out though I need to use actionscript classes for the code and wondered is their a way to convert it to classes or does anyone know of a tutorial in actionscript 3 for creating a media player based on classes? My code is below:
I want to create an static drawing (say any animals like giraffe) using some points, lines, drawing etc. Now i want to update the drawing by passing the parameters say height of his legs, its width or its color.The parameters are supplied from the web page. The image will be a 2D image.I am searching on which technology should i implement this for more than 10 hours but cannot find any perfect solution.Right now i am thinking i can use Adobe flash in which i can do some programming to create an drawing and change the drawing by passing the parameters to a Flash file, i think we can pass it when we embed an flv.
I have an array, crewPositionsAC that contains a list of position abreviatations - EP, PR, DR, WR, and so on. These positions are read in through an XML file each time my flex application loads. Also being populated from an XML is a project. Within a project, there are positions (a student assigned to a type of position listed within crewPositionsAC). These positions are not necessarily in the correct hierarchy order dictated by crewPositionsAC. I have all the positions within an ArrayCollection (positionsAC) with the following structure:
Then, the user can click a button to add another position. When the "Add Crew Member" button is pressed, the user is presented with a list of possible positions to add. Currently, I simply add another array to positionsAC. This results in the recently added crew member to placed on the bottom of the list. I need to take positionsAC and reorder it based on it's [2] item (role) based on the hierarchy defined in the crewPositionsAC. crewPositionsAC has the following structure:
crewPositionsAC: [0] = EP [1] = PR [2] = DR [3] = WR
* continue until all possible position types are listed
Is there any opensourse, free set of components for creating Flex mxml graphs? like aviary Peacock style ones with at least Drag, drop, and connect generators so each graph element could have or something like that. Framework should be opensource (like GPL, LGPL etc) BTW: I found one wary bacic made by Erno Aapa with Degrafa but I would really love to see something much more Flex 4 - mxml oriented and frienfdly.
So I figured that the last idea I had would not work, but I realized that if I attached each seperate background image from an array to a css element that, that would indeed work.
I have a project that was dumped on my lap, and my knowledge of Actionscript is very limited.
The scenario is that the user is presented with a floormap of a building that should show a red dot denoting where each employee sits (based on X,Y coordinates on the floormap).
The employees' profiles (name, telephone, X/Y coordinates) are stored in a database.
One our our programmers managed to load the users into a Flash object array. Now, it's my turn to add some actionscript to place a red dot on the floormap for each and every user in that array based on their x/y coordinates.[code]...
i have a simple array, for example: ( 50, 20, 60, 30, 10, 8, 15, 25) but need to output it in ascending numerical order ( 8, 10, 15, 20, 25, 30, 50, 60 ). Any one have a handy code snippet to do so?
I have a xml file in which I'm pulling in a thumbnail image into a array and I'm trying to populate a moveclip and then duplicate it accordingly below it with correct spacing
heres the code I have:
ActionScript Code: var thumbs:Array = new Array(); var myXML:XML; var myLoader:URLLoader = new URLLoader();
I just make a grid based on array... my problem is how to highlight boxes that contain only character I mean if the box contain character it will gotoAndPlay(2)...eg:[code]