ActionScript 3.0 :: LocalToGlobal Giving Me Doubled Values

Nov 3, 2010

I have a movieclip A inside a movieclip B. A has a coords (10, 0) and B has a coords (0, 0). So technically the global point for A should be (10, 0) right? Well it's giving me (20, 0). I put A at (10, 10) and I get (20, 20). This is just the weirdest thing ever.

View 2 Replies


Similar Posts:


ActionScript 3.0 :: LocalToGlobal Showing Wrong Values?

Feb 19, 2011

My problems keep piling up. I was trying to figure out where child objects X and Y positions are on stage and not locally. Therefore i use the "localToGlobal" function and I'm pretty sure i use it correctly? The thing is that some Y values are true but the X are just completely spaced out. I use a function to find all child objects on stage and this works great.

Code:
private function findGameElements():void
{
// Array that will store all elements on screen and their values
fixedElements = new Array();

[Code].....

View 4 Replies

ActionScript 3.0 :: Text Appears Doubled?

Apr 16, 2009

these are dynamic textfields, and everything is tweened from alpha 0 to 1 at inital loadand this screenshot is taken like one second before second one; look at the first picture, the text is all nice and crisp:now look at the second one, when it tweens to alpha 1, it looks like there is a "second pass" of text over the inital one it looks like it doubled itself:

View 2 Replies

ActionScript 3.0 :: Stage.stageWidth & Stage.stageHeight Giving Wrong Values

May 17, 2011

In my AS3 code all the elements on the page are dynamically positioned depending on the current width and height of the SWF - providing it's not under a certain value, then the items are back in their original position.

When debugging in the Flash player the size all reports correctly however when run from a web browser it does not - initially.

This is my HTML & PHP code for the entire page:

HTML Code:
<?php
function hashId($fn) {
$hash=md5_file($fn);

[Code].....

But I cannot get the size to report correctly without, say, clicking a button.

It seems to me like I need to force flash to re-draw the screen, but I had no luck trying to do that.

View 8 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 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

Flash :: Dynamic MC's Path With LocalToGlobal?

Sep 27, 2010

I'm adding several instances of an MC (bread_mc) into a container MC (wall_mc). wall_mc has been added to a shop class and that is where i'm called the rest of my functions from. Also the wall_mc is scrolled left and right with mouseX & mouseY values. I've set up a function to add the bread_mc to the wall at different x/y positions.

[Code]...

I really don't even know if i'm using it right, But I think my problem lies in the fact that I need the currMC path to travel up the display list tree and get the global stage X/Y position. I'm not too sure how to implement a dynamic path with the localToGlobal method.

View 1 Replies

ActionScript 2.0 :: OnEnterFrame Breaking LocalToGlobal

Jan 13, 2009

I am using localToGlobal to get the _y coordinate of a nested movieClip in relation to the stage.[code]

View 1 Replies

ActionScript 3.0 :: LocalToGlobal Not Getting Global Possition?

May 2, 2011

i just cant make this function work. Using addChild player mc is added to stage, inside it theres a mc named ballCnt. I need to make that position global, but it keeps giving local coordinates. Heres the code line (the last one i tryed):

var point:Point = localToGlobal(new Point(player.ballCnt.x, player.ballCnt.y));
trace(point);

View 1 Replies

ActionScript 2.0 :: LocalToGlobal Point Wrong?

Oct 29, 2007

I have a movie clip that is nested inside 2 other clips and want to get it's coordinates on the stage. I am using the localToGlobal method but it is returning the wrong values. Here is my code:[AS]

var myPoint = new Point(this.skew_mc.grid_mc.dot_mc.x, this.skew_mc.grid_mc.dot_mc.y);
var newPoint = this.skew_mc.grid_mc.dot_mc.localToGlobal(myP);
trace(newP);[/AS]

I've attached an fla with an example of this in. If anyone can point out where I'm going wrong .

View 1 Replies

ActionScript 3.0 :: LocalToGlobal And Nested Movieclips?

Nov 3, 2009

Let's say i have a 3 movieclips which are nested one in other like this:A-> B-> CAnd i would like to find out C movie clip (which is in B mc and B mc is in A mc) coordinates relative to global stage, how can i accomplish that?

View 3 Replies

ActionScript 2.0 :: [FMX] Unable To Use LocalToGlobal In A Game

Oct 20, 2004

I'm making a driving game in Flash Mx 2004, and I based my code in MarkFeller Game,but I can't make the code works, now I'm with problems in the skid routine, flash dont give me any error, but the code don't works (the LineTo and MoveTo dont do anything) and I think that my problem is with localToGlobal function....

Here is my code....

Code:
acel = .2;
angulo = 0;
atrito = .98;
VelocidadeMinima = -5;

[code]....

View 1 Replies

ActionScript 3.0 :: LocalToGlobal Reporting Wrong Coordinates?

Oct 15, 2010

Say I have a movieclip called theScreen a 0,0. It is 800 wide, 700 hightheScreen contains a movieclip called theStatusArea at 600,0. It is 200 wide by 700 hightheStausArea contains a movieClip called pieces at 10, 410. It is 180 wide by 180 highpieces contains a number of movieclips (triangle, square, etc.),all of these sub movieclips are more narrow than the pieces container and are all set added to the pieces container at 0,0

var pt:Point = new Point(triangle.x, triangle.y)
pt= triangle.localToGlobal(pt);
trace(pt); // should be 610, 410 at least at the start.

[code]....

View 7 Replies

ActionScript 3.0 :: Proper Usage Of LocalToGlobal Method

Sep 13, 2010

What I'm having the problem with is the proper usage of localToGlobal method. I have the hero mc, I put into it another mc called 'weapon'. Now, in the game, I want to fire a projectile and set it at the x and y of the weapon. The question is, how can I access the absolute x and y of the weapon.

View 3 Replies

ActionScript 3.0 :: Bring 23 Boxes To The Front, Using LocalToGlobal?

Oct 13, 2011

I got 23 boxes (box1, box2...) inside two movieclips (Circle.SizeableCircle). I need to bring all these to the front, using localToGlobal.This brings box1 to the front (or whatever it's called):

PHP Code: var cpBox1:Point=new Point(Circle.SizeableCircle.box1.x,Circle.SizeableCircle.box1.y);var gpBox1:Point=Circle.SizeableCircle.box1.parent.localToGlobal(cpBox1); 

What can I do instead of making 23x that code?

View 11 Replies

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

ActionScript 3.0 :: Flash LocalToGlobal And GlobalToLocal - Get Value In Global Coordinates

Oct 27, 2010

I have a small problem with usage localToGlobal and than back to local. I can get global coordinate of my nested mc in question alright. Than i check if this coordinate + value of my mc.width is more than my stage width. I get to this part with no problem. Than if value is bigger (so mc is not on the stage i mean if part is off the stage i change value so it is stage width - mc.width). So i get value in global coordinates that i need. But how do i apply this to my nested clip is my question? For reference here is my code:

[Code]...

View 3 Replies

ActionScript 2.0 :: HitTest / LocalToGlobal Not Working - Traces Out To The Correct Location

Feb 12, 2010

So I am able to trace the correct coordinates. However the hitTest fails. Here is my code:

[code]....

View 1 Replies

ActionScript 3.0 :: Flash Simple LocalToGlobal - Indicate Its Actual Location On The Stage?

Dec 4, 2010

Ive tried looking in a whole bunch of threads for a solution to this probably common issue but to no avail.I have a bunch of objects of same type on the stage which are generated through code.Inside these objects which are generally at x=300 on the stage.

Code:
this.x+=2.3;
trace(stage1.localToGlobal(new Point(this.x,this.y)), ", ", this.x , " ", this.y);

stage1 is the stage object I pass into my class.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 actual location on the stage, ie, x=300.This isnt happening.Whats the correct syntax i should be using.

View 4 Replies

ActionScript 2.0 :: LocalToGlobal() - Put Four Empty Movie Clips On Each Of The Character's Base Corners?

Aug 17, 2004

I'm working on an isometric-view prototype game, and I thought a good way to do the collision detection would be to put four empty movie clips on each of the character's base corners (it's a cube), convert those corner's _x and _y to the Stage, and go from there. Problem is, how to get it to work.My character is on the stage in an otherwise empty "clip" MovieClip. Here's what I have inside my character:

Code:
onClipEvent(enterFrame){
var point:Object = new Object();
point.rightX = right._x;[code]....

Whenever I trace any of these, it always traces the local coordinates. Otherwise, everything is fine.

View 1 Replies

Professional :: Way To Use Flash Without Giving Up SEO?

Nov 5, 2010

Does a Flash CMS site give you the best of both worlds? I want asite but I need it to be searchable. Does a Flash CMS site rank well enough to do the job? If it does not rank well, is it because the Flash portions would get no SEO but the HTML portions would?OR is it something inherently missing in the software that will keep it low on the rankings, no matter what the ratio of Flash versus HTML there is on that site? Would an HTML site with Flash plugins hurt my rankings much? Could I solve my problem best by having an HTML based landing page that gives access to 2 sites, one strictly HTML and one either Flash or Flash CMS based? Assuming the landing page and HTML portions are optimized properly, is the content that is on the HTML landing page and HTML site going to give me good SEO results, even though one of the options to choose is a Flash site?

View 3 Replies

ActionScript 3.0 :: Slider Input Values - Can't Get The Output Values To Add Up?

Dec 6, 2010

I've gotten these sliders to work but can't get the output values to add up. For instance, depending on the values for slider 1, 2 and 3, I need the total to show up in a separate text box. I keep getting a NaN message in the text box.Here's the code I have so far:

//item 1
sliderOne.width = 600;
sliderOne.value = 0;[code].....

View 3 Replies

ActionScript 3.0 :: Giving Each Duplicate A Variable?

Feb 27, 2009

PHP Code:

stage.addEventListener (Event.ENTER_FRAME, lala);
function lala (event:Event) {
var object = new object_mc;

[code]...

How do I correctly declare a variable for each duplicate? The final line doesn't work in AS3 but it does in AS2. I want the same variable for each duplicate that I can individually change. Also how do I make a function for each duplicate? In AS2 I can do it by:

PHP Code:

object = duplicateMovieClip(........);
object.onEnterFrame = function () {
.........
}

View 7 Replies

ActionScript 2.0 :: F8 Giving Variables A Unique ID

Feb 28, 2010

[code]i know about arrays and the code above isn't what i got its just a way to try and explain it a bit better.I would like to know for a TD game i am trying to make

View 2 Replies

AS2 - Giving A Movieclip A Specific Depth

Feb 15, 2011

I want to give a movieclip a specific depth number, but i cant found a method for this.

View 2 Replies

Flex :: Giving Border To Canvas?

Jul 26, 2010

In flex, I am using

canvasEdit.setStyle("borderColor", 0x0134FF);
canvasEdit.setStyle("borderThickness", 3);
note: canvasEdit is of type Canvas.

But I am not able to put border on the sides of canvas.

View 1 Replies

ActionScript 2.0 :: Delay Giving Value To Variable?

Aug 23, 2009

I'm running a function equivalent to onEnterFrame. The function is checking variable values to see where on the playhead to play a particular video. The problem I'm running into is where the first conditional is passing a value of 2 to seqTotal and checking for the value at the same time. The conditional for seqTotal being equal 2 runs before it should. How can I delay giving a value to a variable so this doesn't happen?

[Code]...

View 3 Replies







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