ActionScript 2.0 :: Centering Nested Scaled Movieclip?
Apr 17, 2009
i have a movieclip(content_mc) that contains 4 movieclips(img1, img2, img3, img4) of different widths within it. The content_mc has been scaled to the browser using _xscale and _yscale. so if i want to center img1 on the screen the math WITHOUT content_mc being scaled would look like this
Code:
Stage.width/2-(content_mc._width - content_mc.img4._width - content_mc.img3._width - content_mc.img2._width - content_mc.img1._width/2)
but being the fact that it's scaled...it returns the original _width values of the nested movieclips. How do i get the values of the new, scaled widths?
View 2 Replies
Similar Posts:
Jun 18, 2005
I have a picture of a mine which is nested within an object, nested within another object. Now what I want it that on the keypress of shift, I created mine image at the same position of the tank. The issue is that the main object that is nesting the mine moves, thus not creating at the the center, rather on that position of the object.
Here are how my images go by instance names;
1. Tank Stays in the center
//////
/////
1. Land (moves) -- 2b. map -- 3b. All objects that hitTest
|
2a. Objects
|
3b. All the objects that don't get hit (in here is mine.)
View 4 Replies
Aug 16, 2007
I'm currently working in Flash 8 with Actionscript 2.0.
I've been trying different alternatives and none of them are working. I've even posted here previously and tried a few things but I haven't quite resolved my centering to stage problem. Some of you may have already read pieces of this from another post.
I have a landscape that functions sort of like a 360 vr tour. The main movie clip directly on the stage is labeled, "mainMovie", and within it is another movieclip labeled, "singleStrip".
To simulate the 360 vr tour, there's script inside, "mainMovie" to duplicate "singleStrip". Also, inside the "singleStrip" movie clip, I have different elements appearing through the landscape, in this case, we'll use letters as an example. The letters A - Z are sitting on the landscape throughout the entire "singleStrip" movie clip.
Everything rotates fine with the script that's placed some sensitive area movie clips that are placed on the root level. When you place your mouse pointer to the left edge of the stage, the landscape shifts left, when you move the mouse pointer to the right edge, the landscape shifts right, (or vice versa, I can't remember).
The problem I'm having is for the letters that are in view on the stage, I want the user to be able to "click" on them and then that letter zoom up to the center of the stage, (through the "x" coordinate). I'm having difficulty with this since the letter movieclips, (example, "letterA"), are within the "singleStrip" movie clip, which sits inside the "mainMovie" movie clip, which are both constantly moving and their x position continues to change.
I've been using the tween class in order to animate them with easing and it's usually the "endx" variable that I'm having trouble because I don't know how I can match it up to the center of the stage, whether it's a "endx = stage.width._x /2; " or something else. Here's an example of some of the [code]...
View 2 Replies
Jan 24, 2010
I have a mc on stage. I want to add a new mc inside it and position it at the bottom of the mc.
The code works fine when the container mc is 100% scaled, but when I scale it, the mc inside positions wrongly.
Heres my code:
PHP Code:
// Lage scroller:var o0LbScroll:Object = getChildByName("o0LbScroll");o0LbScroll.oppKnapp = new scrollKnapp;o0LbScroll.nedKnapp = new
[Code].....
View 1 Replies
Jun 9, 2011
How do I get an exact width and height of a MovieClip if it was scaled on stage resize?
for example if I have:
stage.scaleMode=StageScaleMode.EXACT_FIT;
stage.addEventListener(MouseEvent.MOUSE_DOWN, checkSize);
function checkSize(e:MouseEvent):void{
trace(mc.width);
}
It will always output the same width and height no matter how big or small the stage is. Is there anyway to get exact current size?
View 2 Replies
Aug 18, 2009
I'm building an application where the user can upload a photo of their head, scale it and position it, and then pick a colour from the photo.The photo gets put into a movieclip called 'head'I'm stuck at the colour picker part and I just can't seem to work out the whole bitmapData thing. Here's my colour picker code -
ActionScript Code:
private function beginColourPick():void
{
_bmd = new BitmapData(head.width, head.height);
[code]...
This code kind of works, but not correctly.
Problem #1: The colour picker only works in the bottom right quarter of the image because I moved the head mc so the registration point is bang in the middle. So the problem here is that I can't figure out how to move the bitmapData in line with the head mc.
Problem #2: If the user scales the head mc (even a tiny bit) the colour picker stops working altogether. Now I'm thinking I've got to use a transform matrix - but I read up on it and haven't got anywhere.
View 7 Replies
Jun 9, 2011
How do I get an exact width and height of a MovieClip if it was scaled on stage resize?for example if I have:
ActionScript Code:
stage.scaleMode=StageScaleMode.EXACT_FIT;
stage.addEventListener(MouseEvent.MOUSE_DOWN, checkSize);
[code]........
View 3 Replies
Oct 20, 2009
I have a frame_mc that get scaled 400 % onPress with a fusekit tween. Now I'll like to anchor a title_mc to the the top edge of the frame_mc without scaling it. How to do that? onEnterframe in the onPress function?
View 0 Replies
Dec 5, 2009
I have created this Flash site: [URL] But i am having a problem. Under "Gallery", each picture, is a movieclip, which loads a picture from my server. But the pictures aligns to the top left corner of the MovieClip. How do i make them align to the center of the movieclip?
[Code]...
View 0 Replies
Feb 2, 2006
I got this far with my images display. I found code and it was able to work, but I'm not savvy enough with the code to unload images.I have 'searched' thru kirupa to see if someone had something similar. Found other 'centering images' type .fla's, but can't connect them to mine.I don't want to change the navigation or the way I have it set up -- I need it scripted frame-by-frame as it is. I was hoping someone knows how to get the images to 'unload' as you press each button.
View 1 Replies
Jun 7, 2007
I want to make my createTextField centered on my movieclip, does anyone know how this is done? I've tried using the texWidth/_width property but it only makes it to narrow. Or is it possible to size the background fill to the length of the word?
PHP Code:
var aPoints:Arra =["one", "two", "three", "four"];
function printIt()
[code]......
View 2 Replies
Dec 12, 2005
I'm loading an external movieclip into an empty movieclip which is inside of another movieclip. But the movieclip I'm loading isn't properly centering to the top movieclip.
Code:
this.createEmptyMovieClip("side2", this.getNextHighestDepth());
this.side2.loadMovie("skins/default/red.swf");
this.side2._x = this._x;
[Code]....
Way way way off of the top movieclip. I'd at least expect side2's 0,0 point to be in the upper left which would snap to the center point of this. But not even close.
View 2 Replies
Feb 20, 2012
I have a website made with flash and I have added all the pages inside a movieclip and this moviclip is centered in the stage using event. Resize and event.Enterframe. But now the problem is..although the gallery (which is an external swf) is inside this movieclip it doesn't stick to this stage.rezise event. How can I control this gallery.
View 1 Replies
Oct 21, 2004
How do a make a center a mc automaticly on the stage with aS. The script should detect what the stage size is and move the mc to the middle. I am making smartclip-preloader and want to be as productive as possible later on.
View 4 Replies
Mar 17, 2008
I'm having trouble to center any dynamic content (movieclips, textfields...) inside a dynamically created movieclip, which has a default point of interested in the top left corner.
PS: Just as an example, I have a dynamically created text field inside a dynamically created movieclip....and when I try to scale that movieclip I need to scale it from its center
View 2 Replies
Jun 1, 2010
i am using a movieclip who has two nested movieclips, the problem i am dealing is that when i try to get the width or height of the parent movieclip it always showing the values of the small nested movieclip, when i draw the movieclip it draw perfect but when i read this values shows that error, what can i do?
View 2 Replies
Dec 4, 2011
I want to apply actions to a movieClip nested inside a dynamicly attached movieClip, with the attachMovie method; it doesn't works when the movieClip is attached by a button:
1.when the swf movie loads with an attachMovie method the remove_btn clears the window_mc
[Code]....
View 9 Replies
Nov 14, 2011
I'm trying to do a cleaning of some classes that is added into a MovieClip, but I can't seems to set the MovieClip(Class) to null. What is the proper way to do it?
private var mcHolder:MovieClip = new MovieClip()[code].................
View 1 Replies
Mar 21, 2007
I'm trying to do somthing like this:
class Timer extends MovieClip
{
// constructor
[code].....
View 3 Replies
May 19, 2008
I have a nested movieclip that I need to control.I have searched the net and to this point I have been able to make it gotoAndStop at frame 1 and play().I can't make it stop.I understand that actionscript can be attached to the movieclip instance or placed on the root timeline.what I would like is direction to websites and or tutorials that might teach me how to control a nested movieclip.
View 3 Replies
Aug 3, 2009
Code:
var tf:TextField = new TextField();
tf.text = "abc";
var mc:MovieClip = new MovieClip();
mc.addChild(tf);
trace(mc.tf.text);
Why does the trace statement throw me an error?
View 1 Replies
Jan 28, 2010
I'm trying to build a styled, rounded button movieclip that I can reuse/resize. So inside a movieclip, I have two layers:
Layer 1: A border, which is a shape - a rounded rectangle (or actually the stroke of a rounded-rect).
Layer 2: A nested movieclip which contains a shape for the face of the button. I have added filters to this nested movieclip to give it a beveled-type look - typical rounded button stuff.
So, I've tried applying scale-9 to the parent movieclip: in this case the border scales fine, but the face (with the filters) does not. So, then I tried applying scale-9 to both the parent and the nested face movieclip,I want to be able have the button self contained as a clip which I can pull from the library, drop on the stage, and scale without distortion - and so far, as mentioned,I can't figure out how the get the nested face, the one with the filters applied, to scale appropriately.
View 1 Replies
Aug 31, 2010
I'm having a problem trying to get some nested movie clips to play. I have three movie clips on three different layers all on frame one of the parent layer. each layer has a labIe (well just call it "layer1", "layer2. "layer3") I have a stop command on the parent level (on its own layer). each of the three movie clips has its own animation (the nested animation). The lower two have a stop command in their first frame(nested) so they wont play. Only the top movieclip would play on run. I want to place a gotoandplay command in the nested timeline of the above movie, that will start to play the next lower movie clip nested timeline, as the above one is ending, and repeat this process to cylce back around to the top movieclip. The overall goal is to have one animation move into the other using nested timeline smoothly.
View 1 Replies
Nov 27, 2011
I created a stage size 960 by 640, than i create a movieclip exactly the same size as the stage, but when i double click to get into the movieclip everything get smaller an object with 960 by 640 has reduce to 184by 140??? How do I get it back to the original size?
View 2 Replies
Jan 26, 2010
I have a main swf that loads an external swf (WNC.swf). The external swf (WNC.swf) contains a scrollPane that loads another external swf (WNC_DATA.swf). I'm trying to target the WNC_DATA.swf from the main swf, so I can tell it to go to frame (2). The following code targets the first child swf (WNC.swf), however I'm unable to target WNC_DATA.swf inside the scrollPane.
[Code]...
View 5 Replies
Jul 31, 2010
If -- draggable -- moivieClip_A is created, and then moivieCLip_B is created as a child of movieClip_A, (when movieClip_A is dragged onPress, movieClip_B simultaneously moves with it), is it possible to change a property of movieClip_B with a mouse event? Seems as though movieClip_A's layer position / mouse events are blocking mouse events for movieClip_B.
View 2 Replies
Aug 9, 2010
I have a container movieclip within another movieclip (this one being on the stage) and I am wanting to load a swf into that from the timeline on the stage. Is that possible?
View 4 Replies
Aug 31, 2010
I am trying to control a movieclip nested in a movie clip from the main timeline, but I can't seem to get it to work. I understand the "." dot notation, but it just isn't working.I googled the crap out of it, but nothing really.Attached is just a simple example I'm trying to get to work. The file is CS4 format.
View 9 Replies
Sep 1, 2010
This is probably a very simple solution, but I can't seem to find it online. Basically, I have a button that need to change a movieclip's frame in it's parent.So I tried:
ActionScript Code:
_parent.slideshowImages.gotoAndStop(2);
But it's not working! I know I'm getting to the right locaiton because _parent holds a variable, and I can access that just fine. But I for some reason can't access the movieclip at all.
Note: I can't upgrade to AS3 (What I'm used to) as this isn't my file.
View 9 Replies
Aug 15, 2011
what im trying to do here is to make subcategories to show images like this:
villas ---> villa1--->loadmovie: photo1
villa2--->loadmovie: photo2
interior--->interior1
[code]......
View 5 Replies