Actionscript 3 :: Reference Rectangle/geometry Objects In Flex 4?

Sep 14, 2011

I'm doing an geometry object tranformations for a project. I need to have same rectangle across 4 parts in a screen. So when i change one rectangle others will be transformed like scaling or something.So i was able to do this with image, just giving "source" attribute. How to do with geometry objects?[code]

View 1 Replies


Similar Posts:


Flex :: AS3 - Removing Objects By Array Item Reference

Jan 2, 2010

I am trying to add some Sprite objects as the contents of an array, and I would like to be able to "clear" them from the stage. I would assume that if there are loaders involved, I need to do
_imgArray[i].close();
_imgArray[i].unload();

And if I am using a sprite, I can do:
removeChild(_imgArray[i]);
None of the above work.

Currently I try:
for(i = 0; i < _localXML.length(); i++) {
var tmp:BMLink = new BMLink(_localXML[i], _bw, _bh, i);
_imgArray[i] = tmp;
_imgArray[i].x = (_bw + _mainpad) * i;
_base.addChild(_imgArray[i]);
But this doesn't work.

The class instances that are populating the array are all extending sprite, but they have their own individual loaders inside w/ progress events etc.

View 2 Replies

Flash :: Flex - If An Object Is Garbage Collected Are The Reference Counters Of Objects It References Decremented Automatically?

Jun 20, 2011

I was thinking about Flash GC the other day and came up with a question about how reference counting would work in the following 4 class scenario (assume GuiMain is the movie's document class):

[Code]...

View 4 Replies

IDE :: Passing Geometry Data To And From Flash?

Jan 12, 2009

Goal: To build an Internet Mapping Site (IMS) using FlashScenario: Using Manifold GIS for the backend. It is a full scale GIS software which easily outputs data (geometry and tabular) into xml. It has built in IMS capabilities, but theWould like to build an IMS using Flash as the front end, and Manifold as backend. How would I set up something where the GUI and display were Flash, the user interacts with the Flash (Pan, Zoom, Selection, Query(SQL)), have Flash fetch that from Manifold via xml, and display the new extent, query results, etc.?

So there would need to be geometry data retrieval and display as well as tabular. For example the user should be able to use a "Zoom by Extent" feature where they draw a rectangle on the map, it returns the coordinates of the box to Manifold, Manifold returns it, etc. On the other hand they need to be able to query the datasets (simple sql queries).I hope this makes some sense. I'm a noob in many aspects to backend so I'm just trying to get a handle on whether this is possible, and what backend needs to be implemented in order to make this happen? Would you know of a possilble better method? Silverlight, etc?

View 1 Replies

ActionScript 2.0 :: Geometry Wars Game - Preventing Lag?

Oct 25, 2010

I am currently creating a remake of the game Geometry Wars but in Flash using AS2 but the further you get through the game it seems the more lag builds up. And it is down to my computer (which does suck) but it's been tested on multiple pretty good PCs. It lags when a lot of enemies enter the screen but to be fair there isn't a lot. Here is my game which I am currently blogging to get feedback : geowarsbeta.tk <- with http at the start.

Stuff I am doing to prevent lag:
-Enemies are not visible when offscreen.
-Unwanted movieclips (like bullets) are deleted once offscreen.
-Main ships 'onEnterFrame' is split up in to lot of small functions.

View 2 Replies

Actionscript 3 :: How To Reference Objects

Sep 9, 2011

[Code]...

I've learned it reading a tutorial over internet, but I want to know where I can find more samples on how to reference objects in AS3. For future codes, I want to add hitTest and the like.

View 3 Replies

ActionScript 3.0 :: Reference One Of Many Objects?

May 21, 2010

How do you guys reference one of multiple objects? Every recent project of mine winds up having a bunch of items pushed into an array, and I find out which one to manipulate like this:

Code:
function myFunction():void
{
index = e.target.name.slice(5,7); // object is named "item_1"
myArray[index].x += 5 (or whatever);
}

View 8 Replies

Flex :: Create Weak Reference And Strong Reference?

May 6, 2010

package uk.co.bigroom.utils
{
import flash.utils.Dictionary;
/**
* Class to create a weak reference to an object. A weak reference

[code]....

In this Class, how they denote one as Weak Reference and one as Strong reference.

View 1 Replies

ActionScript 1/2 :: Build Many Algebra And Geometry Equations In Flash?

Apr 18, 2006

I have a need to build many Algebra and Geometry equations in Flash. I am looking for some kind of flash plugin that will typeset these equations so that I don't have to build them by hand. For instance, if I had a fraction 1/2 or 134/489 and I was stacking the numerator over the denominator, the fraction line would adjust to the length of the longest number.

I know that the InMath plugin works like this for InDesign, but the formatting breaks in the few file types that are able to be imported into Flash. Is anyone aware of such a plugin made specifically for flash?

View 3 Replies

ActionScript 3.0 :: Vector Class Containing Flash.geometry.Points?

Aug 29, 2010

import flash.geom.Point; I am trying to write a game using the new Vector class.  Then Vector will  be composed of flash.geom.Point (s). However, when I try to use the concat funtion to return another vector with a series of Points added to the end of the vector, I will get: TypeError: Error #1034: Type Coercion failed: cannot convert flash.geom::Point@bce8901 to __AS3__.vec.Vector.<*>. at Vector.<*>$/castToThisType() Action script is saying that I am trying to convert a vector to Point to a vector.  I do not see how this is the case. In the example below, I have declared adjoiningPoints to be of:var adjoiningPoints:Vector.<Point>;
 
When I call path.concat( myNextPoint );  I get the above error.  In order to troubleshoot  the problem, added the additional lines declaring 'iAPath'.  When I work with the arrays everything works fine. The arrays are entirely populated with points and there is no error.

[Code]...

View 4 Replies

ActionScript 2.0 :: Change Geometry To Something Exported From Maya Using Collada

Aug 9, 2009

how to change the geometry to something exported from maya using collada but the problem lies when i rotate the object. the cube rotates just fine but any toher geometry that isnt a perfect square gets all fecked up when you rotate. as you can see from the shape i have currently the top and bottom rotate just fine. im guessing it has to do with the math.cos and math.sin but really not sure.

View 0 Replies

ActionScript 3.0 :: Objects Pass By Reference?

Mar 16, 2012

var obj:Object = null;
recursionTest(0, obj);
trace("obj: " + obj);

[Code].....

View 3 Replies

ActionScript 3.0 :: Reference Objects On Stage?

Oct 9, 2010

How can i reference objects on stage so i can push them into an array using a loop?[code]...

View 2 Replies

Actionscript 3 :: Scrollbar With Sprite And Rectangle Won't Move Text, Just The Rectangle It's Painted On?

Mar 8, 2010

For those of you still with me, I am tasked with making some scrollable content in Flash. Load in a TextFile using LoadURL(), then display it. To get the text, we've written our own class TextFieldExtended, which is basically just there to give the textfile location to the constructor and then have the class do the various steps of getting it and loading it for you.So I needed to get a Scrollbar, which I got hereThe thing is, it works with Sprites.After trying to get it to accept TextFieldExtended, I bumped into a block, since the scrollbar relied heavily on a Sprite property that TextFieldExtended didn't have or could have.

So I tried adding the TextFieldExtended instance to a Sprite instance using addchild.A problem occurs here that I do not know how to handle. It seems that a Rectangle is drawn and the Text is drawn on that. I say this because the scrollbar moves the Rectangle up and down a bit, but the text doesn't scroll, just the Rectangle it is positioned in and the text then moves along with it.My question: can this be fixed, or is does this implementation of scrollbars need a lot of adaptations before this is possible?

View 1 Replies

ActionScript 2.0 :: Build Some Array That Describe The Geometry Of Each State Mask?

Dec 4, 2006

I think I could build some array that describe the geometry of each state for each piece of the mask, then use the Tween class to change them interactively, but I'd like to do it in a more simple way...

View 10 Replies

ActionScript 2.0 :: Collision - Character Shall Stop Movement If He Hits A Geometry

Aug 7, 2008

am pretty new to Kirupa and Flash. I have a little problem, concerning a character hitting a wall. What i have: a char that can jump and move around by the arrow keys. What i need: character shall stop movement if he hits a geometry. But being able to start movement again, besides through the geometry. I'd like to reach this with gskinners CheckForCollision class. Have a look here: [URl] But i didnt manage my code to get it work. So maybe you could leak me some information on how to get this done. Heres my code so far:

[Code]...

edit admits: so far i have a character mc called "player" and one called "level". i would apply the code to the player, and it would be cool to have the possibility to check collision of the player with multiple MCs, not only the level.

View 2 Replies

ActionScript 3.0 :: Remove Objects From Memory By Reference?

Dec 2, 2009

I am creating a generic button that will remove items created dynamically in a movie clip container from memory (not just from the display list).

To track which item the user has selected for deletion, I have a click function that stores the name of the clicked object in a variable called objName. I then store a reference to the object itself in another variable called targetObj. I can then easily remove the object from the stage like this[code]...

View 3 Replies

ActionScript 3.0 :: Reference Objects In Multiple Scenes?

Sep 26, 2011

How do you refer to specific named instances of objects (buttons, movie clips, text fields, etc.) in different scenes? I made two scenes with button1 on scene 1 and button2 on scene 2. My code is below. The button2.addEventListener line gives the error "cannot access a property or method of a null object reference." Removing that line removes the error and button1 switches scenes. What's the proper way of referring to button2?

package
{
import flash.events.Event;
import flash.events.MouseEvent;

[code]....

View 2 Replies

ActionScript 3.0 :: Making A Reference Array Of Objects?

Jan 20, 2010

I want to loop through an array of map tile coordinates, place a tile on the stage for each coordinate, and put a reference to each tile instance in a separate multidimensional array called mapRef, where the tile instances can later be referenced by their coordinates in mapRef. Is this line (excerpt from the code below)... Main.mapRef[i][j] = mapTile;.[code]

View 3 Replies

Draw Rectangle Should See Little Bold Circle To Indicate A Perfect Rectangle

May 20, 2009

I draw a rectangle i should see a little bold circle to indicate a perfect rectangle, I seemed to lost mine, can somebody please tell me how to get it back!

View 2 Replies

ActionScript 3.0 :: Reference Objects On Stage / Frame From Document Class

Jun 8, 2011

I'm trying to reference objects on the stage in the current frame from a document class in Actionscript 3 in Flash CS3. In this example, I'm trying to get at a dynamic text field with the instance name "question_txt", but there are also buttons and other things I'll need to get at to put event listeners on and such.

I have "Automatically Declare Stage Instances" checked in the publish settings, so the references should be there -- in fact, if I try to declare them in the class, I get errors about a conflict with the name -- but when I try to reference these objects (in any of several ways I've now tried!) I always get Null.

package {
import flash.display.MovieClip;
import flash.display.SimpleButton;
import flash.display.Stage;
import flash.text.TextField;
import flash.net.navigateToURL;
[Code] .....

View 3 Replies

ActionScript 3.0 :: Adding Objects To Array - Null Object Reference

Apr 1, 2009

I'm having trouble with my code. I keep getting this error
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Test_fla::MainTimeline/frame1()
I believe it has something to do with the array, considering it works when I remove the array stuff. What I'm trying to do is to be able to move objects through an array with my gravitate() function in the Grav Class.

stage.addEventListener(Event.ENTER_FRAME,onLoop, false, 0, true);
for(var i:uint=0; i < numParticles; i++){
var p:Grav = new Grav(5, 0xff0000, Math.random()*250, Math.random()*250);
addChild(p);
particles.push(p);
} function onLoop(evt:Event):void {
//for(var i:uint=0; i < numParticles; i++){
//particles[i].gravitate(1,1);
//}}

View 2 Replies

ActionScript 3.0 :: Convert Rectangle To Curved Rectangle?

Aug 2, 2011

I am trying to convert a rectangle(actually multiple rectangles) to a curved rectangle. I think it should be pretty easy but I guess i am stupid. Basically I would have a start position and stop position (many of these), and they would be converted to curved rectangles and follow in a cicrle around.

View 0 Replies

ActionScript 3.0 :: Creating A Rectangle Inside Of A Rectangle?

Jun 26, 2010

I would like to create a rectangle inside of a rectangle, starting approximately 15% inward from the right side of the other rectangle.

I know how to create rectangles with:

Code:
var newHotRect:MovieClip = new MovieClip();
newHotRect.graphics.beginFill(0x00FF00);
newHotRect.graphics.drawRect(0, 0, 100, 100);
addChild(newHotRect);

But how would I make another rectangle on top of that (the black one pictured) that is approximately 15% from the right?

I toyed around with .right, and .bottomright with no success. Can anyone lead me in the right direction? or even finding the x and y of the upper right or bottom right side of a rectangle?

View 10 Replies

ActionScript 3.0 :: Rectangle To Rectangle Collision Response?

May 20, 2011

how to respond when a rectangle hits another rectangle? I already know how to detect the collision, I just don't know how to respond to it. I'm just trying making a simple side-scrolling platform game where I have platforms I can walk on and bump against on all sides. I have searched everywhere and just can't find the tutorials I'm looking for.

View 6 Replies

ActionScript 3.0 :: Error #2174 (only One Download, Upload...) With Two File Reference Objects?

Jan 11, 2010

I've got a situation that involves error #2174. Flash 10 apparently doesn't allow more than one upload/download/load/save at a time, but my code doesn't actually do that. A skeleton:

ActionScript Code:
private function uploadFile(endpoint:String):void
{

[code].....

View 4 Replies

ActionScript 3.0 :: Unable To Reference Child Display Objects Of Clip Imported From Library?

Jun 17, 2009

PBar contains two SimpleButtons (pBarProgress and pBarLoaded) and a MovieClip (pBarBg).I import pBar from the library like this:private var pBar:PBar = new PBar();and add it to a container MC on the stage like this:containerMC.addChild(pBar);Up to this point, everything works great. I can see pBar and its children on the stage when I run my movie. But then I want to start referencing and manipulating pBar's child objects, but nothing I do works. Ive tried ...pBar.pBarProgress.scaleX = 0;var pBarProgress:SimpleButton = Bar.getChildByName("pBarProgress") as SimpleButton; pBarProgress.scaleX

View 1 Replies

Flash :: Methods To Objects Inside A Movieclip With Reference To Frame Label/number?

Mar 14, 2011

there is a movieclip named movie with instance name movie.Inside this movie there is a textbox in frame 1.I want to give properties and methods to that textbox.

View 1 Replies

Flex :: How To Rotate Drawn Rectangle

May 18, 2010

I wrote the following code for drawing a rotate rectangle
var s:UIComponent = new UIComponent();
s.graphics.lineStyle(1, 0x0000FF);
s.graphics.drawRect(50, 50, 200, 200);
s.rotation = 30;
template.addChild(s);
Where template is a canvas. Its rotate nicely but the problem is the position is not in right place. i.e. it is not in (50,50) after rotate.

View 1 Replies

Actionscript :: Draw Rectangle In Flex 4.5.1?

Sep 20, 2011

[code]...

Basically this is not working. I used this question to improve - still nothing.Why doesn't this Flex App draw a simple rectangle?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved