ActionScript 1/2 :: Swap Movieclips With Another Keeping X Y Coordinates In Same Location?

May 30, 2010

I am trying to swapping a movie clip with another movie clip keeping the x y coordinates in the same location as the original. This is to be done within a case statement. [code]...

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Make Praphics Or Images Swap Location

Feb 11, 2007

I want to make praphics or images swap location, e.g. If I have 4 squares that are in a 2x2 box shape, I want to be able to select one sqaure then select another sqaure and make them swap positions, I would like this transition to be able to work vertically and horizontally.

View 6 Replies

ActionScript 3.0 :: Swap Depth Of Movieclip Based On Y Location?

May 4, 2011

Code:
moviclip.swapDepths(movieclip._y);
and it worked perfectly.

but I decided that I wanted to continue the development of the game in AS3 (so that it will be more up to date and I could learn the new syntax), and I found the equivalent to swapDepths is setChildIndex. so I followed the new rules and came up with this code:Code: setChildIndex(character_mc, character_mc.y);but, sadly it does not work the same. the game becomes extremely laggy and almost unresponsive, but becomes normal again if I remove the code. So, my question is how can I add a similar code for this to work properly.

View 8 Replies

ActionScript 3.0 :: Variables Not Changing To New Location Coordinates

Nov 4, 2009

I have a simple Actionscript 3 project. The code is on the timeline:
ActionScript Code:
import pti.dmutility.layout.ConfigElement;
//this Class simply extends the fl.controls.Button with variables

Then I put some instances into the stage, and make them Drag&Drop. Here is the Dragging function. I want to remember the item's puck up position when clicked, I use ConfigElement's OldX and OldY properties:
ActionScript Code:
function dragStarterItem(e:MouseEvent):void{
var item = e.target;
item.OldX = item.x;
item.OldY = item.y;
item.startDrag();
item.addEventListener(MouseEvent.MOUSE_UP, dragStopperItem);
}

When I click on the item, the OldX and OldY gets the actual position of the item, BUT after dropping it somewhere else, and picking up it again, the OldX and OldY is still the same! Holds the initial position, and not changing to it's new location coordinates. Every instance remembers it's initial position only. Why not change every time I click? Why remembering the first click's position only?

View 7 Replies

Actionscript 3 :: Flex: Difference Between Defining Sprite's X - Y Coordinates And Painting Object In Some Location

Oct 14, 2009

I have a task: I need to place about 100 sprites on one canvas (with prepared grid on it). I need to place them as invisible (circles) stones, on the board, and make visible only on mouseover. The problem I come across is following, I can't place those objects accurately into the nodes on the grid.

[Code]...

View 2 Replies

ActionScript 3.0 :: Swap Two MovieClips?

Dec 14, 2009

i am trying to implement an image gallery in as3. I have already did the same with as2. I am trying to migrate to as3 version. I have two movieclip holders name "holder0" and "holder1" on the stage.These two moviclips are created statically on the stage to hold images.Now i want to swap the two movieclips.

View 6 Replies

ActionScript 1/2 :: Add And Swap Movieclips During Runtime?

Apr 22, 2009

I figured out how to add and swap movieclips during runtime, but how do I insert script into it?

View 7 Replies

ActionScript 3.0 :: Swap Movieclips In Between Flash Files?

Aug 31, 2009

what is the best way to take a movieclip from one flash file and transfer it to another?

View 1 Replies

As3 :: Flash - Swap Depth Movieclips In Fullscreen

Oct 11, 2011

I asked this question yesterday but I found out that my problem is using fullscreen my goal is 2 mc 2 buttons : if btn 1 is clicked mc1 fullscreen and mc2 appears at the right bottom corner on top of mc1 if btn 2 is clicked mc2 fullscreen and mc1 appears at the right bottom corner on top of mc2 stage.swapChildren or setChildIndex is the way but with the fullScreen I had this error appears

[Code]...

View 1 Replies

ActionScript 3.0 :: SetChildIndex - Getting MovieClips To Swap Depths

Oct 4, 2011

I have this script I am writing where when someone hovers over a button it displays a popup box until they roll off. I have that function working alright, but I need the movie clips to swap depths, I realize I can do this with setChildIndex but I'm running into a small problem with my children/parent situation.
My items are added as such:
root > color_mc (blue or red or whatever) > button (this is the hover)
I have the event listener added to the button for each color, but I need it so that when the button is rolled over, it takes the color_mc and moves it to the -1 spot. I've tried writing the code a number of ways but can't seem to get it.

Code:
function manageMouseOver(event:MouseEvent):void{
var parentClip = event.target.parent.name;
parentClip.setChildIndex(parentClip, parentClip.numChildren - 1);
event.target.parent.gotoAndPlay(2);
}

That code gives me the following error:
Error #1069: Property numChildren not found on String and there is no default value.

View 4 Replies

ActionScript 2.0 :: Implement The Swap Depth Function To Movieclips?

May 30, 2007

im having some trouble when trying to implement the swap depth function to movieclips that have the setmask function implimented to them. the problem is that i can get the swapdepth to work but when the setmask is implimented at the same time the movie clips will not swap depths.

the code that i am using to set the mask is _root.bgmasked.setMask(_root.dragger); this is on frame one in the action/code layer bgmasked is the imaged being masked by dragger.

[Code]...

View 2 Replies

ActionScript 3.0 :: Increase A MovieClips Height While Keeping Bottom Anchored?

Jan 15, 2010

I need to increase the height of a movieclip from the bottom up instead of from the top down.

Normally, when you increase the .height the top of the movieclip stays in the same position and the bottom drops.

How can I make the bottom of the moviecliip stay anchored and have the height increase up?

View 1 Replies

ActionScript 3.0 :: Using Coordinates To Move MovieClips?

Apr 24, 2011

I've stored a number of x and y coordinates within a 2D array. I would like to use these coordinates to move MovieClip across the stage. I haven't been able to find anything on this all day...

View 3 Replies

ActionScript 2.0 :: Preloader - MovieClips Get Strange Coordinates

May 18, 2003

I have a main movie where everything is in the first frame. In that frame external swfs load both into MCs and levels, plus some tweened MCs. All this works perfect without putting in a preloader. I want to have a preloader to this movie but have some minor problems with using one. I put the preloader in the first frame and move the main movie to frame 2 with a stop. The preloader works in that way that when total bytes are loaded it jumps to frame 2. The problem: When the preloader is done the main movie opens but some swfs that are loaded into levels and MCs get strange coordinates. But if I put the main movie in frame 5 and keep 2-4 empty then it works.

View 1 Replies

ActionScript 2.0 :: Randomizing Location Of Movieclips?

Mar 4, 2009

I have 7 movieclips that form a line down the stage like so:

Movieclip 1
Movieclip 2
Movieclip 3

I need it so that when a button is pressed is randomizes the order in which they are shown for example it could be:

Movieclip 2
Movieclip 3
Movieclip 1

View 4 Replies

ActionScript 3.0 :: Variable Of Nested MovieClips Global Coordinates

Apr 24, 2009

I have a MovieClip ("mc3" that moves dynamically) inside of a MovieClip ("mc2" that moves dynamically) that is on the stage ("stage" that is static). I need to find the value of mc3's x in relation to the stage? I need to make it into a variable. I am trying to do the math, can't figure it out. Also tried localToGlobal and failed.

View 5 Replies

ActionScript 3.0 :: Full Screen Flash Preserving Location Of Movieclips?

Dec 3, 2009

we have a bar stretching across the whole top of the screen with the following code:
  
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;

[code]...

Then, lets say we have text inside of this movieclip on the right and left sides... How do you anchor this text to each side without it scaling?  

View 2 Replies

ActionScript 2.0 :: Duplicating MovieClips Multiple Times In Specific Location

Dec 22, 2011

I have a question about movie clips. I have about 20 MC-s in my flash. Is it possible for me to duplicate one of them multiple times in specific location? I mean if I have button that says "DOG" and I press it, then new dog appears on screen. And I need to do it for like ten times or so

View 8 Replies

ActionScript 2.0 :: Swap Depths - If I Click On The Space Between The Nested Clips In The Top Clip It Actually Is Hitting The Buttons(movieclips) On The Other Clip Under It?

Apr 11, 2007

I have two main clips with clickable clicks within each. I am using swapDepths on the two main clips in a tab navagation fashion. The problem is that if I click on the space between the nested clips in the top clip it actually is hitting the buttons(movieclips) on the other clip under it. Any suggestions?

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

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

ActionScript 1/2 :: Make An Object Tween From Its Starting Location To The Location Of A Mouse Click?

Apr 27, 2009

I am trying to make an object tween from its starting location to the location of a mouse click. I have a script, but it has a very annoying ease to it.I would LIKE the object to mantain a certain speed during while traveling from its starting location to the mouse click location.

View 16 Replies

Professional :: Button File Opens In Saved Location / But Won't Open In New Location

Aug 21, 2011

I created a simple button that displays an error messeage: "error opening 'url" when I test the movie, but does play and opens in browser after publishing. However, it won't open in the browser in a different location. I pasted the html code in a web page but it doesn't work there nor opens in the browser in a differnet location from where it was originally published and saved. Why is that?

View 13 Replies

ActionScript 2.0 :: Move MC From One Location (x / Y) To Another Location

Feb 16, 2005

How can I move my MC from one location (x, y) to another location (x1, y1) wirh action script..?.. and I would like to have my motion tween rounded to (x,y) so it will look sharp.

View 8 Replies

Keeping One Image On Top?

Aug 15, 2009

I have created a website header that rotates through various images. I have another image that I would like to be off to the left side but partially cover the main header images. I really don't want this image to change with the other images. Is there a way to put this image on its own layer in flash and have it visible the whole time, while the other images change?

View 2 Replies

Keeping One Object Above Another?

Sep 14, 2009

i am doing a mario game with flash, as3. i want to mario stay above box when jump above it or i dont want mario to pass through box while walking. mario should crash box like wall.

View 3 Replies

Keeping Object On Screen

Aug 12, 2011

I'm making this banner, or FMA if you rather call it that, for a company (school assignment). I have some text fading in and out displaying the message. But I want an interactive FMA.I want to make some buttons, and when you go mouse-over on them, I want a picture to be displayed (different image for each button), WHILE the animation keeps going. Thats not the tough part.However, when the animation repeats (starts from the beginning), and if I'm holding the cursor over the button connected to the picture, the picture disappears and I have to go over the button again. [code]

View 1 Replies

Actionscript 3 :: Fit A Swf Into A Box Keeping The Same Ratio?

Jan 17, 2012

I have an as3 app that loads SWF's with various movie clips inside with a size of 1280 width and 720 height. I would like to fit these SWFs into a content box of height 885 width by 500 height. The SWF must keep a ratio of 1.77. This would be easy if as3 recognised the SWF being 1280 height by 720 width. It doesn't however, and takes the size of the movie clips inside the swf which varies (as long as it's within the original size boundaries). how I can make the SWF's fit into the content box even if the movie clip sizes and therefore the original SWF sizes vary?

View 1 Replies

ActionScript 2.0 :: Keeping One Or Two Decimals?

Aug 25, 2009

I know how to remove all decimals with:

ActionScript Code:
Math.round (xTwo*0.39);

But, how do I keep 1 or 2 decimals?

View 6 Replies







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