Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Align 1 MC To Bottom Left Of Other MC



Greetings been a while since I've posted here.I'm having a small problem with aligning movieclips. I have 2 movieclips.For examples sake let's call themblack_boxred_boxI need red_box to align to the bottom left of black_box. Now the code I'm using works when black_box lays on the 0 axis for both x and y. But since the positioning of these movieclips are dynamic I'm having problems.I'm almost sure I just need to add in the current x and y values into the equation but I simply can't figure it out
ActionScript Code:
red_box._y = black_box._height - red_box._height;red_box._x = black_box._width - black_box._width;
Thanks in advance.



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 11-01-2006, 09:45 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Align MC To Bottom Left (on Resize)
Hi - Im trying to recreate that floating corner tabe (like on sites that have one the FWA etc http://www.georgiew.de/)

im currently using the following code - but doesnt seem as smooth as others Ive seen - and also I cant seem to get it to align right Could somebody help explain where Im going wrong? thanks alot for your help



mcCornerLinks.onEnterFrame = function() {
this._y = (Stage.height)-120;
};
mcCornerLinks.onResize();

Align Center, Then Move (BL)Bottom Left?
Hello,

I have a little problem that I just can't figure out.

I have a movieclip that aligns center to the Stage when the swf is previewed.

However this movieclip has a button instance inside that when pressed moves the movieclip bottom left. Unfortunately, when I resize the preview window or browser, it snaps back dead center.

Is it possible to have a movieClip move Stage.align ="BL" when the movie first loaded that clip as Stage.align ="TL" ?

Heres my code thats on the first frame -

include "lmc_tween.as"

// SET MOVIE ALIGNMENT IN BROWSER
Stage.align = "TL";

//PREVENT FLASH MOVIE FROM RESIZING
Stage.scaleMode = "noScale";

// CREATE A LISTENER OBJECT
stageListener = new Object();

// ADDS METHODS TO STAGE LISTENER OBJECT
stageListener.onResize = function() {
moveLOGO();
};

// CREATE A LISTENER FOR stageListener OBJECT
Stage.addListener(stageListener);

// FUNCTION TO MOVE LOGO

moveLOGO = function () {
menuking.tween(["_x", "_y"], [Stage.width/2, Stage.height/2], 1.8, "easeOutElastic")

};

// RUN FUNCTION TO MOVE MCs
stageListener.onResize();

stop();


After pressing the logo this is the code below that makes it move down a tad bit left -

menuking.tween(["_x", "_y"], [Stage.width/4+150, Stage.height/4+300], 1.6, "easeOutElastic")

menuking is the name of the logo/movieClip that is being targeted.

However as you'll notice when you resize the browser, the logo snaps back to the center, when I would like it to actually move BL(bottom left) or sit at the new _x, _y coordinates.

Link - see here - Anyone have an idea how I would get this to work? I've tried a number of solutions and couldn't find anything via google or online that was helpful.

Thanks - Steve

Align Bottom?
I have a dynamic text box for multiple questions in a text. We would like to get the text box to align bottom (so the text is always at the bottom of the box no matter how much text is in the varriable). Is there a way to do this?

Align Navigation To Top Or Bottom
Hi Everyone,

Can anyone tell me how to align a symbol (movie clip of my navigation) to the top of my published movie? I also have navigation at the bottom i would like to align to the bottom as well. Any help would be greatly appreciated. I am exporting with flash 9 and publishing a full screen
movie.


Thanks in advance!!!!!!

Align MC's To The Top And Bottom Of The Stage
Hi, I'm a Flash ANIMATOR that tries to script in Flash :P

This is the case:

I have two MC's in a resizable stage. One of them have to be aligned to the TopCenter of the stage and the other to the BottomCenter. How do I set up a script to do this?

I've read through the Dynamic Layout Control tutorial, but that aligns all objects to only one place.


Thanks from Chris

Align MC Bottom Center Dynamically
I have a holder mc="holder" that loads an external mc="footer". I would like the footer mc to be dynamically center and aligned at the the bottom of the holder mc. The holder mc resizes it's self to fit the size of the browser window, that's why aligning the footer mc must be done dynamically.

I have a script that aligns the footer mc in the center of the holder mc. Now I just need to alter the script to align footer mc to the bottom.

I'm new to actionscript and could use some help.

///////// Aligns Footer MC to the center of the holder mc.


Stage.scaleMode = "noScale";

setProperty(mcFooter, _width, Stage.width);
setProperty(mcFooter, _height, Stage.height-90%);

var resizeListener:Object = new Object();
Stage.addListener(resizeListener);

resizeListener.onResize = function () {
setProperty(mcFooter, _width, Stage.width);
setProperty(mcFooter, _height, Stage.height);
}

Align The Text To The Bottom Of The Textarea
Hi,

I am loading text in to a textarea component and I would like to align the text to the bottom of the textarea. I have been searching and looking and it looks like it is not possible. Am I correct in assuming that it is not possible?

Thanks

Jonas

How To Align Graphic Symbols Along The Bottom?
In Flash 8 Professional, I'm creating some words one letter at a time, with each graphic-symbol letter in a different frame. I'd like to align the letters along the bottoms so that they’re even. I found that trying to eyeball the alignment doesn’t work, so I want to align each letter using the y-coordinate.

I took each letter, broke it apart, and then saved it as a graphic symbol with the alignment crosshairs in the lower left-hand corner. I assumed that if I gave all the letter-objects the same y-coordinate number, they would align where the crosshairs are, at the bottom. But look at what happened:....

Bottom Align Dynamic Text?
Is there a way to bottom align dynamic text in cs3. Or is there a way I could do this easily any help is appreciated.
Thanks
Randy

Automatically Align MC To Bottom Of Screen?
I don't even know if this is possible or not... but here goes:

I have my movie embedded with 100% width 100% height in order to take up the entire browser window. Now what I would like is a MC to automatically align itself so that it stays at the bottom edge of the browser and adjusts itself whenever the browser window is resized.

Wishful thinking?

Dynamic Text Align Bottom
Hi all,

Just a 'simple' question regarding aligning dynamic text to the bottom.
Here is what i have.

Textbox set to a fixed height/width and inside i have dynamic text (loaded through XML file).
What i would like to know is how i can align the text at the bottom.

I know CSS can be used, but how do i write just a simple code inside flash directly instead of having it read an external .css file ?

thank U

Dynamic Stage Align In The Bottom
Hello everybody !

i have a little problem about a MC.
- I put it on the stage
- I put an action script in my MC wich look like this:


ActionScript Code:


import mx.transitions.Tween;
this._y = align = "B";
var ecout:Object = new Object();
ecout.onResize = function() {
bouge();
};
Stage.addListener(ecout);
bouge = function () {
var myTween:Tween = new Tween(this, "_y", mx.transitions.easing.Strong.easeOut, this._y, align = "B", 1, true);
};





The MC dont move at all, and it isnt in the Bottom of my screen
i need help plz.

Automatically Align MC To Bottom Of Screen?
I don't even know if this is possible or not... but here goes:

I have my movie embedded with 100% width 100% height in order to take up the entire browser window. Now what I would like is a MC to automatically align itself so that it stays at the bottom edge of the browser and adjusts itself whenever the browser window is resized.

Wishful thinking?

Align Menu To Bottom Of Fullscreen Page
Does anyone know how to align a movie clip (menu) to the bottom of a page like the one used at this site:

http://www.leoburnett.com/

Align Bottom Of Dynamic Text Field Always To Same Place
Hi everyone,

hopefully someone can help me with the following problem: I need to align dynamic text always at a certain point at the bottom. As the size of this text field increases the bottom of the text field should always be at that point. So a way to let the textfield "grow" upwards would be perfect but since there is none my first try was the following:

myData = new LoadVars()
myData.load("data1.php") //php line
myData.ref = this
myData.onLoad = function(success){
if(success){
this.ref["Comments_txt1"].text = this["text1"]
//this.ref["holder_mc"+i].loadMovie(this["Image"+i])
} else trace("Error loading data")
}
Comments_txt1.autoSize = true;
kMyBottomYCoord = 200;
Comments_txt1._y = kMyBottomYCoord - Comments_txt1.textHeight;

The last line does not work. The text field stays always at the same place.
Wheras it did not make any difference if I used the detour with "kMyBottomYCoord" or just wrote:
Comments_txt1._y = 250 - Comments_txt1.textHeight;

Thanks in advance for any answers.

Help Making This Go From Left->right To Top->bottom
I would like to make the objects come from the top and go down the stage. The width of the movie is 500 and the height is 400.

Please and thanks.

for(x=1; x<4;x++)
{
_root["bigger"+x].onLoad = function(){
this._x = -(Random(100)+1);
this._y = Random(390) + 1;
}
// missiles on enter frame
_root["bigger"+x].onEnterFrame = function(){
if(this._x >= 550)
{
this._x = -(Random(100)+1);
this._y = Random(390) + 10;
}
this._x += 35;
// check for collisions
if(this.hitTest(myCar_mc2))
{
_root.myCar_mc2.nextFrame();

}
}

}

jorge

The Left, Bottom, Right And Top Of A Movie...
Hello, How do I find out the left, bottom, right and top of my movie/stage area? I have some actionscript which requires these facts for it to be able to use the side of the stage as boundarys. But I can't manage to get the l, b, r and t of my movie. Any helps would be great. Thanks.

How _rotation DIRECT To Top, Left, Right Or Bottom?
Hi!

Have a movie which follows another one! How can I rotate the second movie in the direction of the first movie!

I have no problem to find the direction to the movie!

BUT _rotation() want to have a raltive angel - anyone knows a possibility to rotate to special directions relativ to the screen?????

mfG

Jan

OnStage (Centering, Left/ Right, Top/ Bottom)
hi guys

i need help asap. i was viewing this onstage script from moock.org
and couldnt find out how i can center my onstage-objects (that are not being resized when you resize your explorer-window) and always stay in center relatively to the explorer window size. same with left/ right, top/ bottom. i should be able to say my "navigation" always to stay left-bottom when you resize the window so it doesnt disappear.

please help me asap. i would be so thankful. thanks

ps: i posted this twice in the mx & actionscript forum, because i didnt know where to ask exactly.

OnStage (Centering, Left/ Right, Top/Bottom)
hi guys

i need help asap. i was viewing this onstage script from moock.org
and couldnt find out how i can center my onstage-objects (that are not being resized when you resize your explorer-window) and always stay in center relatively to the explorer window size. same with left/ right, top/ bottom. i should be able to say my "navigation" always to stay left-bottom when you resize the window so it doesnt disappear.

please help me asap. i would be so thankful. thanks

ps: i posted this twice in the mx & actionscript forum, because i didnt know where to ask exactly.

Image Float Bottom Left?
Hey all,

I've created a movie that I want to run full screen on the viewer's computer. I'd also like to place a button on the stage that always displays in the bottom left corner of the the screen (adjusting itself when the screen is resized).

Is this possible?

Thanks.

Emty MC To Load Img Bottom Left
Want my empty movie clip to load the external image as if it were on the bottom left side of it. Loads as if it is the top left side right now. How do I change this? Thanx -J

Align To Left
Hey All,

ok i read through the post on how to make a full screen centered flash page without scalign whch helped, however i wasnt able to do it so i found another way (there must be somthign wrong with it that i havnt foudn out yet because it seems like a hell of a lot less code than what was in that thread).

What im doing, is using this code:

Stage.scaleMode = "noscale";

and then publishing the movie to 100% and it works beautifully - makes the stage centered and the background fill the screen. (maybe its a new function in flash 8)

But what i want to do is make everything left aligned not centered. any ideas? thanks

giles

edit: ok i understand why that simple cde wasnt used as it doesnt keep it centered when i resize the window

Im over my head! ok, how do i left align my flash page, and keep the flash background to fil the page! thanks.. (and i did try ready through the massive post but there ended up being so many different codes i just got confused)

thanks so much

Moviclip.startDrag(left,problem,right,bottom)
Hello everybody

I have a problem with the startDrag(movieclip) syntax.
here is my code :

on (press){
this.startDrag( 279, 27, 279,233);
}

but the result while playing is
left : 233
top : 0
right : 27
bottom :279

what I need is
left : 279
top : 27
right : 279
bottom : 233

I would be happy to know where is my error. Thanks a lot

Movie Clip To Absolute Bottom Left
Hi, I'm working on a tutorial that I saw on http://www.gotoAndLearn.com. It shows me how to put something in the absolute center

Quote:




loaderClip._x = Stage.width / 2;
loaderClip._y = Stage.height / 2;




But what If I want to put something in the absolute bottom left? I know it's not so hard but I can't get it to work or find my flash book! thanks

Liquid Flash Layout (Bottom Left Q)
Hi There!

I came across this tutorial on Liquid Flash Layouts:
http://www.tutorio.com/tutorial/liquid-flash-layout

Which is awesome. I learned a lot from it. But what I cannot understand is how to make it all work as (BL) - Bottom Left. I get everything but the center MC. It's just acting strange. Do I need some new value for that centered clip since I'm using BL?

Any input is apreciated

Cheers.

Full Screen Code Bottom Right Not Top Left
How can i get a Background picture to be full screen in Flash and then anchor the top left when resizing?

At the moment it anchors bottom right. My code is below.



Quote:




Stage.align = "TL";
Stage.scaleMode = "noScale";
bg.onResize = function() {
var imageAspectRatio = this._width/this._height;
var stageAspectRatio = Stage.width/Stage.height;
if (stageAspectRatio>=imageAspectRatio) {

this._width = Stage.width;
this._height = Stage.width/imageAspectRatio;
} else {

this._height = Stage.height;
this._width = Stage.height*imageAspectRatio;
}

this._x = Stage.width/2;
this._y = Stage.height/2;
};
Stage.addListener(bg);
bg.onResize();

Acquiring Browser Top-left And Right-bottom Points
Hello all,

How do I acquire to Top-Left and Right-Bottom corners of my browser window in stage coordinates when using stage.scaleMode = StageScaleMode.NO_SCALE and setting the stage to 100% on both width and height?

My main movieclip includes a sprite I wish to drag around the browser window viewport. I cannot seem to find a way to find those two points so that I can constraint the movement to the browser viewport.

Align Stage To The Left, How To?
I want flash banner to span acros the screen so I put width="100%" and Stage.scaleMode = "noScale"; ok. But, this way all its content is centered. I want it to stick on the left, and so I put this code in it:
ActionScript Code:
onEnterFrame = function () { _root._x = 0.5 * (750 /* original document width */ - Stage.width);}
This works. But the way this thing works when I resize browser window is far, very far from smooth. I tried to change it to
ActionScript Code:
onEnterFrame = function () { var rx = 0.5 * (750 - Stage.width); _root._x = rx + 0.1 /* or another number */ * (_root._x - rx);}
in a hope that such an easing would help, but it did not help at all So... I am wondering if there is some straightforward way to do this, like some hidden FLA setting, or some Stage/_root property, and if there is no, how the hell to script it?

Thanks for reading.

Making An Image Area Scroller - Pan Top, Left, Bottom, Right
hello all. i am in the middle of trying to figure out a way to make a movie pan (or scroll) top, left, bottom, and right as the user moves their mouse. any help on this topic would be very helpful. thanks.

Fullscreen 800 X 600, Doesn't Align Left
I have an 800 x 600 full screen website I've built in Flash; it works fine at that resolution, but at anything higher, the flash movie is more like its centered. I got it fullscreen by going to the publish settings, and setting dimensions for percent, 100% w, 100% h, and the quality to no scale. I also put in the following css under the header tag:

<style type="text/css">
<!--
body {
height: 100%;
width: 100%;
margin: 0;
}
-->
</style>

I want the movie to be aligned left regardless of resolution. Obviously I set the flash and html alignments to left, even tried <div align="left">, and no dice. Your help would be greatly appreciated!

Align Loaded JPEG In UILoader To Top Left?
Hi All,

Just wondering if there is anyway of aligning an image to the top left when loaded into a UILoader, that doesn't auto scale the JPEG?

Cheers

How To Make My Textbox Dynamic In Size But Anchored From The Bottom Left Corner
Got a dynamic textbox that I want to be fixed in width and increases in size upwards (i.e its anchored from its base) upon retrieving larger text.
Here's the code.
someone please help


Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;

var myShowXML = new XML();
myShowXML.ignoreWhite = true;
myShowXML.load("slideshow.xml");

myShowXML.onLoad = function() {
_root.myWidth = myShowXML.firstChild.attributes.width;
_root.myHeight = myShowXML.firstChild.attributes.height;
_root.mySpeed = myShowXML.firstChild.attributes.speed;

_root.myImages = myShowXML.firstChild.childNodes;
_root.myImagesNo = myImages.length;

createContainer();
callImages();

};


function createContainer() {
_root.createEmptyMovieClip("myContainer_mc",1);


myContainer_mc._x = 185;
myContainer_mc._y = 0;

}

function callImages() {

_root.myMCL = new MovieClipLoader();
_root.myPreloader = new Object();
_root.myMCL.addListener(_root.myPreloader);

_root.myClips_array = [];

_root.myPreloader.onLoadStart = function(target) {


_root.createTextField ("myText_txt",_root.getNextHighestDepth (),0,Stage.height-500,185,20);

_root.myText_txt.autoSize = "left";

_root.myText_txt.text = "test";

};

_root.myPreloader.onLoadProgress = function(target) {

_root.myText_txt.text = "Loading.. "+_root.myClips_array.length+"/"+_root.myImagesNo+" Completed";

};


_root.myPreloader.onLoadComplete = function(target) {

_root.myClips_array.push(target);
target._alpha = 0;

if (_root.myClips_array.length == _root.myImagesNo) {

_root.myText_txt._y = 470;
_root.target_mc = -1;
moveSlide();
myShowInt = setInterval(moveSlide, (_root.mySpeed*1000)+1000);


}

};

for (i=0; i<_root.myImagesNo; i++) {

temp_url = _root.myImages[i].attributes.url;
temp_mc = myContainer_mc.createEmptyMovieClip(i, myContainer_mc.getNextHighestDepth());

_root.myMCL.loadClip(temp_url,temp_mc);
}

}


function moveSlide() {

current_mc = _root.myClips_array[_root.target_mc];
new Tween(current_mc, "_alpha", Strong.easeOut, 100, 0, 1, true);

_root.target_mc++;

if (_root.target_mc>=_root.myImagesNo) {
_root.target_mc = 0;
}

_root.myText_txt.text = _root.myImages[target_mc].attributes.title;
next_mc = _root.myClips_array[_root.target_mc];
new Tween(next_mc, "_alpha", Strong.easeOut, 0, 100, 1, true);

}

Text Justified In Flash MX But Left Align When Previewing?
Hi,

I have a paragraph (static text) which is fully justified in Flash but when I preview in browser or just with the SWF file, the text is left justified. I'm using a true type font.

Can someone help, please?

Newbie here.

Thanks,

Luke

800 X 600 Flash Site, Full Screen Align Left
I've built a website and made it full screen, but at a low res like 800 x 600 I want it to align left, as in to the border of the actual flash movie. I've used the full screen flash tutorial by Michael Chen on this site, but don't knoew how to specify I always want it aligned left. Please help!!

Load Of Another Swf Align Whole Site To Upper Left Corner
Hello Kirupa forum!


I got a problem when loading another swf, the panosalado to be more exactely (an opensource for flash panoramas, based on papervision), but when I do that, all the site, once centered on the middle of the screen, re-aligns to upper left corner. Theres a way to keep the main site where he was after, in the center, and not in the upper left corner?

Im looking trought all the classes that does the panosalado thing, but I dont found anything yet.

800 X 600 Flash Site, Full Screen Align Left
I've built a website and made it full screen, but at a low res like 800 x 600 I want it to align left, as in to the border of the actual flash movie. I've used the full screen flash tutorial by Michael Chen on this site, but don't knoew how to specify I always want it aligned left. Please help!!

Align The Text In Text Field To The Bottom
Hi,

I have hyperlinks stored in an external text file which I load in to a textfield component in flash. Is it possible to align the text in text field to the bottom? I have been looking around but not been able to find a solution.
Any suggestions is most appreciated.


jonas

How Do People Middle Align Their Flash Sites Now Since V-align Code Doesn't Work?
Before, I was able to use the code v-align middle on my html page and my flash swf would align middle. Now that code does not work and it only works if I do not put doc info at the top of my html page, like xthml, etc.

How are people enabling their Flash site to always align center and middle.

Anyone have any codes that work or samples I could use.

Thanks!

Fullscreen / Align / Stage.align
Need help over here...

I got a fullscreen document.
The menu must always be aligned to the top left on every screen and
resolution size. So the following code

-->// Stage.align = "LT";
Stage.scaleMode = "noScale";

Now i want to align a MC always in centre on every screen and resolution size. I tried this code....

-->// this.attachMovie("backgrounMC", "backgrounMC", 1000000);
titleClip.onResize = function() {
this._x = Stage.width-(this._width+10);
this._y = -1;
};
Stage.addListener(backgrounMC);
this.backgrounMC.onResize();


Above code is not the right solution.....
Because of the Stage.align = "TL" it is hard to align my backgroundMC always to the centre on every screen and resolution size.

Does somebody knows a solution.....?
My menu must always be aligned to the top left, and my backgroundMC
must always be aligned to the centre no matter what resolution size or screen size.

Thanx in advance....

karlein

Flash Player 9 (CS3) Arabic Right-to-left (right To Left) Typing In Input Fields
Any input field (when typing arabic) should type right ot left rather than left to right.
Does ANY version of flash/flash player support right-to-left typing in arabic or any other right-to-left language.

I really urgently need an official answer saying yes or no.
I can see that flash supports arabic characters etc but as far as I can see it does not support the right-to-left typing.

Disabling Left Right Navigation Btn On Photogallery When No Image Left
hi flashers,

i hav a left right moving thumbnail gallery from xml, i need that on the last image image come on focus from the left side so automatically the left button will be disable or opacity goes 0 anything and same thing from right side also.

can anybody help me in that
or any related example to help me out.

regards
neeraj

Left-to-right Word Order In Right-to-left Languages
Does anyone produce flash movies in rtl languages, i.e. Arabic, Persian, Hebrew, etc.?

Have you ever come across a problem of reverse word order?

Embedding the font does not work in languages where characters need to be joined up to form words, i.e. Arabic, Persian, Urdu...

The only way to make these languages work in Flash is to use system fonts.

Normally, you would have two options for this: First, setting the font to a default font such as "_sans", "_serif" or "_typewriter" (why macromedia chooses not to use the correct term for this, which is "monospace", is another matter!), or second, setting the font to a commonly available font such as "Times New Roman" or "Verdana".

Both these options work for these languages on the Mac.
However on the PC, well, XP SP1, if you specify the font, as in set it to "Times New Roman" or "Verdana" or anything other than "_sans" or "_serif" for that matter, the space character is not recognised as a rtl character but as a ltr character and gets inserted to the right of the word rather than to the left and consequently reverses the word order!

In the case of Persian, and I think Urdu as well, the character "ی" (which is not used in Arabic) has the same effect as well. But because it can appear anywhere inside a word, it messes up the word it features in completely!

Is this problem familiar to anyone? And have you found a way around it?

No Top Or Bottom
Can anyone tell me how to get my site centerd and to make it so that i looks like it continues off the top and bottom of the browser window?

Hope someone can help.

Top And Bottom Of Mc
Simple question if you know it.
How to find the bottom and the top of a mc on the stage
I have got the bottom with this code but to find the top is what I need.

Code:
bottom=mc._height/2;

No Top Or Bottom
Can anyone tell me how to get my site centerd and to make it so that i looks like it continues off the top and bottom of the browser window?

Hope someone can help.

Bottom Up / Top Down
in the publish settings .... what do bottom up & top down mean?

Scroll Bar Not Going To Bottom
Scroll bar isnt going all the way down to the bottom -- its cutting out a few lines, anyone know why?

~DW~

Can 1 Mc Be On Top And Bottom Of Another Layer?
ok heres how i hav my layers setup:
||_| car / · · |
||_| map · · |
good enought rite? i have a "car" mc on the car layer and a "map" mc on the map layer. now is ther anyway that i can take an mc inside the "map" mc and place it ontop of the car layer during the movie?

Copyright © 2005-08 www.BigResource.com, All rights reserved