Professional :: Accessing Coordinates Of Added Shape?

Jul 1, 2010

I am adding rectangles dynamically and have first added them to movie clips so that they can receive mouse events.But I am having trouble accessing their position on stage.If I set the position of the movie clip that contains them, the x coordinate returned is always 0.Is there a way to get the position of the shape and/or movie clip container.

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Check Position Of A Shape Added Dynamically?

Feb 6, 2010

i have a class that creates circles randomly placed at stage, i want then to move those circles and make them bounce off the stage, i know how to do that, the problem is that when i add a new shape into my stage, that shape, has an "x" value of 0, no matter where it appears, how can i check the real "x" value of that shape within the stage, so i can continue with the bouncing check...

ActionScript Code:
package
{
import flash.display.MovieClip;
import flash.display.Graphics;

[code]....

so i just want to know the "real" "x" and "y" positions of my Shape attached to stage to attach a ball to stage i use the createBall method called from my fla....

View 2 Replies

Actionscript 3.0 :: When The 3-d Function Gets Added It Starts Tween All Weirdly Shape?

Jul 21, 2009

I have a question regarding TweenMax and the way it tweens MovieClips. Here is what I have.

1. I have a rectangle movie clip on stage (width:20, height:20). When you click it, it expands (to width:650, height:350) and gets a 3-d function attached so it reacts to mouseXY position (like Lees 3-d photo tutorial). This part works fine.

2. I click it again and it retracts to its original small size (width:20, height:20). This also seems to work fine.

Problem: When I click it again it expands (to width:650, height:350), but when the 3-d function gets added it starts tween all weirdly shape and not the way it is intended.Here is my class

Code: Select allpackage
{
import flash.display.Sprite;[code].........

View 2 Replies

Professional :: Adding Shape Hints Makes Shape Disappear In Between Frames

Jun 22, 2010

Whenever I add shape hints to a shape tween the shape disappears in the between frames. I am using CS5 on Vista. I using files from [URL]to practice.

View 2 Replies

Actionscript 3 :: Accessing An Instance In A Dynamically Added MC?

Apr 11, 2011

I've added a movie clip dynamically using the following code:

var apie=new cPie()
apie.x=100
apie.y=100
stage.addChild(apie)

I now have a pie on my stage. Yum. Assuming this works like a movie clip placed on the stage by dragging and dropping, I added this in to change an instance in the pie.

[Code]...

View 2 Replies

ActionScript 3.0 :: Accessing Children Added To An Object?

Jan 23, 2010

How do you access a child that has been added to an object?For example if I have a movieClip on the stage and I add a child to it, how do I then access that child?

Code:
var newClip:MovieClip = new MovieClip();
newClip.addEventListener(Event.ADDED, checkClip);

[code]......

View 4 Replies

ActionScript 3.0 :: Accessing Textfields In Movieclips Added By Addchild

Nov 4, 2010

I have a bunch of movieclips which were created by "addChild" method. These movieclips are added to "gamecontainer". There was a dynamic textfield in each movieclip. Now the problem is how can I change the text in the dynamic textfield inside each movieclip outside this function.

Here is the code:
private function arrangeClips():void {
for (var i:uint=0; i<7; i++) {
var tile_mc:whiteTail=new whiteTail();

[Code].....

View 2 Replies

ActionScript 3.0 :: Accessing And Removing A Randomly Added Mc On TotalFrames?

Nov 22, 2010

i have an array containing 4 mc:

Code:
private var notesDefinition:Array = [Note1, Note2, Note3, Note4];

When faceMc moves (while dragging or as a mouse trail), points are created dinamically every 200px and one of the array�s mclips is added there in a random function. Now i need to remove that mc when it reaches its last frame (just the mc on stage, not remove from the array). I tryed the following but its not working.

Code:
private function drawingAPI(event:Event):void{
var addNewNote:Boolean = false;
//add first point

[Code]....

View 1 Replies

ActionScript 3.0 :: Accessing An Object Previous Added To Stage

Jan 26, 2009

I'm having accessing an object i previously added to my stage. Or at least give me some direction, or tell me if there is an easier way entirely to achieve what I'm doing.

[Code]...

View 3 Replies

ActionScript 3.0 :: Navigating Or Accessing Objects Added To Stage?

May 22, 2009

I have a structure display like this: (brackets shows the depths, within their parent)

my question concerns 'communication' between the highlighted objects - so you don't have to waste time understanding the whole tree! I've just added this to provide some context!

mc_init (0)
___|
___mc_page (0)

[Code]....

Now, its easy to add a mouse event to btn(1), but how do I get this button to set the visible property (say) of 'rectangleBG(0)'

how do I access the paths? of these objects added to the stage?

View 2 Replies

ActionScript 3.0 :: Accessing Children Of Dynamically Added MovieClip

Jan 8, 2011

Code:
function saveAction(evt:MouseEvent):void{
var choice=evt.target.name;
var inputText:String = saveName.text;
}

I have this and I am trying to make a variable from the contents of the input box. Simple ya? The issue is that it is a child of another clip that is being added dynamically, so it doesn't think the input exists. How do I declare the input? How can I target it's contents? Also I have a remove function that is meant to remove this same parent clip.

Code:
function closeSaveWindow(evt:MouseEvent):void{
removeChild(saver);
}
'saver' is a variable created in another function, so I think there is a scope issue there. To try to fix that I declared 'saver' as a movie clip as a global var.

View 1 Replies

ActionScript 3.0 :: Accessing Text Field Added From Library Multiple Times?

Nov 6, 2010

I'm using the following code to add movieclip from library to stage...the moviclip holds a background and textfield. now adding it to the stage works fine and i can access the textfield 1 time but after the timer fires again the refrence to the text feild disspepears . I need to access the textFeild every time the timer fires so what am i doing wrong? HOw do i keep refrenct to the text field?

PHP Code:
tim0 = new Timer(1000,30);
private function PrepTime(e:TimerEvent) {

[code].....

View 1 Replies

Professional :: Change The Shape Of A Shape?

Oct 19, 2010

using the shape tool you can draw basic shapesthen using the subselection tool you can re-shape them by relocating certain points

What i want to do is create a tween whereby one of the points is movedthe problem is you have to convert to a symbol first and after you have done that you cant change the shapes shape.so how do i go about using a motion tween to change the shape of a shape?

View 1 Replies

ActionScript 3.0 :: Accessing Shape Data And Draw Simple Lines With "line Tool"?

Oct 29, 2008

I'm wondering, is it possible to access shape data with actionscript. I want to draw simple lines with "line tool"somewhere in my movieclip and then to access information about my lines with actionscript to get startX, startY and endX endY of every line.

View 1 Replies

Actionscript 3 :: Convert Global Coordinates To Local Coordinates Of A UIComplenent In Flex Project?

Dec 19, 2011

I was trying to convert global coordinates to local coordinates of a UIComplenent in my flex project using below code using below code

var gp:Point = new Point(e.stageX,e.stageY); //global point
var lp:Point = uic.globalToLocal(gp); //local point

uic is UIComponent in which I have subclass of Sprite for drawing something I have set the sprite's mouseEnabled and mouseChildren to false to not interrupt the mouse event. above code is within uic's mousemove event where I was tracing the gp and lp gp was giving correct value and suprisingly lp was giving negetive values. when I move the move to the top left corner of uic i expect lp to be 0,0 but it is giving the -width of of uic. I broke my head for hours and ended up finding an alternate by using offsets. Infact my original code was much simpler like this which was same issue

var lp:Point = new Point(e.localX,e.localY);

I am not sure what exactly is causing this problem. the workaround had lot of issues and it creating a mess in my rest of the algorithms.Just now I found even more interesting thing (which is actually weird). for some reason I went and create a new lp2

var lp2:Point = new Point(e.localX,e.localY);

now surprisingly it was giving correct values as expected and I went back and changed the code as

var gp:Point = new Point(e.stageX,e.stageY); //global point
var lp:Point = uic.globalToLocal(gp); //local point
var lp2:Point = new Point(e.localX,e.localY);
var lp2:Point = uic.globalToLocal(gp);

now it is expected to have all the lp, lp2 and lp3 variables to be same but weiredly lp two is giving wrong value and lp2 and lp3 were giving correct. I am suspecting using the variable lp has something to do. I am not sure about that but above proves it so right now I am using lp2.

View 1 Replies

ActionScript 2.0 :: Converts 3d Coordinates To 2d Coordinates - Difference Between MoveTo And LineTo?

May 21, 2007

I was reading the 'Isometric Transformations' tutorial by Danko Kozar and I have a few questions. I understand what all the code does, but not how it does it. First of all, how does the following code work:

transforms x,y,z coordinates into Flash x coordinate
xFla = function (x, y, z) {
// cartesian coordinates[code].....

I understand that it converts 3d coordinates to 2d coordinates, but I don't understand how. What numbers whould be punched into x, y, and z to acquire certain desired effects?Also, what's the difference between moveTo and lineTo:

red line
style(1, "0xFF0000", 100);
plot(0, 0, 0);
draw(200, 0, 0);

View 4 Replies

Professional :: Setting X And Y Coordinates On A Sprite?

Feb 28, 2011

I need tp set the y coordinate on a sprite's rightmost coordinate. That is, usually when we set the y coordinate that's the lefttmost side of the sprite, and the sprite starts there and goes to the right of that point. I need to reverse that. The reason is because I'm putting text into it and it's going to the rightmost side of a box, so it can't overflow to the right.

View 2 Replies

Professional :: Using The ADDED EventListener?

May 10, 2010

Im trying to use the added eventlistener. When a child is loaded i then wish to trigger to a function. But the function seems to be triggering before the graphic is load. I am using this for some press loader functionality before a database is queried. My code looks like this....

loadingicon = new loadIcon();gridCradle.addEventListener(Event.ADDED, loadiconAdded);gridCradle.addChild(loadingicon); public function loadiconAdded(e:Event) { if (e.target == loadingicon) { troot.debugger.htmlText+="icon loaded" gridCradle.removeEventListener(Event.ADDED, loadiconAdded); inizRequestOfData(); } }

The above if statement works. But inizRequestOfData() seems to be trigged before the loading of anygraphic is done.

View 1 Replies

ActionScript 3.0 :: Converting Papervision Coordinates Into Cartesian 2D Coordinates?

May 3, 2010

Im making a little app in flash using papervision I want to make a regular movieClip show up in the same place as a papervision object. The coordinates seem like perspective is affecting the number displayed.

View 2 Replies

Professional :: Control Timleline With Mouse X Coordinates

Feb 1, 2010

how to create a movie with a sequence of pictures and controlling the timeline frames with mouse x-coordinates?

View 4 Replies

Professional :: Control Frames With Mouse X Coordinates?

Feb 1, 2010

I want to take a folder with 20 pictures, in some way convert them into a movie. And then apply so that I can navigate the frames one by one in the movieclip by moving the mouse right and left  (move mouse left - navigate backwards frame by frame, move mouse right - navigate forward frame by frame).

View 2 Replies

Professional :: No Looping Once Preloader Was Added?

Feb 22, 2010

So I have a looping SWF file that I uploaded on my website. It played perfectly until I decided to add a preloader.
 
I set up the Flash file with 2 Scenes, "Preloader" and "Scene 1" .The Preloader scene will play just fine. After the preloader plays, Scene 1 then begins to play as it should. However, once the animation ends, instead of looping like it did before, it just stops on the first frame.

How can I get my SWF to play the Preloader, and then continue looping the main animation (Scene 1)?
 
Here is my AS:
 
import flash.events.ProgressEvent;
function update(e:ProgressEvent):void
{
var percent:Number = Math.floor( (e.bytesLoaded*100)/e.bytesTotal );

[Code].....

View 2 Replies

Professional :: Flash Just Added 400% Size To Swf?

Aug 3, 2010

I've been working on a project that's about 500k for the .fla, and 36k for the .swf
 
On my latest export and save, the .fla is coming up 25k, and the the .swf is 120k  - 120k is wayyyy too big for what I'm doing.  The fla seems to be all intact even though it's only 5% of what it used to be.
 
I haven't changed any of the publishing settings.
 
I tried loading an older version of the project (from a month ago).  When I export that version, the swf also comes out at about 120k instead of 36.
 
I'm using CS5, and have only had it a few days (was using CS4) - is there some new function that could affect the file sizes so drastically?  It's strange, as it was exporting fine until about an hour ago.

View 5 Replies

Professional :: Call A Page From An Added One?

Oct 22, 2010

I'm creating a website, on the stage I've got a menu and a movieclip which I use to show my pages, the movieclip's name is pagecontainer_mc.Each page is an exported class for AS3.When I click on a button on the menu, with removeChildAt() and addChild() I remove the current page and show the requested one.Everything ok with this.The problem comes when I need to call a page not from the menu, but from a button inside another page.I've tried writing this code on the main timeline:
 
var contacts:contatti = new contatti;
pagecontainer_mc.contacts_btn.addEventListener(MouseEvent.CLICK,showCo ntacts);
function showContacts(e:MouseEvent):void {        pagecontainer_mc.removeChildAt(1);    pagecontainer_mc.addChild(contacts);    }

[code]....
 
If I put the code inside the page's timeline I can't access to pagecontainer_mc (or at least I'm not able to do that).

View 3 Replies

ActionScript 2.0 :: New Shipping Charge Is Added To The Buyers Total For Every Item Added?

Jan 21, 2011

I am using a Flash AS2 template for a PayPal shopping cart on my site. As the code is now, a new shipping charge is added to the buyers total for every item added. I would like it to have only 1 shipping charge, no matter how many items are added!

Actionscript Code:
import caurina.transitions.Tweener;cartItems = new Array();itemNr = -1;itemQty = 1;cartin = false;ctrl_mc.cart_mc.onRelease = showCart;attachMovie("cart","cart_mc",15000,

[code].....

View 1 Replies

Professional :: Cannot Close The Shape

Feb 17, 2010

I am trying to follow the exercises in the "Classroom In A Book" for Flash CS4 and I am having problems already on exercise 2. the problem is that I can not close the shape, whilst using the pen tool and anchor points. I have tried to make the anchor points extend further than the stage and then clicking on the first anchor point as the book suggests, however, a new line is drawn through the stage, to the first and last anchor point. The problem is I can not add the fill colour.

View 1 Replies

Professional :: Scrollpane With Dynamically Added Movieclips?

Mar 25, 2011

I'm more of a Flex than Flash developer so I'm hopeful this is something easy.  Short story, I have a scrollpane in a flash-created swf. In my pure AS3 project I dynamically create menuitems within a new movieclip.

[Code]...

View 5 Replies

Professional :: Web Page That Can Be Added To And Altered By Viewers

May 23, 2011

Will start with an excel spreadsheet (probably) and will need to make a page that can be filled out and updated by the viewers.Basically they will have selections to make and dates to select from an existing list.

View 6 Replies

Professional :: Advanced Masking - Top Two Layers To Be Able To Follow The Same Mouse X/y Coordinates?

Jun 30, 2010

how to make it work.I have 3 layers.

1. top layer is an image of a cell phone with a blank screen (where I'd like the mask to be utilized)

2. the mask... which is paired with the cell phone image above.

3. the main/maskable image, which is only revealed by the cell phone's screen.

4. the very bottom image, visible all the time.
 
I need the base layer image (#3) to be static, and I need the top two layers to be able to follow the same mouse x/y coordinates.  So far, I've only known how to have the mask and the masked image be one together, rather than be able to move the mask independently of the image I want to mask.

View 4 Replies

Rotate A Shape 90� In Flash/CS5 Professional?

Aug 11, 2010

Is there an option to rotate a shape 90 in Flash CS5 Professional?

View 2 Replies







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