ActionScript 3.0 :: Getbounds Producing Insane Results?

Jan 14, 2012

I'm trying to get bounds of an object for more specific testing. but it's not functioning very well.The relevant code here, with some debug outputs:

Code:
private function getCorrectionVector(object:Array, block:Array):Array
{
var ret:Array = new Array();

[code]...

The debug output from running this , is this:

Code:
GCV: Checking objects: 95.7 344.2 0.35,1.35
GCV: Checking objects: 48 48 0,0

[code]...

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Trace Array Not Producing Expected Results?

May 21, 2010

I am producing an array of numbers 1-25, shuffling and tracing the output. When I 'Test Movie' I am not getting the expected results. What I get is something like this.

[Code]...

View 7 Replies

ActionScript 3.0 :: ROLL_OVER And ROLL_OUT Producing Unwanted Results?

Jan 22, 2010

I want to create a MovieClip button that when the mouse rolls over it, it scales larger and then when the mouse rolls out of it, it scales back to normal size.If i move the mouse cursor over and out of it slowly, the animation is fine, but if enter the mouse over it on one side and out on the other side or jerk my mouse around it acts as if the EventListeners and their respective Tween code has been reversed. I have even seen on occasion the square filling the whole screen.Here's my code:(this is written from memory and not copy pasted from flash, but before you say anything, I do have the proper imports for classes in the code so I wont include them here.

Code:
var yTween:Tween = new Tween(myMc, "scaleY", Elastic.easeOut, 1, 2, 2, true);
yTween.stop();

[code].....

View 2 Replies

ActionScript 3.0 :: Button On Top Of Movie Clip Producing Strange Results?

Mar 23, 2009

So, at one time I w s fairly familliar with Flash, but I amnow returning to it I have a movie clip that Iam using AS3 to control, basically it slides out when your rolloverit and then slides out when you mouse off it. This is my code:

OPEN:
stop();
import flash.events.MouseEvent;

[code].....

View 6 Replies

ActionScript 3.0 :: Tweening - X And Y Properties Of Sprite Producing Jumpy Results

Feb 10, 2010

I'm trying to make a textfield inside a sprite zoom upon mousing over the sprite. I'm instantiating tweens on the x, y, scaleX, and scaleY properties of the sprite. The x and y tweens are needed due to the top left registration. Also, the tweens are added to an array to ensure they finish. Sometimes it works as I intended, but when I mouse over from the bottom right corner, the sprite jumps haphazardly towards the top left and back until I mouse out, instantiating another set of tweens to return the sprite to it's original state. I'm not sure what to do other than using a custom tweening engine such as Tweener. I'm using the built in tweening classes and I'm hoping to find a solution within these parameters.

View 5 Replies

Style A Flex App Without Going Insane?

May 29, 2009

Are there any libraries out there which will help me style a Flex application without going insane?

For example, is there any "accepted" way to set an element's size/position without hard-coding it into each element?

View 2 Replies

ActionScript 2.0 :: Loadvars From A Textfile Driving Insane?

May 19, 2005

i am trying to load vars from a text file into a load vars object.

var kitchentext = new LoadVars(); kitchentext.load('moccastext.txt');

Once in the object, i thought i could reference them like so

kitchentext.name
kitchentext.style

but i am having trouble doing this.

i have a textbox called displytext. _root.displaytext.text = kitchentext.name;

View 3 Replies

Flex :: Wrong GetBounds() On LineScaleMode.NONE And On The Screen Nothing Happens

Nov 9, 2009

I have write a simple example that adds a canvas and draw a rectangle with stroke size 20 scale mode none. The problem is that if I call getBounds() first time I will get a correct result but after I call scale(); the getBounds() function will give me a wrong result. It will take in cosideration the stroke but stroke has scalemode to none and on the screen nothing happens but in the result I will have a x value smaller. Can sombody tell me how can I fix this ?

[Code]....

View 1 Replies

ActionScript 3.0 :: Redraw Invalidation With ScrollRect Vs GetBounds?

Mar 24, 2011

I'm having a problem that involves scrollRect and getBounds. In short, getBounds is reporting an old value not accounting for scrollRect changes during that frame. Example:

ActionScript Code:
var shape:Shape = new Shape();
shape.graphics.beginFill(0);

[code].....

View 3 Replies

ActionScript 3.0 :: GetBounds Function - Does It Work With TextFields?

Mar 10, 2009

I'm trying to get the height of the (external) text in textfields to display them vertically on top of each other with a space in between. At the moment I am adding the textfields with predefined heights, so if item1 is 2 lines and item2 is 4 lines then there is a lot of space between item1 and item2

ActionScript Code:
var my_tf = new TextField();
my_tf.text = "Hello";
my_tf.appendText(" world!");// my_tf.text == "Hello world!"
my_tf.x = 100;
addChild(my_tf);
[Code] .....

View 1 Replies

Professional :: Settings When Producing For CD-ROM?

Feb 12, 2012

I am currently producing a CD-rom with educational content including film, quizzes, drag and drop and animation.some advice ?Here is what I am thinking so far..Stage 800x600frame rate 25 fpsIt has do have film and interactive goodness. Am I doing anything wrong so far? Film guys tells me that the film is 25 fps.Also I have production premiusm cs5.5 os is there a particular bit of software that I shoudl be authoring CD-rom with? or just make a projector file and use toast to burn it?

View 3 Replies

ActionScript 3.0 :: Rectangle.getBounds Causing An Infinite Loop?

Jul 19, 2011

I've been working on an AS3 project. One of my classes in this project is a collision object that extends MovieClip. It is used to be placed in other movie clips as hitboxes.My problem with the code lies in its hittest function. Occasionally, it causes an infinite loop that crashes the program. Flash tells me the problem lies with the getBounds function, but I don't understand why that is so. Can anyone tell me what might be wrong with it?

Code:
public function HitTest(other:CollisionShape,offsetX:Number = 0,offsetY:Number = 0):Boolean {

[code]........

View 2 Replies

Actionscript 3 :: Integer Overflow - GetBounds TargetCoOrdinateSpace Is Not Added To Stage?

Aug 19, 2010

I have two display objects dispObj1, dispObj2. dispObj2.stage is null. (i.e. it is not added to stage anyhow)What should be the output of dispObj1.getBounds(dispObj2)?Is it well defined, or could it be arbitrary?Once I got x of boundingRectangle close to 6710785, which I guess is a symptom of an integer overflow somewhere.

But other times I got a reasonable value for x,y,width,height.

View 1 Replies

ActionScript 3.0 :: GetBounds()s On Button Component Returns Wrong Dimensions?

Mar 3, 2011

So I've been building a colour picker, where you click an icon and a tooltip fades in revealing the colour picker. You make a selction and then click an "ok" button to close the tooltip(or mouse away from a couple of seconds and the tooltip closes)...Developing this was really smooth, untill I pushed the Button Component into the colour pickers containing Sprite. The problem seems to lie with getBounds. I use this to draw a background on the Colour Pickers container sprite. Now I have a button in there the first time I open the toolip I get a width and height of 250 - 100. Although the buttons dimensions are 25 - 18. The second time I click the colourPicker its getBounds() properties are correct and all is good.

If I add the Colour Pickers containing sprite to the stage before opening it then it opens with the correct dimension. Although this means the container is on stage. So I tried to just add and remove it in the one step but I get the same result as above.I'm thinking this has something to do with waiting for the button to be added to display list/stage or something but I can't work around it

View 1 Replies

ActionScript 3.0 :: GetBounds XMax - XMin - Properties Doesn't Work?

Mar 6, 2009

I am trying to adapt an As2 function to As3. It is perfect collision with 2 rectangles. (also works with rotation ) the code below works very well, but it look like some of the properties doesn't work in As3 ? (like xMin, xMax etc...). Here is what i have in As2.

[Code]...

View 7 Replies

ActionScript 3.0 :: Width/2 Producing Strange Fluctuations?

Feb 9, 2009

I'm sure this is a really basic problem and hope someone can steer me in the right direction.I have moving objects on stage all with a width of exactly 100 pixels. They're part of a collision array. I need to know their radii so I created a variable that looks like this:radius = objectName.width/2;You would think that this would result in 50. However, when I do a trace of their values in an enterFrame loop, I get a range of numbers that looks like this when the objects are standing still:

Code:
51.325
52.075

[code]....

View 2 Replies

Actionscript 3 :: OOP Not Producing Expected Result With If Statements And > Signs?

Nov 8, 2011

Below is my code:This code is used to find the surrounding nodes when supplied with a given node. i.e

for(var i:uint = 0;i < nodes.length; i++){
test_node = this.nodes[i];
if (test_node.row < node.row - 1 || tes

[code].....

View 1 Replies

Ionscript 3 :: OOP Not Producing Expected Result With If Statements And > Signs?

Jul 28, 2009

Below is my code:This code is used to find the surrounding nodes when supplied with a given node. i.e

for(var i:uint = 0;i < nodes.length; i++){
test_node = this.nodes[i];
if (test_node.row < node.row - 1 || test_node.row > node.row + 1) continue;

[code]....

View 1 Replies

ActionScript 3.0 :: Stage Accessed Differently With The GetBounds Method In An External File Than In The Timeline?

Aug 2, 2011

The following piece of code works in the timeline:

var ball:Sprite = new Sprite;
addChild(ball);
ball.graphics.beginFill(Math.random()*0xff0000);[code].....

Is the stage accessed differently with the getBounds method in an external file than in the timeline?

View 3 Replies

Professional :: Flash, Flex, AIR Which Is Best For Producing Small Interactive Apps?

Apr 28, 2010

I posted to the flash forum but really looking for feedback from flash, flex, AIR users as well.I'm looking for the forums thoughts and advice on which of Adobe's current technology set (CS5) is best suited for creating small interactive applications/packages by users who would not have any background in coding and very little interest in learning coding.

The idea is that users would know basic drag & drop development and maybe extend it to include some basic scripting to wire up elements of it. The ability to develope applications for a range of access points (website, mobile, desktop) would also an added benefit.The over arching idea would be to let the users create some apps/programmes/packages quickly on any topic they like but not bog them down with coding.Which CS5 technologies would be best for that

View 5 Replies

Flash :: Professional - Producing For Desktop - Bypass Security Error?

Aug 9, 2011

We're producing a desktop application that includes html and swf in AS3. We get the following error: Adobe Flash Player has stopped a potentially unsafe operation. The following local application on your computer or network: C:UsersDave%20ZelenkaDesktopworld-source...world.swf is trying to communicate with this Internet-enabled location: C:UsersDave ZelenkaDesktopworld-sourcesample-htmlsample.html To let this application communicate with the Internet, click Settings. You must restart the applcation after changing your settings.

So, I know how to resolve this by clicking the settings. But our users won't want to do that. What doesn't make sense is that the swf file isn't pulling anything from the Internet. The world.swf file shouldn't be communicating with sample.html, and not only that, they are located in the same folder.

[Code]...

View 11 Replies

ActionScript 3.0 :: Add An Event Listener In A Class It Keeps Producing 1046 Error

Jul 31, 2009

When i try to add an event listener in a class it keeps producing 1046 error - Type was not found or was not a compile type constant

Code:
package {
import flash.display.Shape;
import flash.display.Sprite;

[code].....

View 9 Replies

Flash :: Move Objects In An Array Producing A Stadium Wave Effect?

Jan 29, 2010

I want to move all objects in an array producing a stadium wave effect, how do i do that?I want to move the objects based on their y-value on the stage... all my squares are of 50x50 in size. I want to move them up then move them down

import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;

[code].....

View 1 Replies

ActionScript 2.0 :: GetBounds() - Get A Movie Clips Coordinate Bounds And Use The Minimum And Maximum Values Of X And Y To Draw Rectangle Around The Object

Apr 11, 2007

I'm having a little difficulty getting to grips with the getBounds() Movie Clip function. I assumed the getbounds() method simply got the boundary coordinates for the movie Clip, that one could use to draw a rectangle. This is what I'm trying to do;I'm trying to get a movie clips coordinate bounds, and use the min and max values of x and y to draw rectangle around the object. Simple right? But in my case, I'm getting some unexpected results. I wonder does ther registration point of the object determine the coordinate values? Also are the coordinate values local to the clip instance or global to the stage?

[Code]...

View 5 Replies

ActionScript 2.0 :: What Exactly "getBounds" Does

May 20, 2007

what exactly "getBounds" does? I've been reading about it and I don't understand. I learned about it from this line of code:

if (_root.walls.hitTest(getBounds(_root).xMax, _y, true)) {

(The rest of the if statement isn't important)

Also, can someone tell me how to add cheats to games? For example, if I want the game to spit out an extra life when you type "extralife", what would I do?

View 7 Replies

Flash :: Flex - Migrating A Project From Builder 4.0 To Builder 4.5 Is Producing The Error "The Required Skin State 'disabledWithPrompt' Is Missing"

Nov 28, 2011

I am trying to migrate a project from Flash Builder 4.0 to Flash Builder 4.5. After Flash Builder prompts me to choose my new SDK, I choose 4.5, Then I get the following error:" error "The required skin state 'disabledWithPrompt' is missing".

View 1 Replies

IDE :: Can't Get Results In Quiz

Mar 10, 2007

i made a quiz in flash using actionscript:

At the end I have to sum the answers and show the result to the user but I can't get it.

Here is the code (I'm kind of new to actionscript, sorry if the code it's too long):

Code:
var p1=0;
var p2=0;
var p3=0;

[Code].....

View 5 Replies

ActionScript 3.0 :: Same Page, Different Results When Different Url?

Jan 12, 2011

server the scripts it has to load from the server, but if i call it like it will not load and will get stuck. i remember there was a parameter for the player about allowing it to read only local scripts or something like that, and i plan to test it with this (or if according to the problem description, somebody else has a different theory, all is welcome), but at least in dreamweaver it does not appear the parameter for flash objects, and i dont remember where i saw that parameter or what was its name, what is the parameter to allow a flash movie to read scripts from different servers (even though the situation is kinda weird, since dnses are pointed correctly, or it would not load at all with my and how do i edit the parameters value? do i have to edit it by hand in all pages, in all occurrences?

View 3 Replies

XML :: Loop Through Results Of HTTPService

Dec 7, 2011

I'm trying to loop through the results of an httpservice, it is xml. This is how I try to do it, but this does not work.

protected function getArtistsSucces(event:ResultEvent):void {
var artistList:XMLList = XMLList(event.result);
var artistXML:XML;
for each(artistXML in artistList.artists) {
var artistName:String = artistXML.artist.name;
[Code] .....

View 3 Replies

ActionScript 3.0 :: Save Results To Xml?

Apr 15, 2011

I recently made a drag and drop game that gets users to rate a word 1 - 5, nothing fancy just event listeners that have many (many) if statements that push the selection into an array at an index.However now that I have this preference list im kinda stuck as I dont know what to do with it now.In java I could save it to a file but from everything ive read there are things to stop flash/as3 from accessing your hard drive(security issues)Basically im trying to find a a way to put this array into some sort of use such as saving them to a file on my hard drive.Also as an aside if there any good tutorials on how to make a scoreboard?ay if a player gets 3 of them 'right' they'd get 3 points and be placed accordingly.

View 1 Replies







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