ActionScript 3.0 :: Shouldn't LocalToGlobal Leave The Co-ordinates Unchanged?

Jan 12, 2009

I've got a clip on the stage at (100, 100) and I execute the following code:

[Code]....

Given that circle1 is on the stage, shouldn't localToGlobal leave the co-ordinates unchanged? I think the result of its call is wrong!

View 2 Replies


Similar Posts:


Keep Image Size Unchanged When Fullscreen Swf Movie?

Aug 28, 2010

I am including a image on SWF file (using Flash CS4) i want images to keep its original dimension whether user fullscreen the SWF movie or play it on windows.

currently i do not have any action script or coding on my .fla file. when i publish the movie and fullscreen it, the image i put in fla file get all stretched out and blur.

View 1 Replies

Flex :: LinkButton: Keep Style Unchanged On Mouse-hover

May 31, 2011

I want a LinkButton's style to stay unchanged when the mouse hovers over it. (But I still want the tooltip to work.) How do I do this?

(The mouseOver event seems relevant, and I do a noop() on that event, but my goal is to leave the style unchanged rather than do something specific.)

By the way, I am using a non-default style, defining it with CSS in the MXML.

View 1 Replies

ActionScript 3.0 :: ComboBox With TextWidth Unchanged Whatever The TextFormat Style Applied?

Feb 13, 2012

I'm trying to autosize my combobox, according to the textWidth of its biggest items. I've got the right textWidth without setting the textFormat, but by setting textFormat, with a bigger font size (like 30), the textWidth stays the same !

Code:
var myFormat : TextFormat = new TextFormat("Trebuchet MS", 30, 0x0000FF);var myCbx
myCbx= new ComboBox ;
myCbx.x = 0;

[code]...

View 2 Replies

ActionScript 3.0 :: Sound Playing When It Shouldn't Be?

Dec 4, 2010

I have a game of you controlling a rocket and avoiding walls.When you hit the walls the rocket goes to frame 50 and plays an explosion sound and an animation then the playhead stops at frame 70.But for some mystical reason when the rocket is still moving (as in not blown up yet) the sound keeps repeating over and over. I placed a trace in the rocket's enterframe event to check its currentFrame but it stays at frame 1 like it should. And yet the sounds still keeps playing. This is just infuriating.

View 1 Replies

Actionscript 3 :: Shouldn't Extend A Class And Is It Valid For MVC?

Dec 15, 2010

I am considering using class extension as a way to connect my model with my controller. I tried looking on the internet but could not find any information on this topic. This led me to the question of when a class should be extended and for what reasons.

[Code]...

View 2 Replies

ActionScript 2.0 :: NodeValue Returning Null When It Shouldn't?

Oct 4, 2010

Having to do some as2 with an ancient system, and am far from fresh on it. I've managed to bungle my way through most of it, but I've hit a strange logic problem.

Code:
trace(this.firstChild.firstChild.firstChild);
trace(this.firstChild.firstChild.firstChild.nodeName);
trace(this.firstChild.firstChild.firstChild.nodeValue);
produces:

[Code]...

View 3 Replies

Position Item Using X And Y Co-ordinates?

Apr 26, 2009

allowing a user to enter there own x and y co-ordiantes and then a rectange gets position in the x and y co-ordinates declared

View 4 Replies

IDE :: Set The Co-ordinates Of One Object Relative To Another?

Jun 28, 2009

How should I set the Co-ordinates of one object relative to another?

Eg: Balloon, Monkey

If I need the Monkey co-ordinates fixed relative to the Balloon only and my Global or Stage Co-ordinates fixed at the Top - Left hand corner should not affect my Monkey's movements.

i.e Monkey's co-ordinates computed with respect to Balloon's only.

View 1 Replies

ActionScript 2.0 :: Positions Of MC (x And Y Co-ordinates)

Jul 20, 2010

I have 52 (pack of cards) movieclips on stage all turned invisible When selected they turn visible. and need to display in one of five set positions (e.g. x and Y co-ordinates). If the first slot if full the card should be displayed in slot two. IF slot two is full the next dard displays in slolt three. I card two is then removed and a space left the next card chosen should go in there.

View 3 Replies

ActionScript 3.0 :: Imported Text Strings Have New Lines Where They Shouldn't?

Nov 28, 2009

Using AS3 in flash CS4Hi i have some imported text from a tab delimited/seperated text file (.txt).I have split the values into an array using  .split('') .split(' ')I have stored the imported data into an array where each column has a new index and the properties of each row can be gained from array[n].property. For example array[4].name would give the 'name' of the 4th entity in the original text file.This all works fine however some of the separated strings are formatted incorrectly as they take up 2 lines instead of one.The first string in each line in the original text file is imported into flash with a new line above it. I.e: "Property1" in the original tab delimited/seperated text file is stored in flash as "Property1" with a new line above it. I need to get rid of this new line in order to appropriately display the text in text fields.

View 5 Replies

ActionScript 3.0 :: Creating Infinite Amount Of Sprites (shouldn't)

Nov 6, 2010

In my project, there is a Movie Clip with the title 'box' For some reason, this is creating an infinite amout of children(b), instead of just one. This is my code:

[Code]...

View 1 Replies

ActionScript 3.0 :: Button Makes Movieclip Bigger When It Shouldn't?

Aug 28, 2009

If I add the button component to my movieclip it makes it bigger, as if there's some sort of invisible padding or margin around it. Making a new fla, dragging the button component, and setting the below code as the document class produces a trace of w: 320, h:250 when run.Removing the mc.addChild(btn) line gives me a trace of w: 320 h: 240.The button isn't even close to the edge of the movieclip, so why is it expanding the movieclip's height by 10 pixels? I've been reading the documentation for the last few hours, but I can't find some hidden margin style or anything of the like I've been missing. The FLA & .as file are available here http[url].....

ActionScript Code:
package
{
import flash.display.*;[code].....

View 1 Replies

ActionScript 2.0 :: [FMX] OnEnterFrame Calling Function That Shouldn't Be Called

May 16, 2004

I'm making a game, and it has an onEnterFrame which checks each players status (hp and turn), and decides what to do based on that. Looks like this:

Code:
_root.onEnterFrame = function(){
if(enemy.HP>0){
if(hero.HP>0){
if(hero.turn==0) {

[code]....

So this works fine when it's the players turn. But when it's the enemy's turn, the enemy simply attacks a bunch till hero.HP<0 and enemy wins. I am certain this is because it's checking each frame to see if it's the enemies turn and then it executes the hitting code before the turn is changed (which must mean this is freakin fast, so cool, but not good for me here!).I tried simply making a function to call at the end of the attack, with a function that happens only on first turn to let the player initiate, but when then the hero makes no attack, enemy attacks and there is a recursion error and it shuts down.

View 5 Replies

ActionScript 2.0 :: OnEnterFrame Calling Function That Shouldn't Be Called

May 16, 2004

I'm making a game, and it has an onEnterFrame which checks each players status (hp and turn), and decides what to do based on that.[code]So this works fine when it's the players turn. But when it's the enemy's turn, the enemy simply attacks a bunch till hero.HP<0 and enemy wins. I am certain this is because it's checking each frame to see if it's the enemies turn and then it executes the hitting code before the turn is changed (which must mean this is freakin fast, so cool, but not good for me here!).I tried simply making a function to call at the end of the attack, with a function that happens only on first turn to let the player initiate, but when then the hero makes no attack, enemy attacks and there is a recursion error and it shuts down.

View 5 Replies

Flash :: Converting 2d Co-ordinates Into Isometric Ones?

Jul 25, 2011

Am updating a 2D game I made to have an isometric view, problem is am having issues when converting the 2d coordinates of given movieclips into isometric ones. The way I converted my game into an isometric one is just by rotating rectangular graphic 45 degrees and increasing its width such that its 2 times the height.I having problems converting all my 2D coordinates into isometric ones.Is there a function to convert them, or a mathematical formula I could use? by the way the game am making is not tile based, so functions that use tiles to convert the coordinates are not going to work unfortunately.

EDIT: I managed to fix it, I just changed the alignment to be the upper left corner, i.e. though the game is isometric and has a demimonde shape, I imagined that it is contained in a box, and that box's upper left edge is where it is aligned...this way both x and y coordinates r the same ones in both 2D and "isometric" view.

View 2 Replies

ActionScript 3.0 :: MovieClip Co-ordinates And Surface?

Apr 22, 2010

There is something i do not understand, i'm making a Tetris like game and i want borders (limits) but when put an height and width to my MovieClip nothing appears.

Code:
public class Thugtris_V2 extends MovieClip
{
var ts:ThugtrisShapes;//ShapeManager.GetInstance().CreateShape(ThugtrisShapes.RLSHAPE);[code]....

I have second problem, i check my coordinates of my dropping shapes and my shape disapeared from the screen,fell completely down, and it's last coordinates were : pos = (x=-6, y=371).My bottom is suppose to be at 440? The entire screen does not "measure" 400 pixels? How can u get a negative coordinate,are'nt the coordinates suppose to be like texture coordinates, only positive and (0,0) is at the top left corner?How do u measure the pixels limits of the top DisplayObject? How are the coordinates actually "setuped"? Like cartesian but only the upper part?

View 5 Replies

ActionScript 2.0 :: Tween Movieclip To Set X And Y Co-ordinates

Nov 7, 2010

I am hoping to tween a movieclip from the outside of the stage to the centre. I have been trying but am unable to get it to stop in the centre. Attached are my files that I have been working with.

View 1 Replies

ActionScript 3.0 :: Coping With Display Co-ordinates?

Feb 8, 2010

Lets say you have a sitation where you have

Code:
stage
--container1 {30, 30}

[code].....

View 1 Replies

ActionScript 2.0 :: Changing X Y Co-ordinates Of A Level?

Jun 20, 2011

Is it possible to change the x y co-ordinates of various levels within a movie.I havecreated a movie that references a lot of other movies on different level and loads them when required, from buttons etc. I have since created another movie that is basically border/interface around the original parent movie. The original parent movie loads exactly where I want it to, but the subsequent movies still load with x:0 y:0 so they are all out. I figure the easiest way would be to change the x, y co-ordinates of the levels in the riginal parent movie but I can't seem to find a solution.

View 3 Replies

ActionScript 3.0 :: LocalToGlobal Way Off Y Is Right / But X Is Right

Feb 16, 2010

I have a bunch of enemy ships in a container on the stage.I am moving the container around every second and I'm creating bullets that the enemy ship are firing.So I need to have the bullets get created on the stage where the enemy ship is located currently so I can have it y-- on an enter frame event.The Y coordiantes are accurate but for some reason the X coordinates get scaled across the screen. So the first enemy ship is only off by 10 pixels or so, but the 2nd ship, the bullet gets created about 50-60 pixels over to the right.Is there any reason why the Y would be right but the X isn't?[code]

View 1 Replies

ActionScript 1/2 :: If Transform The Movieclip, Textfield text Shouldn't Resize

Jul 15, 2010

In flash actionscript3.0 Now we have one problem with speech and thought bubbles.
 
we want to transform the movieclip inside the textfield. if transform, textfield  text shouldn't resize.

View 1 Replies

ActionScript 3.0 :: Shouldn't Variables Reset Each Time The Frame Plays

Sep 16, 2010

In my flash program I have everything on one frame. In the actionscript on that frame, I made a variable called currentButton and set it to the first button, to keep track of which button is currently pressed. In the click function this variable is changed to whatever button was clicked.Now, I didn't think this would work, because seeing that the one frame is being played over and over, (there's no stop() command in there) I thought currentButton would keep being reset every frame. To my surprise, it worked just fine. Not that I'm complaining, but I'd like to know why it's doing that. Shouldn't all the code on the frame be done every time the frame is played, including the part that sets currentButton to button1?

View 4 Replies

ActionScript 3.0 :: Draw A Square In Flash If Co-ordinates Are Is In XML?

Oct 14, 2008

How it is possible to draw a square in Flash if co-ordinates are is in XML?

View 3 Replies

ActionScript 2.0 :: Attach Movie - Co-ordinates Not Recognized

Aug 8, 2010

I've set a movie to appear in my flash library using attachMovie. In the movie(Red), on release of a button there is a command that removes the movie Red/game_mc from the _root and code to make it an new file. I've given co-ordinates to other clips loaded in this way and they appear where they should.

[Code]....

The _root.game_mc being removed is an instance of a different movie clip loaded earlier. The problem is that the clip that loads at the origin (0,0) of the main document rather than the _x and _y co-ordinates from the clip.

View 4 Replies

ActionScript 3.0 :: LocalToGlobal - Access Just The X Or Y Value?

Feb 20, 2009

function traceCoordinates(event:MouseEvent):void {
var clickPoint:Point = new Point(square.mouseX, square.mouseY);
trace("display object coordinates:", clickPoint);
trace("stage coordinates:", square.localToGlobal(clickPoint));
}

i just want to find extract the .x value? clickPoint.x does not work???

View 2 Replies

ActionScript 3.0 :: LocalToGlobal : How Does It Work

Dec 14, 2010

I have a some objects of same class type prgramatically generated on the stage.Inside these objects which are generally at x=300 on the stage is the code:

Code:
this.x+=2.3;
trace(parent.localToGlobal(new Point(this.x,this.y)), ", ", this.x , " ", this.y);
A sample of the trace output is as follows..
(x=2.3, y=0) , 2.3 0

Now im expecting some values in there somewhere to indicate its absolute location on the stage, ie, x=300.This isnt happening.Whats the correct syntax i should be using.Bare in mind these object will be of any name on the stage and will be dynamically created so its not easy to just reference their mc names.

View 9 Replies

ActionScript 2.0 :: How To Use LocalToGlobal Scope

Nov 5, 2006

i am teaching myself how to use localToGlobal(), and i seem to be running into a scoping snag, at least i THINK it is a scoping snag. So when i use Code:

[Code].....

i get the desired effect, yippee. That is to say, the output says 299, which is what the global coordinate of the movie is. However when i try use the same code in the main time line like this

[Code].....

View 3 Replies

ActionScript 3.0 :: LocalToGlobal Not Working?

Mar 1, 2012

Here's what i have:

Code:
for(var i=x; i<y; i++)
{

[code]......

View 8 Replies

ActionScript 3.0 :: Shouldn't The X Increment Display Each Time It Happens, Showing A Constant Animation?

May 18, 2010

I'm absolutely new to AS and wondering why this doesn't move the way I'd like it to...Logically, shouldn't the x increment display each time it happens, showing a constant animation? Instead, the x increments 50 at a time, so the rect is at 0, then it's a 50

Code:
var container:Sprite = new Sprite();
var item:Sprite = new Sprite();

[code]......

View 1 Replies







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