New Symbols Always Centered On Stage
Hi,
This is probably something simple but its driving me nuts. Its an authoring mode preference problem (me thinks).
I'm working on a 1024 X 768 project and when I'm working on the stage on the main timeline I keep the rulers showing and 0,0 is near the top left and I can easily scroll over or hand grab over to the right side in the 1024 area. Everything is fine.
But when I create a new movie clip (F8) the stage is centered with 0,0 in the center and working area of about 1400 X 1400 pixels. So on the ruler the x -axis goes from about -700 to + 700. The problem is that I can't scroll or hand grab the stage and move it over.
Like I say, its driving me nuts. Anyone know how I can reset this?
Thanks, Randy
ActionScript.org Forums > Flash General Questions > Other Flash General Questions
Posted on: 05-31-2005, 05:06 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Load Swf Into Stage - But Centered How?
i want to load a swf file (gallery images) to a target placeholder mc.
the loaded mc is defaultly always TopLeft alligned. how can i center the clip?
(so that the gallery images are always centered on the stage)
Keeping The Stage Centered
i m using this script
var stageListener:Object = new Object ();
stageListener.onResize = function ()
{
stageSize_txt.text = "Stage.width:" + Stage.width + " Stage.height:" + Stage.height;
// position mc's
tl_mc._x = tl_mc._y = 0;
tr_mc._x = Stage.width - tr_mc._width;
tr_mc._y = 0;
bl_mc._x = 0;
bl_mc._y = Stage.height - bl_mc._height;
br_mc._x = Stage.width - br_mc._width;
br_mc._y = Stage.height - br_mc._height;
};
Stage.scaleMode = "noScale";
Stage.align = "TL";
Stage.addListener (stageListener);
// call resize function
stageListener.onResize();
in a full screen flash page, to keep some mc in the corners of the browser. and now my stage doesn't stay centered anymore. if i change Stage.align = "TL"; to Stage.align = "MC"; the stage will center itself, but the mc from the corners move with it to.can it be done?please help again
Papervision 3D: Does It Have To Be Centered On Stage?
I followed the cube tutorial as an intro to papervision and i've gone through the documentation but i can't find anything to indicate that the 3D object can be placed anywhere on the stage except dead center. is this true? if not, how can i do it?
**why Sliding Puzzle Won't Centered In The Middle Of The Stage?
Hey there,
I am working on a sliding puzzle. It is working fine on a 270 by 270 stage (canvas). But when I change the size of the stage to 550 x 400 it is not working when I try to center all the puzzle pieces to the center of the stage. The pieces jump into the previous original position (before I changed the size) which is on the top left side of the stage.
My pieces are 54x54 pixels. I have 15 pieces. 4 rows (4 pieces on the first three rows and 3 on the last one). Each piece is called cow with a number added. For example: cow1, cow2, cow3.. all way to cow15.
Overall, I only have two scripts in this project. One in the first frame and another one assigned to a movie clip called actions. The script below is the script in the first frame. I believe the problem is at the first two parts of the script which is as follows:
**Note: I've also tried puting "tileDist=_root.cow15.width" but it isn't working either.
function initGame () {
// set the horizontal and vertical distance
// between tiles
tileDist = _root.cow._width;
// set all tiles in exactly the right spot
for (x=1;x<=4;x++) {
for (y=0;y<=3;y++) {
tile = x+y*4;
_root["cow"+tile]._x = x*tileDist;
_root["cow"+tile]._y = y*tileDist+tileDist;
}
}
Multiple Images Centered Vertically On Stage
I have seen this other places and I wanted to know how it is done... I have a few rows of images and I want to center them on the page with a seperator they are pulled in dynamically from an xml list how can I get them vertically positioned on the stage?
Thanks ahead
Azteroth
Symbols Don't Go On The Stage
Hi!
I have a serious problem in my hands. I have made a series of symbols ( all movie clips ). Now that I want to place them on the main stage the Flash doesn't let me. When I try to drag & drop a symbol from the library to the stage I get a crossed circle. Why is this so, and how do I fix it?
Best Regards
George
Symbols Look Like Little Dots On Stage- Help
Hi.. I imported pngs as bitmaps for part of the animation and in trying to do everything "right" i converted them to graphic symbols (well all but two that will need a hyperlink so they are button symbols). When i converted them to symbols, i then deleted the pngs from the library in an effort to minimize what was already there in the file (the origionals are on my hard drive still though).
Now when i'm trying to bring instances of them into the timeline, they are just showing up as dots (also showing up as just dots in the library preview pane).. I tried reimporting the pngs to see if they needed to be there in an effort to see what i'm actually doing with no success.
I've never had this happen before... what did i do and how do i make it right?
Thanks,
Confused newbie
Symbols Dragged To Stage Are All The Same
I'm hoping you guys can help me with a problem that has me completely stumped. I've been working on a project for a month or so and all of a sudden, any symbol I drag from the library switches to a symbol of a grinning mouth, which is one of the symbols in the porject. Same thing happens if I copy and paste. There are 75 symbols in the project, if that is in any way significant. Anyway, that is my predicament.
Loading Mc Symbols To Stage
Hi, I have some actionscript that loads a movieclip symbol to the stage and positions it as so.
function DisplayContent() {
var newMovie:intro_info = new intro_info();
newMovie.x = 400;
newMovie.y = 315;
this.addChild(newMovie);
}
DisplayContent();
I would like to set up a button that loads a new mc symbol which will replace the symbol that has already been loaded from the script I have posted above. Can anyone help as I am still very much learning AS3 and my head is starting to hurt
Exchange Symbols On Stage Using Scripting
Is it possible to exchange a symbol with another using actionscript? For instance, a cat symbol is on the stage. I want this to become a rat. How can I make it possible by using actionscript?
Placing Symbols Randomly On The Stage
hi,
im making a game and want some symbols to appear on the screen in a different random place each time i load the game up. does anyone know what code to put on them to make this happen?
cheers
[CS3] Loading Symbols On Stage From The Library.
I have a bunch of graphic files that I want to load to the stage during runtime. I can't figure out what the code is to allow me to do this. I know how to load separate .swf's but have never worked with just loading something within the actual swf. Can someone give me at least a push in the right direction?
edit- wait so would the best way to do this is to make it a MC and add a linkage identifier? Is that the only way?
Stage Moves/Changes Size In MClips & Symbols
When you've set the size of your stage..mine for example is 559 X 264, you kind of wish it would look that way when you were editing/creating symbols/graphics/and movie clips.
But for me its not...its some other huge size in those modes and I always lose my place as to where I am scale wise and location wise.
Seems like sometimes the stage is cut off or shoved up next to the left side of the screen with no scrool bars to move left. I know this sounds weird but I know I am not a loon!
He he he.
I just want the stage to look the same size to me when I am working in my library objects. Is there some VIEW or WINDOW command that I don't know about.
Thanks in adavance to all you pros out there!!
~Wendy
Puting Movie Clip Symbols Onto Stage?
when i try to put my movie clip symbol on stage it just shows the first frame and not the others.
can anyone help?
sorry if this is a stupid question but theres apparently no such thing
Interface With On Stage Symbols From External Classes?
Hello. This is my third attempt. I broke this to the most simplest form and I cannot get it. I have an external class InterAction.as I have a MovieClip on the stage named PressMe_MC. I am trying to access it so I can make it a button or change color.
Code:
package
{
import flash.display.Sprite;
import flash.display.DisplayObject;
import flash.events.MouseEvent;
public class InterAction extends Sprite
{
public var Path:Sprite = new Sprite();
public function InterAction()
{
trace("InterAction Class");
//var Container:Sprite = new Sprite();
//Path.name = "PressMe_MC";
addChild(Path);
//var target:DisplayObject = this.stage.getChildByName(getChildByName("PressMe_MC"));
//trace(getChildIndex(target)); // 0
}
public function addPathMC():void
{
Path.addChild(this.stage.getChildByName("PressMe_MC")); //make sure you assign a name to your pathMc
}
}
}
On the first frame on the stage
Code:
import InterAction;
var DoInteract:InterAction = new InterAction();
addChild(DoInteract);
DoInteract.addPathMC();
this is the error I am getting
InterAction Class
TypeError: Error #2007: Parameter child must be non-null.
at flash.display:isplayObjectContainer/addChild()
at InterAction/addPathMC()
at Main1_fla::MainTimeline/Main1_fla::frame1()
Interface With On Stage Symbols From External Classes?
Hello. This is my third attempt. I broke this to the most simplest form and I cannot get it. I have an external class InterAction.as I have a MovieClip on the stage named PressMe_MC. I am trying to access it so I can make it a button or change color.
Code:
package
{
import flash.display.Sprite;
import flash.display.DisplayObject;
import flash.events.MouseEvent;
public class InterAction extends Sprite
{
public var Path:Sprite = new Sprite();
public function InterAction()
{
trace("InterAction Class");
//var Container:Sprite = new Sprite();
//Path.name = "PressMe_MC";
addChild(Path);
//var target:DisplayObject = this.stage.getChildByName(getChildByName("PressMe_MC"));
//trace(getChildIndex(target)); // 0
}
public function addPathMC():void
{
Path.addChild(this.stage.getChildByName("PressMe_MC")); //make sure you assign a name to your pathMc
}
}
}
On the first frame on the stage
Code:
import InterAction;
var DoInteract:InterAction = new InterAction();
addChild(DoInteract);
DoInteract.addPathMC();
this is the error I am getting
InterAction Class
TypeError: Error #2007: Parameter child must be non-null.
at flash.display:isplayObjectContainer/addChild()
at InterAction/addPathMC()
at Main1_fla::MainTimeline/Main1_fla::frame1()
Help: Use Actionscript 2 To Manage On Stage Movieclip Symbols
I'm developing a site which I want to display certain number of moviclip symbols which are already in stage. Let's say they're named "holder1", "holder2",..."holder15".
As a result of a query to a database if I have 2 results I would like to display only "holder1" and "holder2".
One of the solutions I've thought is to use a switch case routine, that depending on the number of results of the query display the number of "holders", but imagine the amount of code this would require.
Is there a better way to do this ?
Thanks
lmvalenzuela
Apply Gradient Fills To Symbols On The Stage
Hi!
Is it possible to apply trough ActionScript 2 gradient fills to a symbols on the stage?
I use the MovieClip.beginGradientFill method to apply gradient fills to symbols that are drawn through ActionScript and I wonder if it's possible to apply in a similar way gradient fills to symbols that are on the stage.
Any help would be fantastic!
Centered Xml Images / Centered OnResize
I am loading xml images, while also trying to center them onResize.
In this tutorial: http://www.kirupa.com/developer/mx20...otogallery.htm the images are all the same size, are being loaded into a static movieclip, and are aligned to the Top Left corner.
What I am trying to do is load different size images into a movie clip which stays centered on resize (i'm making a fullscreen flash site), while also loading each individual image centered within that clip (instead of the default top left).
Here is the code I am using for postioning the MC onResize:
Code:
mainInit();
function mainInit() {
// Set alignment and scale to allow onResize to work.
//Stage.align = "LT";
//Stage.scaleMode = "noScale";
// Create the title clip.
this.attachMovie("picture", "picture", 10);
// Keeps the title clip in place when the movie is resized.
picture.onResize = function() {
this._y = Stage.height-(picture._height/2);
this._x = Stage.width-(picture._width/2);
};
// Register titleClip to be notified when movie is resized.
Stage.addListener(picture);
// Set initial position of title clip.
this.picture.onResize();
}
I tested the following code (given to me by 'The Canadian' - thanks!) - within the xml onload function using that tutorial and it would not work with the first image, and seemed to only work properly 90% of the time:
Code:
picture._x = (Stage.width / 2) - (picture._width / 2);
picture._y = (Stage.height / 2) - (picture._height / 2);
...So, my question is does anyone know how to load center aligned variable size images, while also calling the movieclip to center onResize. I have tried everything I can think of and cannot get it working properly...
Editing Graphic Symbols By Copying And Pasting To Make Slightly Dif Symbols
Hi!
I am using flash to create moving people symbols. I created a "singular person" symbol and saved it, I then copyed a few to make a "bunch of people" symbol, when I go to edit these copyed and pasted symbols each saved symbol changes. Also I am saving them as graphic symbols at the moment.
thanks,
Helen
Overlapping Symbols Inside Symbols With An Alpha Tween
Hello,
In the attached example, Is it possible to prevent the purple overlap area from showing and just be red since red's on top? I have characters that use symbols for arms, legs, etc. and I want to fade them in and out sometimes. The problem is, the areas where the limbs overlap look weird so I have to resort to converting them to shapes on one keyframe. This seems limiting and annoying. I was wondering if there's a command, extension, or property to fix this. Thanks in advance.
Is It Not Possible To Assign Instance Names To Symbols Within Symbols In Flash CS3?
Detail question on nha khoa Adobe group
OK, so I have a player object. I created a symbol that is linked to the player. Inside the symbol I have 2 symbols. 1 is the sprite that displays the player, the other is a rectangle box that is used for collision detection.
I tried giving the collision box an instance name in the property editor so I could reference the collision box from code. The Player symbol is linked to a Player class I wrote earlier so it creates an instance of the Player class. The error I get is this:
ReferenceError: Error #1056: Cannot create property myCollBox on Player.
myCollBox was the instance name I gave that collision box symbol. I thought maybe I had to make the collision box also linked to a class to be exported for action script, but that didn't seem to help.
Graphic Symbols And Movie Clip Symbols
what is the difference between creating a graphic symbol from an image with it's own timeline animation and creating a movie clip symbol from the same image that can be animated in the main timeline?
Or do I totally misunderstand the difference between the two?
Movie Symbols Vs Graphic Symbols
to movie or to graphics?
I remmember in flash 5 movie symbols compiled smaller than gaphic symbols. is that still the case in Flash MX?
Graphic Symbols Vs Movie Symbols
to graphic or to movie?
I remmember in flash 5 movie symbols used to compile smaller than graphic symbols...is that sitll the case in flash MX?
Listeners On Symbols With Symbols Inside Of Them?
I have a symbol (a) with a symbol (b) inside. I have a rollover listener on symbol (a) however, when I roll over symbol b inside of symbol a I loose my "MOUSE_OVER".
It is as if symbol b stops its parent from being considered "rolled over"
Am I building these wrong? or mis-understanding something?
I need it so that the rollover for symbol a works no matter what is inside it.
Thanks!
Button Symbols Inside Button Symbols
Can someone correct me if I am wrong... but I want to confirm that button symbols cannot be placed inside the rollover frames for other button symbols(?)
I was making a button roll over effect.
Btn Symbol 1 (the primary) needed an 'over' image, so I made Btn Symbol 2 and place it on the keyframe; however, the rollover effect would only work if used the original bitmap OR a Graphic Symbol in the 'over' frame for the button.
Just wanted to make sure I was understanding this correctly - basically, that you can't place button symbols inside the rollover frames for a button symbol.
Thanks...
Unhappy Adjusting Columns And Rows On Stage Resize, According To Stage.width.
Hey fello flashers,
what i'm trying to achieve can be seen here, at the FWA's website.
When you resize the browser window the thumbnails rows and columns adjust accordingly to fit.I've managed to attach the thumbnails correct when my enableButtons() function is called but i'm unsure how to approach resizing.
if anyone has encounted this problem before or can help, then pls do i'm a little confounded on this one.
thanks
cam
Stage.align = "TL";
var numberOfGalleries:Number = 20;
var thumbMarginX:Number = 163;
var thumbMarginY:Number = 109;
function init():Void {
enableButtons(numberOfGalleries);
resizeStage();
}
function enableButtons(numberOfGalleries:Number):Void {
currentRow = 0;
currentColumn = 0;
for (i=0; i<numberOfGalleries; i++) {
tracker = i;
thumbsDisplayer = this.createEmptyMovieClip("thumbsDisplayer_mc", this.getNextHighestDepth());
currentThumbnail = thumbsDisplayer.attachMovie("thumbnail holder", "thumbnail"+(tracker+1), thumbsDisplayer.getNextHighestDepth());
currentThumbnail._x = currentColumn*thumbMarginX;
currentThumbnail._y = currentRow*thumbMarginY;
currentColumn++;
if (currentThumbnail._x>(Stage.width-(currentThumbnail._width + thumbMarginX))) {
currentRow++;
currentColumn = 0;
}
}
}
function resizeStage() {
var myListener:Object = new Object();
myListener.onResize = function(e:Object):Void {
//
}
Stage.addListener(myListener);
}
init();
Create Array On Stage, Mathematically Referring To Objects On The Stage
Ok what I want to do is create a set of small images on the stage and name them sequentially like you would an array, then refer to them mathematically in actionscript. I tried naming them as an array but it says that the name is reserved for the system or something. Does anyone know how to get an array of objects onto the stage, or have an idea of something else I could do to get the same effect?
Create Array On Stage, Mathematically Referring To Objects On The Stage
Ok what I want to do is create a set of small images on the stage and name them sequentially like you would an array, then refer to them mathematically in actionscript. I tried naming them as an array but it says that the name is reserved for the system or something. Does anyone know how to get an array of objects onto the stage, or have an idea of something else I could do to get the same effect?
Stage.width And Stage.height Not Matching Document Settings?
Ok, so I have no idea why this would be happening and its driving me nuts. I have my Flash movie size set to 960x650. However, when I trace stage.width and stage.height, I get:
950.05x630
Why in the world would this be happening? It's screwing up all the work I'm trying to put into positioning elements relative to the stage size. Thanks for any help!
Centered Box BOx BOX
I want to create an html page with a box smack dab in the middle of the page. This box will contain flash and static elements? how would i do this? css maybe?
Swf Centered ?
Hi. Im working on flash 5 and i want to know how can I put center (middle) on html my movie SWF.
the next website is an example that i want,
http://www.hercules.com if we make maximun the window the SWF always in middle center. please help-
thanks
Centered Pop-up
I have the following flash action, to center (vertically and horizontally) a pop-up window... I've been trying to find an answer, to how I would do the same thing in html, as I've changed the homepage that is home to a pop-up flash site from an swf to html... currently, the pop-up I have at the site works, but it doesn't center it, and I don't know enough html to know where to start... the site is... www.onenovember.com if that helps...
on (release) {
getURL ("javascript:NewWindow=window.open('http://www.onenovember.com/convergence.html','newWin','width=700,height=700,l eft=0,top=0,toolbar=No,location=No,scrollbars=No,s tatus=No,resizable=No,fullscreen=No'); NewWindow.focus(); screen_height = window.screen.availHeight; screen_width = window.screen.availWidth; left_point = parseInt(screen_width/2)-(700/2); top_point = parseInt(screen_height/2)-(700/2); setTimeout('NewWindow.moveTo(left_point,top_point) ',100); void(0);");
}
Why Is It Not Centered ?
Please help me...
I am trying to center a movie horizontally and vertically on my HTML site. In the Publish Settings I have the Flash Align set to Center, Center. Still, the Flash is always on the left side of the web page...
What do I do wrong ?!
Pop Up Not Centered
My pop up is off center. Below is the script I am using
Here is the link- Hit any movie in the movie section - thanks
www.imediastudios.com
on (release) {
getURL("javascriptpenWindow('"+name+"56.html','p opup',240,125);");
}
And on the html I have
<script type="text/javascript">
<!--
function openWindow(url,name,w,h) {
xPos = (screen.width - w) / 2;
yPos = (screen.height - h) / 2;
config = 'left=' + xPos + ',screenX=' + xPos + ',top=' + yPos + ',screenY=' + yPos + ',width=' + w + ',height=' + h;
newWindow = window.open(url, name, config);
}
//-->
</script>
Centered Pop Up
In using the tutorial for the 'centered pop-up' found on this site, I have encountered a repeating problem. It goes like this:
MainPage > button loads movie that contains more buttons.
The new buttons then utilizes the 'centered pop-up' to load the individual windows of the site.
On the first time through the site, the button for the pop up will be pushed & the main page will go blank and give a syntax error, never popping up the pop up.
Refresh page & second time through this will not happen, everything loads as it should - no errors.
What is this & where is it coming from?
Centered Pop Up
ok so i got this all working fine as long as i publish it in "html" but why wont it work as just a ".swf" movie.
i will pop up the window but it never gets the file i want it to load.....
why is that?
Centered? I Think Not
for some reason my flash movie won't center in this pop up window..
http://www.geocities.com/lostinbeta/
any ideas?
Stage.height And Stage.width Erratic Values?
Hey folks,
I was wondering if it happens in all Flash everywhere, or just in mine:
When I trace Stage.height and Stage.width, I always get erratic values:
Stage.height gets me always 4 pixels less than real
Stage.height gets me always 104 pixels less than real
This, way if my stage has 760 x 400, it will return values 756 x 296.
Anybody knows why?
Thanks!
F8 Movieclip Change On Stage Causes The Entire Stage To Dissapear
I have my stage with a background picture.
On stage left are buttons, and on stage right I have a movieclip (mc_Preview).
When the user puts his mouse over each button I would like the movieclip to move to a different frame.
the problem is when the mouse moves over a button, i see the movieclip move but then the entire stage dissappears and turns a few shades of gray.
Does this sound familiar to anyone?
Any help would be greatly appreciated!
External MC Loaded On Stage, I Can Press Buttons That Are On The Stage Through It...
I'm used to AS3, and I don't have much experience in AS2. I'm trying to modify an older flash file done in AS2.
An external swf is loaded using this code...
ActionScript Code:
on(release) {
loadMovieNum("supplimental/external.swf", 500);
}
The problem is that even though this external movie covers the whole stage, My mouse can still "see" buttons that are on the stage, and I can click them. I don't want to be able to click the buttons through my external movie. Thanks for any help.
Stage.width, Stage.height, Add.Listeners Problem
Hi
i found the way yesterday to ensure my mc stays full screen. now i want to animate the same mc if i can in reaction to a button click.
not sure how this next step goes. do i need another addlistener to the background mc that im tweening ?
kindly check the .fla. to see what i mean.
its very rough cut but hopefully you can get the gist of it.
when the text button is clicked, the bg reverts to the top left of the screen.
thanks
-dj
MX2004 -- Stage.height And Stage.width Different From Mac To Windows
I have a really strange problem that is ruining my movie. I have set the size of the stage to 450px by 400px in the properties dialog. In my actionscript, I've got all kinds of things that rely on Stage.width. So, I developed everything in MX2004 on Mac, and everything worked swimmingly. So, I opened up the exact same file in MX2004 and everything is placed wrong on the stage. So when I did a trace of Stage.width, I got 940px, and a trace of Stage.height gave me a figure of 763 pixels. If I do the same traces on the Mac, I get what I expect, 450px for width and 400px for height. Does anybody have any ideas as to what might cause this kind of discrepancy?
Thanks,
John
External MC Loaded On Stage, I Can Press Buttons That Are On The Stage Through It...
An external swf is loaded using this code...
Code:
on(release) {
loadMovieNum("supplimental/external.swf", 500);
}
The problem is that even though this external movie covers the whole stage, My mouse can still "see" buttons that are on the stage, and I can click them. I don't want to be able to click the buttons through my external movie. Thanks for any help.
LoadMovie Not Centered
Hello. I have trouble loading a movie clip properly.
Some how it does not center the newly loaded movie.
I set up the loading movie size to be the same as the transparent sestination movie clip where the loaded movie will go to.
Some how the loaded movie shows in the center as desired very quickly, but then it moves to the lower right corner of the main movie. I have to put the "dropzone01" to left top to manually adjust the loaded movie to be centered.
I am just wondering why it happened, and would like to know if there is any solution. I have about 18 more movie to load, so I don't want to manually adjust everything.
Here is the script to load movie I used:
on (release) {
gotoAndStop ("pic1");
loadMovie("thumb01.swf", _root.dropzone01);
}
Thank you,
Tsug
Need Java Centered Pop-Up
Hey Guys,
I have a URL I'm working on at: http://www.vmvisions.com/steelhorsesmc/background.swf.
In the galleries section I want to enable a pop-up html window that can be closed by the user, from the window.
What's the javascript code for that?
Thanks,
Marc
|