Stage Alignment
hi, Im making a simple flash site, and I made everything centered on stage, halfway through I needed more stage space so I made the width bigger, but now the first part of the site is off center. how can I scoot everything over so that its centered on stage?
FlashKit > Flash Help > Flash MX
Posted on: 08-23-2002, 06:35 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Stage Alignment
Ok, for my next stupid question. When i place an object on the stage and set the x,y coordinates to 00 they are no longer on the stage. For some reason the X,Y, 0,0 coordinates don;t match the rulers. I am sure there is probably some easy adjustment for this but darn if I can find it. Any help would be greatly appreciated.
Cheers
Premium
Stage Alignment
Im trying to figure out how to align different movie symbols to opposite sides of the browser edge. An example is www.mtvonedotzero.com
any ideas or suggestions???
I think this style looks really nice and clean.
Stage Alignment
hi, Im making a simple flash site, and I made everything centered on stage, halfway through I needed more stage space so I made the width bigger, but now the first part of the site is off center. how can I scoot everything over so that its centered on stage?
[F8] Basic Stage Alignment
Hi,
I've been using Flash for a while now but have a simple 101 question. My stage is appearing in the top left hand corner of the document instead of the center. How do I center the stage? So remedial but I can't figure out how to shift my workspace back to the center.
thanks!
Stage Alignment Question.
Hi guys, as you've probably noticed by some previous threads I'm trying to get my head around stage alignment at the mo. Just need a bit of advice. I need to align 4 seperate movie clips, one to each corner of the screen that obviously need to stay in the corners if the user resizes their browser. Is that possible and if so what would I ad to the below AS?
I'm using a pretty simple bit of AS to align the menu to the bottom of the screen, and I can align things to the bottom right:
ActionScript Code:
stop();
right._visible = false;
Stage.scaleMode = "noScale";
Stage.align = "TL";
alignSite = function ()
{
with (bottom)
{
_y = Stage.height;
_x = 0;
}
with (br_mc)
{
_y = Stage.height - br_mc._height;
_x = Stage.width;
}
};
resizer = new Object();
resizer.onResize = function ()
{
alignSite();
};
Stage.addListener(resizer);
alignSite();
for the sake of it I've named the mc's by what area they're in, so the mc's will be "tr_mc", "tl_mc", "br_mc", "bl_mc" and the menu being "bottom". So I just need to work out how to align each mc to its relevant corner, but I cant seem to get my head around it.. am I doing it completely the wrong way??
Thanks for your help guys.
Cheers Phil
Media Alignment On Stage
Hello, thanks for looking.
I have a playback component that I have scripted like this:
ActionScript Code:
on (release) {
flvPlayer.scaleX = 600;
flvPlayer.scaleY = 400;
flvPlayer.align = StageAlign.TOP_LEFT;
flvPlayer.maintainAspectRatio = true;
}
The align tag does not seem to be working, but the scale X&Y does.
Your help would be greatly appreciated.
Stage Alignment Problem Upon Scaling
I am having an issue with alignment within my flash file with a certain part of the flash. I setup a sample version of what I am having the issue with. You can view what I am talking about here: http://www.arteye.com/testme/ (this just emulates the problem I am having)
If you resize the browser when the section with the green box and red bar at the top, you will see they move to the center just like I would like. Next click on the red bar and this will take you to an example of a carousel script I am working with. Now if you resize this section - you will see that it is throwing the content hard to the left and really screwing things up. Why is this happening?
I know you guys are going to want to see code - so here is what I have in the main movie:
Code:
stop();
Stage.scaleMode = "noscale";
Stage.align = "TL";
import mx.transitions.Tween;
import mx.transitions.easing.*;
//Center movieClip reusable function
function centerMC(mc:MovieClip):Void {
mc._x = Math.floor((Stage.width - mc._width) / 2);
}
//Fade in or out reusable function
function fadeMc(mc:MovieClip, newAlpha:Number, duration:Number):Void {
var mcAlpha:Number = mc._alpha;
var fade:Tween = new Tween(mc, "_alpha", Regular.easeOut, mcAlpha, newAlpha, duration, false);
}
//Reposition elements
function reposition():Void {
centerMC(mcholder);
bkgScale();
};
Stage.addListener({onResize:reposition});
//Scale Background
function bkgScale():Void {
// This is the proportion (width/height) of the image
var imageScale:Number = bkgHolder._width/bkgHolder._height;
// This is the proportion (width/height) of the stage
var stageScale:Number = Stage.width/Stage.height;
// If the stage scale is bigger than the image scale the images width resizes to the stage
// width and the image height takes the stage proportion
if (stageScale>=imageScale) {
bkgHolder._width = Stage.width;
bkgHolder._height = Stage.width/imageScale;
// If the stage scale is smaller than the image scale the images height resizes to the stage
// height and the image width takes the stage proportion
} else {
bkgHolder._height = Stage.height;
bkgHolder._width = Stage.height*imageScale;
}
}
/////////////Loader//////////////////////
var loaderListener:Object = new Object();
//When loading starts turn the loaded clip alpha to 0
loaderListener.onLoadStart = function(mc:MovieClip):Void {
mc._alpha = 0;
};
//When the first frame of the loaded clip have been executed
loaderListener.onLoadInit = function(mc:MovieClip):Void {
//if it is the background
//scale background
//and load the external mc with a 1000 miliseconds delay
// so the appearing of the elements seem more smooth
if (mc == bkgHolder) {
bkgScale();
setTimeout(loadMc, 1300);
}
//if it is the external mc
//center it
else if (mc == mcholder) {
centerMC(mc);
}
//Tween the loaded alpha to 100
fadeMc(mc, 100, 28);
};
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(loaderListener);
//Load external MC
function loadMc():Void {
loader.loadClip("sgcore.swf", mcholder);
}
//Load background image
function loadBKG():Void {
loader.loadClip("background.jpg", bkgHolder);
}
//Start Loading
loadBKG();
Stage Alignment Problem Upon Scaling
I am having an issue with alignment within my flash file with a certain part of the flash. I setup a sample version of what I am having the issue with. You can view what I am talking about here: http://www.arteye.com/testme/ (this just emulates the problem I am having)
If you resize the browser when the section with the green box and red bar at the top, you will see they move to the center just like I would like. Next click on the red bar and this will take you to an example of a carousel script I am working with. Now if you resize this section - you will see that it is throwing the content hard to the left and really screwing things up. Why is this happening?
I know you guys are going to want to see code - so here is what I have in the main movie:
Code:
stop();
Stage.scaleMode = "noscale";
Stage.align = "TL";
import mx.transitions.Tween;
import mx.transitions.easing.*;
//Center movieClip reusable function
function centerMC(mc:MovieClip):Void {
mc._x = Math.floor((Stage.width - mc._width) / 2);
}
//Fade in or out reusable function
function fadeMc(mc:MovieClip, newAlpha:Number, duration:Number):Void {
var mcAlpha:Number = mc._alpha;
var fade:Tween = new Tween(mc, "_alpha", Regular.easeOut, mcAlpha, newAlpha, duration, false);
}
//Reposition elements
function reposition():Void {
centerMC(mcholder);
bkgScale();
};
Stage.addListener({onResize:reposition});
//Scale Background
function bkgScale():Void {
// This is the proportion (width/height) of the image
var imageScale:Number = bkgHolder._width/bkgHolder._height;
// This is the proportion (width/height) of the stage
var stageScale:Number = Stage.width/Stage.height;
// If the stage scale is bigger than the image scale the images width resizes to the stage
// width and the image height takes the stage proportion
if (stageScale>=imageScale) {
bkgHolder._width = Stage.width;
bkgHolder._height = Stage.width/imageScale;
// If the stage scale is smaller than the image scale the images height resizes to the stage
// height and the image width takes the stage proportion
} else {
bkgHolder._height = Stage.height;
bkgHolder._width = Stage.height*imageScale;
}
}
/////////////Loader//////////////////////
var loaderListener:Object = new Object();
//When loading starts turn the loaded clip alpha to 0
loaderListener.onLoadStart = function(mc:MovieClip):Void {
mc._alpha = 0;
};
//When the first frame of the loaded clip have been executed
loaderListener.onLoadInit = function(mc:MovieClip):Void {
//if it is the background
//scale background
//and load the external mc with a 1000 miliseconds delay
// so the appearing of the elements seem more smooth
if (mc == bkgHolder) {
bkgScale();
setTimeout(loadMc, 1300);
}
//if it is the external mc
//center it
else if (mc == mcholder) {
centerMC(mc);
}
//Tween the loaded alpha to 100
fadeMc(mc, 100, 28);
};
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(loaderListener);
//Load external MC
function loadMc():Void {
loader.loadClip("sgcore.swf", mcholder);
}
//Load background image
function loadBKG():Void {
loader.loadClip("background.jpg", bkgHolder);
}
//Start Loading
loadBKG();
Preload LoadVars, Stage/browser Alignment And Mailing List
Hey, I was wondering wether anyone could help me out with giving some feedback to users when using LoadVars to load .txt files, just in case there is a bit of a wait. I believe you can use getBytesLoaded and Total to trace the progress but i don't know how to apply it to LoadVars. Anyone help please?
Also i'm trying to publish my flash movie at 650 width 500 height and it will pop up in a browser of the same size, so i thought. I can't seem to get it tight to the edges and have to leave a gap which doesn't give a great effect, anyone know whats the best alignment and settings for that effect?
Also i've been trying to resurect an old mailing list code i found, but i don't have any experience in it.
The code can be found here, but i need to try and implement it as soon as possible but don't really know what the PHP means and how to create the database named correctly etc. I'm using PhpMysql.
Any help would be brilliant!
Thanks.
I'll post my site check soon just a few problems like this to iron out.
Thanks alot.
oh yeah, i tried to link to a long php url in one of my external .txt files, using HTML codes and because & is needed it didn't work, i tried using the & code which is supposed to read as "&" in a text file like that. That didn't work either, anyone experienced that before?
Alignment
How do I align objects? What I mean is, I have 4 separate text items and would like to align them (left) without doing it manually?
Thanks.
Swf Alignment
Is there anyway to get an SWF to fit exactly (no margins) into an html page? The only way I have been able to do this is to place the SWF into a layer. Otherwise I can get it to fit with a approx. 1/8 inch margin. Should I be happy with this? I really want an exact fit.
Thanks
Alignment Help
OK let's say my movie is in 500 by 500 pixels and let's say I have a text box 200 by 200 pixels. When I go to align the text I have in the text box that is 200 by 200 pixels how can I use the alignment buttons without it a aligning 500 by 500 and just the 200 by 200?
Alignment
i've got an html page which holds my swf file. i've managed to get the swf to be centred from left to right, but what i want to do is get it centred from top to bottom too. i just want the swf to sit in the absolute centre of the html page i.e. halfway between the left and right, and halfway between the top and the bottom. can anyone give me any clues what i need to do with the html? i've tried a few things.....
Alignment
i've got an html page which holds my swf file. i've managed to get the swf to be centred from left to right, but what i want to do is get it centred from top to bottom too. i just want the swf to sit in the absolute centre of the html page i.e. halfway between the left and right, and halfway between the top and the bottom. can anyone give me any clues what i need to do with the html? i've tried a few things.....
Alignment Off
I'm placing a graphic on the stage and when I test the movie it is off by one pixel down and to the left. I manually reset the graphic and it's misaligned on the stage, but then it looks correct in the tested movie.
I created the background and the graphic in the same document, so they are on the same size stage.
What is going on?
.swf Alignment
so iv completed my flash website and have the .swf file ready to become live on the web, but what do i do to have the website centred on the webpage everytime the website is visited.
an example is this website http://www.thechapel.co.uk/
many thanks
Kyle
XML Btn Alignment
Having some issues here with an xml button alignment
ActionScript Code:
private function _position():void {
//trace("reposition");
_bgBottom.width = stage.stageWidth;
_bgBottom.x = Math.ceil(stage.stageWidth/2);
_bgBottom.y = Math.ceil(stage.stageHeight - _bgBottom.height);
_menuContainer.x = Math.ceil(stage.stageHeight/2);
_menuContainer.y = Math.ceil(stage.align.LEFT);
//schedule for change to bg_mc and no resize
_contentMC.x = Math.ceil((stage.stageWidth/2)- (_contentMC.width/2 ));
_contentMC.y = Math.ceil((stage.stageHeight/2) - (_contentMC.height/2));
}
these were set to align obviously bottom center, I wanted them left center any ideas?
Alignment
My flash MX N E V E R put my swf in HTML on center, always in left. Even I set Flash alignment (horizontal and vertical) -CENTER and HTML alignment default. Where is my fault?
Alignment
i just finished making my flash site and aligned it in the center of my html page, but i noticed that the size doesn't adjust when i change the size of my web browser. can someone tell me what i have to add to my source for it to be automatically adjusted? here is a example how it should look like.
http://www.elementskateboards.com/
Alignment
i just finished making my flash site and aligned it in the center of my html page, but i noticed that the size doesn't adjust when i change the size of my web browser. can someone tell me what i have to add to my source for it to be automatically adjusted? here is a example how it should look like.
http://www.elementskateboards.com/
Alignment
i just finished making my flash site and aligned it in the center of my html page, but i noticed that the size doesn't adjust when i change the size of my web browser. can someone tell me what i have to add to my source for it to be automatically adjusted? here is a example how it should look like.
http://www.elementskateboards.com/
Xml Alignment
Look how this xml puuls data and aligns itself when the text is written.
How is this done, can any one expline?
http://amaztype.tha.jp/
Thanks in advanced..//
Alignment
When I use Stage.align = "T" or Stage.align = "TR", it moves the movie clip around on the preview swf but when I publish it and view it through html and my browser, it is in the same place. How come?
Alignment
How come when I use the align design panel the item I am aligning never aligns? It just doesn't move no matter what buttom I push? Any help would be greatly appreciated. Thanks
Movie Alignment
I've produced a square flash movie in Flash4 on my mac.
When I upload this onto the web I want it to appear in the centre of the browsers window and always fit to their individual screen size.
Do I need to add some code to my html file to acheieve this.
Alignment In Actoinscript
With this bit of code:
if ((_ymouse>200) && (_ymouse<270)) {
_root.bridge._yscale = _root.bridge._yscale-3;
}
if (_root.bridge._yscale<=30) {
_root.bridge._yscale = 30;
}
The bridge instance shrinks as the mouse enters the given coordinates.
Unfortunateley it only shrinks upwards, and I would like it to close in from the top and the bopttom, is this possible, or is there a way of keeping the instance centrally aligned on the vertical axis?
If you go to http://www.vulvair.co.uk/flashkit it should help, just move the mouse to the bottom of the image and you'll see the problem.
Text Alignment
Hi!!
First of all I REALLY want to thank everybody who answers these questions, no matter how stupid they may be! My boss actually thinks I know something about Flash!! All I know is this great forum, and you all have been a great help.
Having said that, here goes another stupid question.
I have placed a text box (with some small text in it) in a movie. In the the paragraph panel I chose to "justify" my text. The text aligned it self and looked good, but when I published the movie as HTML it got aligned left only! Is there a simple way to produce a justified text in HTML?
Thanks again!!
Alignment Of Symbols...?
Okay, I know this is a HUGE newbie-type question, but here goes...
When I try to test a newly-made movie clip, I end up viewing it way up in the top left corner of the screen. How do I set the properties of the clip itself so that it's not aligned to the top left corner, but rather to the center of the screen? It's very frustrating, any help would be greatly appreciated.
The Noodle
Text Alignment
obviously text automatically aligns horizonatally.
how do you align text to a circular path?
Alignment Of Oblects
Whats the easiest way to anchor events on different layers to the same starting point?
another silly question by,
srf
Movie Alignment
My flash movie will only center on the page... I want to align it to the left side of the browser. Someone PLEASE help! I have tried <*align=left> and <*left> etc etc -- Please help!
Alignment Problem
I am trying to design a banner for a website. The banner should start from the very far left top screen, but instead there is about a 5-10 pixel gap from the left side and top of the browser window. How do I make the banner flush with the window? Any help would be GREATLY APPRECIATED.
Ramon
MC Alignment In Library
How do you move the crosshairs in the Library? I am following along with the http://www.one-motion.com tutorials, with isometrics. The MC in his library shows the crosshairs at the top, mine always stays in the middle. I can't believe I am stuck on something like this.
thanks for any help
Publishing - Alignment?
Hi.
When I publish for a specific window size for web play, I always get a border (top and left) in browsers other than IE. I have the publish settings set to left/top and margins to zero in Front Page.
Maybe this is a FrontPage question. Not sure.
Thanks!
Alignment In A ScrollPane
Hello all,
I have the following code in Flash MX:
_root.createEmptyMovieClip("newMovie", 1);
for(var i = 0; i < 10; i++)
{
temp = newMovie.attachMovie("test_", ("test"+i), i+2);
temp._x = _root.scrollpane1._width/2 - (.5 * temp._width);
temp._y = i*75;
}
_root.scrollpane1.setScrollContent(newMovie);
This creates 10 movieclip elements in a new empty movieclip "newMovie" and places the content in a scrollpane. There is just one problem... no matter how much I change the value of _x for each element, the scrollpane always aligns the movieclips to the left side. I really want all of the elements centered in the pane. I've tried adjusting the alignment of newMovie.Stage with no success. Any suggestions to get these clips to align center??? Thanks in advance...
Karlin
Alignment Question
Is there a way to have a flash movie in the absolute center of a browser window, no matter the size of the users monitor?
Thanks in advnace
Alignment And Size
I need help on aligment and size of .swf files showing on the web. On publish settings I have it set to center horizontal and center veritcal. As for size I have it on Match movie.
But when I view it through the web its aligned on the top left corner. I even have an index.html file to center my front opening page and thats not working either.
How can I get it to center and get the size of the file to fill the whole screen?
Alignment Problems
I have been trying to align a box over a jpeg image,I have it aligned exactly in the workspace so that it fits into the jpeg seamlessly but as soon as I test the movie the box shifts about 2 pixels??? does anyone else had this problem and found a better solution than compensating for the displacement in the work area? Please Help?
My Flash Alignment
When I published my flash and ran the file it was on the left hand side. How can I make sure the flash is in the center?
Also
Any special way I should load this in to the PHP site?
Here is the site.
www.fearnoevilclan.com
I want the flash to load up and when user clicks "ENTER" goes right to front page.
Thanks
Prophecy
Difference In Alignment
Firstly, thank you to anyone who tries to help me with this.
I have sliced a template up and assembled it in flash. On the stage, everything looks fine when viewed at 100%. When I 'test movie' however, some sliced pieces of the template are a bit out of alignment and one slice has distorted in size.
I have tested the swf independently in Flash Player and even composed a html page to test it in Explorer and the same distortions occur.
Please can someone end my frustrations with this as I have put a lot of time into rectifying this without success.
BTW I use Flash 5 on a Mac.
Brett
Alignment Problems
Firstly, thank you to anyone who tries to help me with this.
I have sliced a template up and assembled it in flash. On the stage, everything looks fine when viewed at 100%. When I 'test movie' however, some sliced pieces of the template are a bit out of alignment and one slice has distorted in size.
I have tested the swf independently in Flash Player and even composed a html page to test it in Explorer and the same distortions occur.
Please can someone end my frustrations with this as I have put a lot of time into rectifying this without success.
BTW I use Flash 5 on a Mac.
Brett
Alignment And CreateTextField
I'm using a createTextField, and really it works great.
Except, if it's an input type, and I have the alignment set to anything but "left", then a person types inside it it still left justifys unless you "recreate" the mc using the text data after they typed it.
Here's my code:
code:
function bk_txt_text(comp) {
if (beenbkfont == "1") {
$bktxtfont = (_root.db_fontb.getSelectedItem().data);
} else {
$bktxtfont = "AntiqueOliT";
}
if (bktxt_place == "1") {
$bktxtx = $bktxtx;
$bktxty = $bktxty;
} else {
$bktxtx = "345";
$bktxty = "320";
}
if (_level0.btbeenalign != "1") {
_level0.back_txt_align = "center";
}
if (beenbktxttext == "1") {
$bk_txt_txt = _level0.bktxt;
} else {
$bk_txt_txt = "Your text here";
}
if (beentxtsizeb == "1") {
_level0.bts = _level0.btsx;
} else {
_level0.bts = 10;
}
//$bk_txt_txt = "Your text here";
_root.createTextField("bk_txt", 324, $bktxtx, $bktxty, 120, 70); // depth, x, y, width, height
txt_bk_myformat = new TextFormat();
txt_bk_myformat.size = _level0.bts;
txt_bk_myformat.color = 0x000000;
txt_bk_myformat.align = _level0.back_txt_align;
txt_bk_myformat.font = $bktxtfont;
txt_bk_myformat.bold = true;
txt_bk_myformat.bullet = false;
txt_bk_myformat.underline = false;
txt_bk_myformat.variable = "var_bk_txt";
bk_txt.embedFonts = true;
bk_txt.multiline = true;
bk_txt.wordWrap = true;
bk_txt.border = false;
bk_txt.type = "input";
bk_txt.text = $bk_txt_txt;
bk_txt.setTextFormat(txt_bk_myformat);
//
if (bktxtswitch == "1") {
setProperty("_root.bk_txt", _visible, "100");
} else {
setProperty("_root.bk_txt", _visible, "0");
}
//
bk_txt.onKillFocus = function() {
_level0.bktxt = bk_txt.text;
};
bk_txt.onSetFocus = function() {
_global.beenbktxttext = "1";
};
txt_bts_txt.text = _level0.bts;
//$btt = bk_txt.htmlText;
}
Yeah, I know it's kind of clumsy, but it's my 1st AS project.
And of course some of the variables are defined "off screen". Like level0.back_txt_align is defined using a radio button set with the options "left" "center" and "right".
Anyway my question is, is there a way when the centering is set to center or right, that the justify can BE that while it's clicked in and being typed in?
Thanks for any suggestions!!
Liam
Alignment And CreateTextField
(If this is a duplicate entry, my apologies. My browser crashed as I posted it the 1st time.)
I'm using a createTextField, and really it works great.
Except, if it's an input type, and I have the alignment set to anything but "left", then a person types inside it it still left justifys unless you "recreate" the mc using the text data after they typed it.
Here's my code:
code:
function bk_txt_text(comp) {
if (beenbkfont == "1") {
$bktxtfont = (_root.db_fontb.getSelectedItem().data);
} else {
$bktxtfont = "AntiqueOliT";
}
if (bktxt_place == "1") {
$bktxtx = $bktxtx;
$bktxty = $bktxty;
} else {
$bktxtx = "345";
$bktxty = "320";
}
if (_level0.btbeenalign != "1") {
_level0.back_txt_align = "center";
}
if (beenbktxttext == "1") {
$bk_txt_txt = _level0.bktxt;
} else {
$bk_txt_txt = "Your text here";
}
if (beentxtsizeb == "1") {
_level0.bts = _level0.btsx;
} else {
_level0.bts = 10;
}
//$bk_txt_txt = "Your text here";
_root.createTextField("bk_txt", 324, $bktxtx, $bktxty, 120, 70); // depth, x, y, width, height
txt_bk_myformat = new TextFormat();
txt_bk_myformat.size = _level0.bts;
txt_bk_myformat.color = 0x000000;
txt_bk_myformat.align = _level0.back_txt_align;
txt_bk_myformat.font = $bktxtfont;
txt_bk_myformat.bold = true;
txt_bk_myformat.bullet = false;
txt_bk_myformat.underline = false;
txt_bk_myformat.variable = "var_bk_txt";
bk_txt.embedFonts = true;
bk_txt.multiline = true;
bk_txt.wordWrap = true;
bk_txt.border = false;
bk_txt.type = "input";
bk_txt.text = $bk_txt_txt;
bk_txt.setTextFormat(txt_bk_myformat);
//
if (bktxtswitch == "1") {
setProperty("_root.bk_txt", _visible, "100");
} else {
setProperty("_root.bk_txt", _visible, "0");
}
//
bk_txt.onKillFocus = function() {
_level0.bktxt = bk_txt.text;
};
bk_txt.onSetFocus = function() {
_global.beenbktxttext = "1";
};
txt_bts_txt.text = _level0.bts;
//$btt = bk_txt.htmlText;
}
Yeah, I know it's kind of clumsy, but it's my 1st AS project.
And of course some of the variables are defined "off screen". Like level0.back_txt_align is defined using a radio button set with the options "left" "center" and "right".
Anyway my question is, is there a way when the centering is set to center or right, that the justify can BE that while it's clicked in and being typed in?
Thanks for any suggestions!!
Liam
Alignment And CreateTextField
I'm using a createTextField, and really it works great.
Except, if it's an input type, and I have the alignment set to anything but "left", then a person types inside it it still left justifys unless you "recreate" the mc using the text data after they typed it.
Here's my code:
code:
function bk_txt_text(comp) {
if (beenbkfont == "1") {
$bktxtfont = (_root.db_fontb.getSelectedItem().data);
} else {
$bktxtfont = "AntiqueOliT";
}
if (bktxt_place == "1") {
$bktxtx = $bktxtx;
$bktxty = $bktxty;
} else {
$bktxtx = "345";
$bktxty = "320";
}
if (_level0.btbeenalign != "1") {
_level0.back_txt_align = "center";
}
if (beenbktxttext == "1") {
$bk_txt_txt = _level0.bktxt;
} else {
$bk_txt_txt = "Your text here";
}
if (beentxtsizeb == "1") {
_level0.bts = _level0.btsx;
} else {
_level0.bts = 10;
}
//$bk_txt_txt = "Your text here";
_root.createTextField("bk_txt", 324, $bktxtx, $bktxty, 120, 70); // depth, x, y, width, height
txt_bk_myformat = new TextFormat();
txt_bk_myformat.size = _level0.bts;
txt_bk_myformat.color = 0x000000;
txt_bk_myformat.align = _level0.back_txt_align;
txt_bk_myformat.font = $bktxtfont;
txt_bk_myformat.bold = true;
txt_bk_myformat.bullet = false;
txt_bk_myformat.underline = false;
txt_bk_myformat.variable = "var_bk_txt";
bk_txt.embedFonts = true;
bk_txt.multiline = true;
bk_txt.wordWrap = true;
bk_txt.border = false;
bk_txt.type = "input";
bk_txt.text = $bk_txt_txt;
bk_txt.setTextFormat(txt_bk_myformat);
//
if (bktxtswitch == "1") {
setProperty("_root.bk_txt", _visible, "100");
} else {
setProperty("_root.bk_txt", _visible, "0");
}
//
bk_txt.onKillFocus = function() {
_level0.bktxt = bk_txt.text;
};
bk_txt.onSetFocus = function() {
_global.beenbktxttext = "1";
};
txt_bts_txt.text = _level0.bts;
//$btt = bk_txt.htmlText;
}
Yeah, I know it's kind of clumsy, but it's my 1st AS project.
And of course some of the variables are defined "off screen". Like level0.back_txt_align is defined using a radio button set with the options "left" "center" and "right".
Anyway my question is, is there a way when the centering is set to center or right, that the justify can BE that while it's clicked in and being typed in?
Thanks for any suggestions!!
Liam
Window Alignment
how do i get my hmtl to line up in the cmiddle instead of the top right,
i tried messing with all the settings but maybe i missed something
Window Alignment
how do i get my hmtl to line up in the cmiddle instead of the top right,
i tried messing with all the settings but maybe i missed something
Loadmovie Alignment
hello,
this may have been asked at one point. BUT
i'm futzing with the sample fla "load_images.fla" that comes with flash mx. works great, but can i have images load "centered" in the movie clip instead of the top left corner? I tried using free transform to move the center point but to no avail.
also if anyone is familiar with how to automate this example fla so that it automatically goes through the images and has a stop/start function you'd make my day
action script from the first frame of said fla
// initialize variables and properties
square._alpha = 0;
whichPic = 1;
// initiate change to new image when buttons are clicked
next.onPress = function() {
if (whichPic<50 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic++;
input = whichPic;
}
};
back.onPress = function() {
if (whichPic>1 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic--;
input = whichPic;
}
};
_root.onEnterFrame = function() {
// when a new Photo is selected, fade out, load new image, and fade in
if (square._alpha>10 && fadeOut) {
square._alpha -= 10;
}
if (square._alpha<10) {
loadMovie("images/IMG_"+whichPic+".jpg", "square");
fadeOut = false;
fadeIn = true;
}
if (square._alpha<100 && fadeIn && !fadeOut) {
square._alpha += 10;
} else {
fadeIn = false;
}
// initiate change to new image when Enter key is pressed
if (Key.isDown(Key.ENTER)) {
fadeOut = true;
whichpic = input;
}
};
// if a number is entered in the input field but Enter is not pressed, change
// back to current Photo number when clicking anywhere else
inputField.onKillFocus = function() {
input = whichPic;
};
Text Alignment
Is it possible to align text so it goes to the bottom insted of the top, i have looked at the settings and can only see left right justify etc. thanks
Alignment Issue Maybe?
Hmm... I wonder if there is anyway to troubleshoot flash changing the size of an imported bitmap. it doesnt always happen, well actually this would be the first time i noticed it. I made a layout in ps and imported a small slice that i wanted to add an animation to into flash. everything seemed fine, until i tried to replace the static slice with the newly animated one. I dont know whats wrong here. The stage dimensions are the same as the original image before its imported, but once its in flash, the program slightly alters the size and it no longer fits together with the rest of the slices when finally put together in a webpage.
i bet this is unique to just me. lol... Im prone to finding all the odd bugs in software. anyways.. if u can give me some sort of answer or explanation id like that..
|