Stage Object Movie Positioning In Corner
hello,
does anyone have any advice on this. I am trying to make it so that when a fullscreen movie loads a movie clip is positioned in the top left corner of the full screen flash site. This code is on the first frame of my flash movie.
It works when i resize the window but not when the movie loads for the first time in an existing window. meaning some poeple cannot see the menu bar . does this code work on all browsers?
ActionScript Code: fscommand("allowscale", "false");Stage.scaleMode = "showALL";Stage.originalWidth = Stage.Width;Stage.originalHeight = Stage.Height;Stage.scaleMode = "noScale";Stage.getLeft = function() { return -1*(this.width-this.originalWidth)/2;};Stage.getTop = function() { return -1*(this.height-this.originalHeight)/2;};Stage.addListener(titleblocknav);Stage.addListener(preloader);titleblocknav.onResize = function() { this._x = Stage.getLeft()+50; this._y = Stage.getTop()+25;};preloader.onResize = function() { this._x = Stage.getLeft()+330; this._y = Stage.getTop()+48;};
can anyone spot any mistakes?
Thanks
Michael
ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 09-25-2005, 02:41 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Positioning My Attach.Movie On The Stage...
Im having a prob in positioning my MC to the stage, so far it sit hard in the top/left corner. Everything is working fine, just can't seem to wk out how to call it to position where I want it to.
I know this maybe it:
Code:
_root.my_clip._x = 0
Just not sure how to implement it into the code properly.....or...am I headeed in the wrong direction?
Code:
this.attachMovie("fond", "frame", cmpt++);
//loadjpg called when you click a button
loadjpg = function () {
detail.removeMovieClip()
// trace("load jpeg");
jpg._xscale = jpg._yscale=100;
// load the file corresponding to the button
jpg.loadMovie(this.image+".jpg");
_detail = this.detail
jpg._visible = true;
// check the loading
frame.onEnterFrame = function() {
if (jpg.getBytesTotal()>0 && jpg.getBytesLoaded() == jpg.getBytesTotal()) {
delete this.onEnterFrame;
jpg._visible = false;
jpg._x=3, this._x+borderThickness;
jpg._y=3, this._y+borderThickness;
Imported Movie Positioning On Stage.
I am very new to Flash MX. I have created a small movie, which I wish to use as my site logo.
I am able to import the movie into a new blank file, but unable to alter the position of the movie upon the stage. (It appears in the top left hand corner of the stage).
When I attempt to alter the position of the movie I seem to be moving only the first frame.
I would be grateful for a little advice / help regarding positioning, in simple terms please!
Thank you.
page.
P.S. I have tried searching the forums for an answer, without much luck. If you could supply a link to a helpful response that would be great.
Positioning Attached Movie To Stage
Im having a prob in positioning my frame to the stage, so far it sit hard in the top/left corner.
everything is working fine, just can't seem to wk out how to call it to position where I want it to.
I know this maybe it:
ActionScript Code:
_root.my_clip._x = 0
Just not sure how to implement it into the code properly.....or Im just totally wrong
ActionScript Code:
this.attachMovie("fond", "frame", cmpt++);
//loadjpg called when you click a button
loadjpg = function () {
detail.removeMovieClip()
// trace("load jpeg");
jpg._xscale = jpg._yscale=100;
// load the file corresponding to the button
jpg.loadMovie(this.image+".jpg");
_detail = this.detail
jpg._visible = true;
// check the loading
frame.onEnterFrame = function() {
if (jpg.getBytesTotal()>0 && jpg.getBytesLoaded() == jpg.getBytesTotal()) {
delete this.onEnterFrame;
jpg._visible = false;
jpg._x=3, this._x+borderThickness;
jpg._y=3, this._y+borderThickness;
thanks in advanced
Copy All Frames From Movie Clip To Stage Without Having Positioning Problems?
Is there a simple way to copy all my frames from a movieclip and paste the frames back onto the main stage/timeline?
The reason I want to do this is because when I want to make a movie say AVI, the timeline without the movie clip don't show up.
Also I want to use this in Powerpoint and make it replay, but it does not seem to work very well with the movie clip timeline? (it replays the main stage's timeline NOT the movice clipc timeline? - if there's a way around that, i'd like to know!)
Thank you so much for all of your help!
[F8] Stage Stuck In Top Left Corner
hi,
i know this is a flash 101 question but here it goes: when i go in to edit my movie clip the stage is stuck in the top left corner. its a pain to work like this...how do i get the stage to center in my document?
thanks!
[F8] Start Drag Not Functional In Corner Of Stage
I am having problems with dragging. Everything works fine until I drop my object ("pt1") in the bottom right hand corner of the stage (but not so low as to be inaccessible by mouse). Any suggestions? Also, I am a newbie...so any code clean-up suggestions would be appreciated
Code as follows:
var halfStgX:Number; var halfStgY:Number;
halfStgX = Stage.width/2; //half the stage width (550) is 275
halfStgY = 200 // defined half for vertical because of flash 8 bug
pt1.onPress = function(){
this.startDrag();
}
pt1.onRelease = function(){
this.stopDrag();
var pt1x = pt1._x;
var pt1y = pt1._y;
get_pos(pt1x,pt1y);
}
get_pos = function(pt1x,pt1y){ // to get the current position of the point
var labelx:Number; var labely:Number;
if(pt1x-halfStgX>205){ // if the point gets too far to the right, we need to move its coord label to the left
labelx = pt1x-60;
}else{
labelx = pt1x;
}
if(pt1y-halfStgY>150){ // if the point gets too to the bottom, we need to move its coord label up
labely = pt1y-25;
}else{
labely = pt1y+10;
}
print_coords(labelx,labely,pt1x,pt1y);
}
print_coords = function(labelx,labely,pt1x,pt1y){
_root.createTextField("pt_coords",1,labelx,labely, 100,100); // creat a text field at position given for label
pt1x = (pt1x-275)/10; // re-adjust the output such that middle of screen is (0,0)
pt1y = (200-pt1y)/10;
pt_coords.text = "("+pt1x+","+pt1y+")"; //text that gets printed each time
}
How To Get Top Left Stage Corner Coordinates After Resize?
hi,
is there maybe a way to get top left stage corner coordinates after resize?
or maybe get original stage size before resize? so i can calculate it.
i know that you can collect the width and height before it is resized but is it possible after?
Stage Stuck In Upper Left Corner
Yes, in 1 particular project, my stage is stuck in the upper left corner of
the work area. I must have hit a funky key. Anybody know what I did and/or
how to fix it?
Thanks in advance.
How To Get Top Left Stage Corner Coordinates After Resize?
hi,
is there maybe a way to get top left stage corner coordinates after resize?
or maybe get original stage size before resize? so i can calculate it.
i know that you can collect the width and height before it is resized but is it possible after?
--- sorry for the double post ---
Edited: 11/24/2007 at 06:21:04 PM by podlium
How To Get Top Left Stage Corner Coordinates After Resize?
hi,
is there maybe a way to get top left stage corner coordinates after resize?
or maybe get original stage size before resize? so i can calculate it.
i know that you can collect the width and height before it is resized but is it possible after?
--- sorry for the double post ---
Edited: 11/24/2007 at 06:21:28 PM by podlium
Resizing Stage From Center (not Upper Left Corner)
Using Flash 8.0 Pro...Is it possible to resize the stage from the center instead from the upper left corner? I've created a flash document, but it is smaller than I thought it would be, and now I have too much blank space around the objects that are centered on stage. When I change the size of the stage, the objects are no longer centered on stage. I really don't want to re-center all objects on the smaller stage. Thanks for your suggestion(s)...
Edited: 07/06/2007 at 08:24:33 AM by atrzebunia
Stop Auto Placing Image In Top Left Corner Of Stage
Can anyone help, I am loading a logo onto the stage using a button, the command is as follows
I have managed to call in an image from the image folder using a button, however it is placed in the top left hand corner.
Button 1 uses:
on (release) {
loadMovie("images\logo1.jpg", 1);
unloadMovieNum(2)
}
I want to make it so when i press the button using the As above the image is in the centre of the screen
stage size is 800x600
ANY IDEAS GUYS
Stage Object? Centering Movie
I just saw this featured link on the site that reminded me of something I've been wondering about in Flash. This is the link:
http://www.curvemusic.ca/
And I have seen other sites that do the same thing:
http://www.kurtnoble.com/
http://www.bukwild.com/
http://www.fabrislane.co.uk/launch.html
Basically, if you notice, the main part of the site is centered on the screen. But the entire page (including the background) is part of the flash file. If you resize your window it doesn't scale the movie, it just reveals more of the background and re-centers the content. Is this done using the stage object in actionscript? Can anyone provide an example or point me to a tutorial on how this is done?
Turn Circle Into Square, Corner After Corner...
I made a clip that will turn a circle (or disk) into a square that will then become a big rectangle on which I will display pictures. I wanted the disk to become a square corner after corner so I used shape interpolation. It worked with the first corner so I did the other 3 corners using 90° clockwise rotations. However, the 4 corner interpolation has a different behaviour. Can someone explain me how I could fix that?
Thanks a lot! ;-)
Here is the .swf
Here is the .fla
How Align In A Corner A MovieClip In A Swf With Stage.scaleMode = "showAll"?
How Align in a Corner a MovieClip in a swf with Stage.scaleMode = "showAll"?
In the Scalemode showAll the Stage.onResize not work...
I believe I find a solution, with a timer to a function change the scalemode to "noScale", and get the Stage.width and height, after change inmediately to scalemode "showAll", with this is possible know the actual Stage.wiidth and height - in the scalemode showAll the Stage.width and height not change although the window of IE resize -...
Is important because in various screen resolutions, a flash movie not work equal in scalemode showAll how in scalemode noScale...
I not have solutioned the problem completely but I believe in the next hours I have the final solution...
Is strange this problem not is solutioned, I search in many forums, articles, webs, and nothing, is a problem very common I believe:
how align a movieclip or any objet in a corner - corner of the body ie window, not of the flash movie - with Stage.scalemode = "showAll"...
Well, I write this same post in other thread, but I write now in a new thread for if any know the total solution...?
Positioning Mcs On A Stage
I want to set some movies on a stage, and I wanted to do it randomly; the only proble is that I want to avoid that those movies could intersecate each others. I should use a detection system, but I don't know how to do it, so if anyone knows where I can find some already done or give me any suggestion it'll be great.
TIA
Giano
[CS3] Positioning On Stage
If I draw a rectangle on the stage and look at the x and y coordinates they line up perfectly with what I expect the numbers to read... However I have a particular movie clip that when I drag it on the stage the numbers are all off. Positioning it to the left shows an x coordingate that is in the 300's and positioning to the right shows a x coordinate far bigger than the size of my stage.
what is happening here??
Help Me With Positioning SWF On Stage
Hi all,
On a site I am building I use the following code to exactly position an SWF on the stage of my main SWF:
on (release) {
_root.createEmptyMovieClip("loadingclip", 2);
loadMovie("images/logo1.swf", "loadingclip");
loadingclip._x = 175;
loadingclip._y = 250;
}
on (rollOut) {
_root.createEmptyMovieClip("loadingclip", 2);
removeMovieClip("images/logo1.swf");
The problem: it all works fine until you start clicking more erratically as some user do when they loose patience.
Then the movie starts playing closer to the area where you are clicking which closer to the top of the stage.
how can I make the SWF position itself exactly where I want it, but not encounter the issue I just mentioned.
thanks!
Importing SWF And Positioning On Stage..
Hi guys. My question might have already been answered in this forum but since it's a massive board-i don't have time to go searching--and i don't know the correct "search terms" i need to use in order to find what im looking for.
Suppose i create and export a SWF clip in a third party generator such as Flax, or Mix-FX--something of that or even a SWF file made by flash itself.
I want import that SWF movie in Flash MX--but when i do--a whole bunch of keyframes appear in my timeline. That is fine--and i understand why that happens..but here is my question..
How do i position of those key frames on my stage without individually moving all of them in the place i want. In other words..is there a way to move the entire imported movie clip to a different position? Can i create an internal "movie clip" with those frames and move the movie with a click of the mouse? Can i just move the entire layer with the keyframes and position the movie that way? (I don't know how to do this)
Please help!!
Best regards,
Pauley c.
Re-positioning Animations On The Stage
Let's say I've got a completed run cycle for a character, comprised of numerous layers, keyframes, tweens, etc. and I want to change the position of the whole thing to a different place on the stage. Even when I select all the frames in a layer, I can't move them all at once.
(Also, I don't just want to turn the thing into a movie clip symbol.)
I'm sure that I'm missing something very basic here...thanks to anyone who can fill me in.
Positioning After Stage Resize
Hey there,
this might be a trivial question, but anyway: what´s the best way to get all my elements correctly positioned again after changing the stage´s size? I´d like to avoid having to reset each and every keyframe to its new x/y values manually if possible...
Thanks,
Toby
Help Positioning External Swf On The Stage
Hey,
I am using loadClip to load an external swf into a movieclip on my main swf. The ext. swf is loading and playing just fine in the movieclip, however it's position is completely random on the stage. (It being pushed to the lower right side of the stage) Can anyone help me know why this is happening and what I can do to make sure the movieclip stays where I want it to stay?
Thanks. Here is the code I am using to load the ext. swf:
home1_mc._lockroot = true;
my_mcl.loadClip("movies/homeShow.swf", this.home1_mc);
Positioning Mc On Stage, Fixed Value
I want to say hi to everybody and I'll try to help too.
I visited this website EGO7.COM and I'm looking for the same alignment that this guy are using on theirs top bar, copyright info, logo and loader.
As you can see, the logo, its position, is fixed on the top left of the page. The copyright info is centered at the bottom of the page. The loader is on the top right of the page and the orange bar on the top its width value follows the size of your screen.
What I'm trying to do is almost the same...
Like, I will have a top and bottom bar in my SWF, the top and bottom bars has to resize automatically in his width value without changing the height value independently of my screen resolution (800x600 or 1024x768). I will have a logo on the top center of my SWF and a copyright info on the bottom center of the page.
Does anybody know what they did or can explain how can I do?
Maybe somebody saw a tutorial about. I don't know. something that can help me.
EGO7 WEBSITE
Thanks,
Marco
Positioning Clips On Stage With XML
I'm using an XML ticker to display testimonials from my customers, who are scattered all over the west to from WA to AZ. I also display a map next to this dynamic text area. I want to show a small clip on the map (like an animated map pin) to coincide with each tick of the text. You know, to show where the customer is located. Then disappear until the next testimonial comes up. Seems that assigning variables (_x,_y) in the XML is the way to do it, but don't know how. Newbie, please make this simple.
Positioning Images On Stage
Can any one help me! i thought this would be straight forward but it seems to of lost me now. Basically i am loading some data dynamically and want to position it like so (x = data)
x x x
x x x
x x x
etc...
but when i run the following code it does the following (again x = data)
x x xx x x
etc...
if (this.ref["bclip_"+i]._x<200) {
this.ref["bclip_"+i]._x = this.ref["bclip_"+(i-1)]._x+this.ref["bclip_"+(i-1)]._width+offset+13;
if (this.ref["bclip_"+i]._x>200) {
this.ref["bclip_"+i]._y = this.ref["bclip_"+(i-3)]._y+this.ref["bclip_"+(i-3)]._height+offset;
this.ref["bclip_"+i]._x = this.ref["bclip_"+(i-1)]._x+this.ref["bclip_"+(i-1)]._width+offset+13;
}
i thought i would just need to reset the x value so it goes back the original x position but if i do that it goes crazy.
Hopefully this makes sense if anyone could help... I would really like to learn why this is doing this and how i can fix it (or what i am doing wrong).
Thank you
Positioning MC Relative To The Stage Border
I have several mc's that I want to position about 20 pixels from the right side of the users browser regardless of how big the resize it. Does anybody have any ideas of how to do this. I have been trying to use something like this:
onClipEvent(enterFrame){
this._x = Stage.width - 100;
}
but that still doesn't position it 100 pixels left of the stages width.
any ideas would be greatly appreciated
Mike
Positioning A MC With A Button On The Main Stage
Hello and thanks in advanced! I have a MC within a MC(slider). I need to move (slider) using a button that is on the main stsage.
I have a button on the main stage button called buttonName, a Movie Clip named parentmc.
Inside parentmc I have a mc clip slider.
This is my script that is not working. I have this script in the first frame of movie clip called parentmc.
Code:
_root.buttonName.onRelease = function() {
_root.parentmc.slider.tx = 300;
_root.parentmc.slider.ty = 345;
_root.parentmc.slider.onEnterFrame = function() {
this._x += (this.tx-this._x)/2;
this._y += (this.ty-this._y)/2;
};
};
Any help would be nice!
Problem Positioning Movieclips On Stage, Please Help
hi,
im trying to give a number of movie clips positions on the stage using an array to name and index them and a for statement position them on the stage according to there index number. i feel i am getting close but just missing something out, the final two lines of code
photolist_x+" = "+intervals_x;
photolist_y+" = "+intervals_y;
when traced give
photo1._x = 0
photo1._y = 0
photo2._x = 110
photo2._y = 80
and so on for the rest of the movieclips, but it is not positioning the clips at these coordinates, how do i get flash to do what these lines read as?
this is the whole code...
//creating empty movie clips
this.createEmptyMovieClip("photo1", this.getNextHighestDepth());
this.createEmptyMovieClip("photo2", this.getNextHighestDepth());
this.createEmptyMovieClip("photo3", this.getNextHighestDepth());
this.createEmptyMovieClip("photo4", this.getNextHighestDepth());
this.createEmptyMovieClip("photo5", this.getNextHighestDepth());
//attaching movieclips
photo1.attachMovie("Test", "mcTest", this.getNextHighestDepth());
photo2.attachMovie("Test", "mcTest", this.getNextHighestDepth());
photo3.attachMovie("Test", "mcTest", this.getNextHighestDepth());
photo4.attachMovie("Test", "mcTest", this.getNextHighestDepth());
photo5.attachMovie("Test", "mcTest", this.getNextHighestDepth());
//array acting as list for movie clips
var photolist:Array = new Array();
//for statement adding names to array,
//i starts at one in this case because ("photo" + i) starts at photo1
for (var i:Number = 1; i<=5; i++) {
photolist.push("photo"+i);
//code for positioning movieclips on stage.
var intervals_x:Number = (i*(Stage.width/5));
var intervals_y:Number = (i*(Stage.height/5));
var photolist_x:String = photolist[i-1]+"._x";
var photolist_y:String = photolist[i-1]+"._y";
//these next two lines give , when traced
//photo1._x = 0
//photo1._y = 0
//photo2._x = 110
//photo2._y = 80
// and so on for the rest of the movieclips, but it is not positioning
// the clips at these coordinates, how do i get flash to do what thes
//lines read as?
photolist_x+" = "+intervals_x;
photolist_y+" = "+intervals_y;
}
thanks for any help,
BrownWarrior
Positioning By Stage.height Not Accurate?
Hi,
I'm trying to use Stage.height to lock a footer to the bottom of the stage using this:
addbar_mc._y = Stage.height-42;
(where 42 is the height of addbar_mc)
But the odd thing is that as I drag the browser window bigger and smaller, the footer bar, as I drag the window smaller, slides farther and farther AWAY from the bottom, and then as I drag the browser window larger, slides closer and closer to the bottom until it finally passes it and goes off stage. How is this possible? Shouldn't the stage bottom be the literal bottom of the browser window? any other suggestions for how to lock a 42px high bar to the bottom of the stage?
Any help MUCH appreciated.
Thanks!!
Positioning Buttons Always At The Bottom Of Stage
I have a group of 6 buttons which on my stage sit in the center and are 20 pixels from the bottom, I am trying to create a bit of a liquid layout, and the browser is going to be able to resized by the user. I want always for the buttons to stay at the bottom in the center of the browser 20 pixels from the bottom no matter wether it is resized too... any ideas?
Positioning Buttons Always At The Bottom Of Stage
I have a group of 6 buttons which on my stage sit in the center and are 20 pixels from the bottom, I am trying to create a bit of a liquid layout, and the browser is going to be able to resized by the user. I want always for the buttons to stay at the bottom in the center of the browser 20 pixels from the bottom no matter wether it is resized too... any ideas?
Flash Stage Resize And Positioning
I have a flash app located at
http://www.triniscene.com/tsv7/galleries/?page=flash
now I want the flash dimensions to set to any reasonable size dimension in the HTML...while the movie adapts to the Stage dimensions. The problem I am having seems to be a browser issue. While in IE the movie takes the upper left hand side...it doesn't in FF...
I have the stage set to Stage.scaleMode = 'noScale'; and then set the _x and _y to 0...
what is the issue with FF here and is there any work around?
Positioning Buttons Always At The Bottom Of Stage
I have a group of 6 buttons which on my stage sit in the center and are 20 pixels from the bottom, I am trying to create a bit of a liquid layout, and the browser is going to be able to resized by the user. I want always for the buttons to stay at the bottom in the center of the browser 20 pixels from the bottom no matter wether it is resized too... any ideas?
Positioning Buttons Always At The Bottom Of Stage
I have a group of 6 buttons which on my stage sit in the center and are 20 pixels from the bottom, I am trying to create a bit of a liquid layout, and the browser is going to be able to resized by the user. I want always for the buttons to stay at the bottom in the center of the browser 20 pixels from the bottom no matter wether it is resized too... any ideas?
Stage.width, Resizing, And Positioning? Going Crazy
Hi,
I'm trying to create a swf, that when resized will place a close button in the top right hand corner:
Code:
_____________________________________________
// _________________________________DETECTION
// Capture Flash stage dimensions...
stageW = Stage.width;
stageH = Stage.height;
// Move close button to top right hand corner
_root.closeButton._x = stageW;
_root.closeButton._y = stageH-StageH;
//
// Set noResize because we will handle
// resizing from now on...
Stage.scaleMode = "noScale";
//
// function to run when resized...
function stageResize() {
newWindowX = Stage.width;
newWindowY = Stage.height;
_root.closeButton._x = newWindowX;
_root.closeButton._y = newWindowY-NewWindowY;
}
// Add listener for the Stage.onResize event...
myListener = new Object();
myListener.onResize = function() {
stageResize();
};
Stage.addListener(myListener);
stageResize();
Code:
____________________________________________
What am I doing wrong? I've been racking my brain for hours on this!!!
TIA,
oldspirit
Positioning And Scaling A Movieclip In Relation To The Stage...
I'm using the "Full Browser Flash" technique and all is working well with one exception, I can't seem to get a movieclip to scale itself to the stage size and then animate.
Example:
I have a movieclip that spans the width of the stage. The code to implement this technique for the FBF stage is working. What I want to do is 1) detect what the size of the stage is, 2) position the movieclip off of the stage using the detected stage size [i.e.: (._x=0-Stage.width)] and 3) animate this movieclip from it's off screen location to it final position.
Let's say the stage size is detected to be 800 pixels wide. This would scale the movieclip to 800 pixels wide. Then the movieclip would be positioned off the stage at an x coordinate of -800. Then the movieclip would animate to the x coordinate of 0.
Make sense?
Please advise. Thanks.
Viewing Stage While Positioning Large Graphics
I am designing an app (800x600) which contains a large graphic (1600x1200) but am having trouble positioning it in relation to the stage. Is there a way of viewing the stage boundaries whilst designing?
Positioning Dynamically AttachedMovie Clips On The Stage
Hi all,
My eventual aim is to achieve an effect mirroring http://www.sorenhald.com/
I want to be able to:
1) attach an empty_mc to the stage
2) position it so it is in the middle of the stage, and...
3) within this empty_mc attach thumbnails_mc and position these thumbnails so they are spaced out equally horizontally one after the other.
My problem arises in positioning the attached thumbnails so they list in this fashion.
Code:
//attach the empty_mc and call it holder
this.attachMovie("empty_mc", "holder", 0);
//position the holder
_root.holder._x = Stage.width/2;
_root.holder._y = Stage.height/2;
//set up a loop so I can attach 10 squares(thumbnails)
total = 10;
for (i=0; i<total; i++) {
holder.attachMovie("square", "square"+i, 0);
//this is my problem line. how do i target the newly created variable and position it so it lists it next to one another
holder.squarei._x = i;
}
eventually, I will be replacing the total variable with this.firstChild.childNodes.length asthe thumbnails will be populated with xml data.
If anyone can give me any pointers it would be most helpful, I understand its probably very basic (just not for me!). If you need any more info to help clarify my problem let me know...
Cheers
Positioning And Temporarily Hiding Objects On The Stage
(Flash newbie here - bear with me...)
I have two graphic objects on the stage overlapping each other. The first I was able to position to the document boundaries just fine. When adding the second object, however, the first object covers the boundaries so I cannot see them to align the second object.
The question: Is it possible to temporarily hide an object on the stage so I can see the stage boundaries to position another? I don't see any options that will allow me to do this.
Thx!
Relative Movieclip Positioning To Stage Size
Heya,
I am looking for some code to enable a movieclip to reposition itself according to the stage size
so far I got the footer to resize itself according to stage size.
However I will have some text as well which is supposed to stay position x=10 and y= (depending on height of the stage)
Attach Code
Stage.align = "TL";
Stage.scaleMode = "noScale";
var stageListener:Object = new Object();
stageListener.onResize = function() {
var stageWidth:Number = Math.round(Stage.width);
var stageHeight:Number = Math.round(Stage.height);
trace("Stage size is now " + Stage.width + " by " + Stage.height);
footerBG_mc._width = stageWidth;
footerBG_mc._x = 0;
footerBG_mc._y = stageHeight-150;
footerLinks_mc._x = (stageWidth/2) - (footerLinks_mc._width/2) ;
footerLinks_mc._y = stageHeight-18;
text_mc._x = (stageWidth/2) - (wallPaper_mc._width/2);
[ Static x position and variable y position, according to stage size
};
Stage.addListener(stageListener);
stageListener.onResize();
Positioning Bg Image To Absolute Middle Of Stage?
hey peeps, im trying to achieve a Full Browser Flash and i want my bgimage to remain in the centre of the stage whilst other objects move round it depending on mouse movements but how would i go about centering the bgimage through AS??
Problem Positioning MovieClip Center Stage
Hi,
My stage dimensions are 400x400.
I've drawn a ball on the stage and sized it so its dimensions are 50x50.
I've then converted it to a MovieClip (registration point is set to center).
I've given the MovieClip and instance name of "gameBall" and set the x,y to 0.
In my actionscript panel I've entered the following code...
gameBall.x = stage.stageWidth / 2;
gameBall.y = stage.stageHeight / 2;
...which I would hope would position the MovieClip to the center of the screen but it doesn't. The x position is correct but the y position of the MovieClip is heigher than center.
I've managed to get this to work by adding the height of the ball again to the y position, for example...
gameBall.x = stage.stageWidth / 2;
gameBall.y = (stage.stageHeight / 2) + 50;
...but I don't really understand why this is?
Thanks!
Kind regards,
M.
A Second Attached Movie Comes At The X=0, Y=0 Corner
I made a movie and I have attached it successfully to the document by using "attachMovie. This movie should appear when I click on a button. The problem is that when I click a second time a second movie comes on x=0/y=0 corner of the frame.
Can anyone help me to fix this... This problem is killing...
Many thanx....
Positioning LoadMovieNum Object
Hi..
I have this problem where I should place the loaded video to a flash movie to a particular place. I have the line
loadMovieNum ("AnalogClock_4.swf", 1); and it works but it's located in the top-left corner.
How can I set the coordinates to that swf object?
thx
[MX04] Positioning Clips With Equal Spacing On Resizable Stage?
ok.. this one has got me..... I've been trying every different combination i can think of.
I'm attaching clips with a for loop, and after attached they slide into their proper place.
I CAN attach them and space them equally along the x-axis. What i can't seem to do, is attach the clips, and have them move to positions that are equally spaced apart from each other, AND ALSO CENTERED on the stage. Then calculations would also have to adjust with the Stage.onResize handler so they are always evenly spaced and centered. I should probably mention that the clips have a centered registration point as well.
For example, if i attach 4 clips, which have a width of 100, and my Stage.width is, say 700px.... how can i place the 4 clips an equal distance apart from each other, say 20px, and then have the group of the four clips centered on the stage?? (placing them inside another movieclip is not an option)
They also need to retain the even spacing, and stay centered if i resize the stage up or down....
Any thoughts?...
This will give you an idea of what i'm working with currently (the boxes will scale to various sizes eventually):
http://artofficialintel.com/flash_te...ring_menu.html
MC Positioning To Stage Borders In 100x100, Center Aligned Movies
I'm always using "100% x 100% noscale" settings while creating Flash sites. A few years ago I've learned how to position some movie clips to the stage borders. The only solution was to make "TL" movie align. But I like center align (don't ask why, I have some reasons). I tried to calculate right position with center align, but without success.
A few days ago I tried again and was surprised how simple the solution is. It's so simple that I don't believe no one uses it already, but I still haven't seen it anywhere.
This example is if you have movie clip 800x600 and 100x100 scene with center align.
PHP Code:
movie._y = Math.round((Stage.height/2-300)*-1);//topmovie._x = Math.round((Stage.width/2+400))-movieWidth;//rightmovie._y = Math.round((Stage.height/2+300))-movieHeight;//bottommovie._x = Math.round((Stage.width/2-400)*-1);//left
Skew Corner Points Of Movie Clip
Is there a way to skew the corner points of an MC so I can fake some 3D animation? The transform tool can only skew in limited directions. I need to be able to move actual corner points. I can use the sub selection tool to move the corner points of a shape but not an MC that I can see. I dont want to script it since it needs to work with an animation that was done in Maya and imported in.
Thanks for any help
Ralative Positioning A Flash Object
Hi there.
I'm having a problem with positioning a flash object in my site.
The flash object is sitting inside a div element with a relative position. The problem is the flash object is sometimes placed inside the div and sometimes align to the left end of the browser. I think it gut something to do with the swf file loading duration (maybe loaded after the page is already displayed.
You can see an example here:
http://ledesign.co.il/?q=he/node/36
comparing to this
http://ledesign.co.il/?q=en/node/33
Have someone experience this kind of troubles before ? Any ideas how to fix that issue ?
Browser Resize And Object Positioning
I'm currently attempting to make a function that repositions all my display objects on the screen anytime the user resizes the browser. At the moment I only have two objects created, a .FLV and a .PNG
I'm using BulkLoader for all my loading needs. My dilemma is this:
The .FLV repositions as intended perfectly when the browser is resized, but the .PNG will not reposition from it's original coordinates. I receive no errors when I debug. Any thoughts?
Code:
package port {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.net.*;
import br.com.stimuli.loading.*;
import caurina.transitions.*;
public class Portfolio extends MovieClip {
var loader : BulkLoader = new BulkLoader("main-site");
var bgVideo : Video = new Video(737, 600);
var rememberIcon : Bitmap = new Bitmap();
public function Portfolio() {
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
this.stage.addEventListener(Event.RESIZE, resizeHandler);
loader.add("background.flv", {type:"video", pausedAtStart:true});
loader.add("iconRemember.png", {id:"remember"});
loader.addEventListener(BulkLoader.COMPLETE, allLoaded);
loader.start();
}
public function allLoaded(e:Event):void {
bgVideo.x = (stage.stageWidth / 2) - (bgVideo.width / 2);
bgVideo.y = (stage.stageHeight / 2) - (bgVideo.height / 2);
var bgNS:NetStream = loader.getNetStream("background.flv");
bgVideo.attachNetStream(bgNS);
bgVideo.smoothing = true;
addChild(bgVideo);
bgNS.resume();
var rememberIcon : Bitmap = loader.getBitmap("remember")
rememberIcon.x = (stage.stageWidth / 2) - (rememberIcon.width / 2);
rememberIcon.y = (stage.stageHeight / 2) - (rememberIcon.height / 2);
addChild(rememberIcon);
}
public function resizeHandler(event:Event):void {
bgVideo.x = (stage.stageWidth / 2) - (bgVideo.width / 2);
bgVideo.y = (stage.stageHeight / 2) - (bgVideo.height / 2);
rememberIcon.x = (stage.stageWidth / 2) - (rememberIcon.width / 2);
rememberIcon.y = (stage.stageHeight / 2) - (rememberIcon.height / 2);
}
}
}
|