ActionScript 3.0 :: Centering 3D Objects On Stage?
Feb 8, 2010
I am new to working with 3D in Flash CS4. My project has a center-registered movie clip with a z-axis setting of 850 that I need to keep centered on the stage at all times, including when the stage is re-sized.ode like this for centering 2D objects doesn't seem to work:[code]
View 5 Replies
Similar Posts:
Oct 19, 2011
I'm writing a web based flash app that's written entirely in AS3. I have objects on the screen as part of a GUI. I would like the user to be able to resize the window, or make it full screen. I would like everything to auto-scale with the resize, but also remain in the same relative position on the stage.
View 1 Replies
Oct 19, 2009
I've always struggled with this sort of stuff, dunno why:
I'm making a vertically scrolling menu with a series of thumbnails. The thumbnails are of various widths& heights. They also have registration points in inconsistent places (ie, not always the same). I want to scale and position the thumbs so that they are all central to the containing menu section. It's probably something to do with adding a container sprite/mc and stuff but I've messed about with it and nowt works.
View 7 Replies
Sep 16, 2009
When I open a new document in flash, the stage is in the top left corner of my screen and I cannot figure how to center it in the middle. I cannot go to the left or above the stage which is making it very difficult to work with as I cannot access those areas.
View 1 Replies
Jun 23, 2009
I have a movieClip that starts out a a specific scale. I then tween the images properties and as it tweens it also scales again. What I'm trying to do as it tweens and scales its obviously changes the width and height of the movieClip. So I'm trying to constantly keep the clips position in the center of the stage.
I'm using tweenMax and I tired an update event so I could keep checking the width and height of the clip as it scales and then using this code to center it but it doesn't seem to be centering the image. On other thing to note is my MovieClip is using its top left corner as the registration point.
[Code]....
View 1 Replies
Oct 14, 2009
I've come across a new snag to a previous project. I'm not quite sure why, but when the full image is loaded to the stage, it is not centering it properly. The trace of fullLoader returns "0" for the width and height of the full-sized image, and I'm not quite sure how to pass the necessary information into the showPicture function so that it correctly centers the image. I tried tracing the content of fullLoader and got an error message.[code]
View 2 Replies
Jun 21, 2010
I'm heaving trouble centering the preloader on the center of the stage. The preloader is basically a rotating oval shape.
so, below is the code that for some reson puts the circle in the top left corner...
Code:
stop();
var circle:LoadCircle = new LoadCircle();
var circle_WIDTH:Number = circle.width;
[Code]....
meaning... the stage is not static, but it dynamically shrinks and expands to the size of the oval preloader...
how to make the stage "static" so that when I set the size in the document properties, centering an object in AS3 will stick to it?
View 2 Replies
Aug 4, 2011
I'm having trouble with the positioning of objects within the NativeWindow. So my code below creates a NativeWindow, and then draws a rectangle and adds it to the stage of the NativeWindow. I can't seem to have the rectangle centered in the window. I've tryed playing with the stage scale mode, and align properties. By default the align should be center, but it doesn't appear to be the case. The rectangle seems to be drawn from somewhere between the center and top left of the window. I've also drawn a rectangle onto the main app window using identical code.
Code:
import flash.display.NativeWindowInitOptions;
import flash.display.NativeWindow;
var NWIO = new NativeWindowInitOptions();
[code]....
Left window is the main app, and the right window is the NativeWindow.
View 5 Replies
Dec 31, 2010
i've created a rotating banner with images and wanted to increase the stage size so i can put an opaque larger image in the background and have the other images rotate on top of it. when i made the stage larger i'm having difficulty selecting the other photos so i can center them back on the on the stage. i was able to get the first image centered but i only see the outline of the other images.
View 3 Replies
Jan 2, 2010
I would like to call up images from myXML and I would like to center them on the stage. Each object is a different size therefore I can't place them to a set _x position. Hopefully someone may have the answer.... here's the function that will call up the firstimage:
function firstImage() {
if (loaded == filesize) {
var myHoriTween:Tween = new Tween(content_mc, "_x", normal, 0, 480, .75, true);
content_mc.loadMovie(image[0]+".jpg", 1);
content_mc_num();
}
The highlighted '480' is the number i would like to replace to center. I'm not being to vague with this request, otherwise i'll offer more information.
View 2 Replies
Jun 18, 2005
I have a picture of a mine which is nested within an object, nested within another object. Now what I want it that on the keypress of shift, I created mine image at the same position of the tank. The issue is that the main object that is nesting the mine moves, thus not creating at the the center, rather on that position of the object.
Here are how my images go by instance names;
1. Tank Stays in the center
//////
/////
1. Land (moves) -- 2b. map -- 3b. All objects that hitTest
|
2a. Objects
|
3b. All the objects that don't get hit (in here is mine.)
View 4 Replies
Feb 20, 2012
I have a website made with flash and I have added all the pages inside a movieclip and this moviclip is centered in the stage using event. Resize and event.Enterframe. But now the problem is..although the gallery (which is an external swf) is inside this movieclip it doesn't stick to this stage.rezise event. How can I control this gallery.
View 1 Replies
Oct 21, 2004
How do a make a center a mc automaticly on the stage with aS. The script should detect what the stage size is and move the mc to the middle. I am making smartclip-preloader and want to be as productive as possible later on.
View 4 Replies
Nov 19, 2010
I want to center a big movieclip (1400 px wide) on my stage on stage resize. This big movieclip moves to the right on certain events so I can't use code like this:
currentPage.x = ((stage.stageWidth/2) - (currentPage.width/2))
Is there a way to maybe use its offset from 0 (the left side of the stage 'viewport') and use that offset in centering? The movieclip only changes in x.
View 2 Replies
Dec 10, 2006
having some problems with having my mc's always center in t5he middle of the browser window even when it resizes??
Cheers all,
basically the code i'm using is this:
_root.abc.Stage.width/2;
[code].....
View 1 Replies
Aug 16, 2007
I'm currently working in Flash 8 with Actionscript 2.0.
I've been trying different alternatives and none of them are working. I've even posted here previously and tried a few things but I haven't quite resolved my centering to stage problem. Some of you may have already read pieces of this from another post.
I have a landscape that functions sort of like a 360 vr tour. The main movie clip directly on the stage is labeled, "mainMovie", and within it is another movieclip labeled, "singleStrip".
To simulate the 360 vr tour, there's script inside, "mainMovie" to duplicate "singleStrip". Also, inside the "singleStrip" movie clip, I have different elements appearing through the landscape, in this case, we'll use letters as an example. The letters A - Z are sitting on the landscape throughout the entire "singleStrip" movie clip.
Everything rotates fine with the script that's placed some sensitive area movie clips that are placed on the root level. When you place your mouse pointer to the left edge of the stage, the landscape shifts left, when you move the mouse pointer to the right edge, the landscape shifts right, (or vice versa, I can't remember).
The problem I'm having is for the letters that are in view on the stage, I want the user to be able to "click" on them and then that letter zoom up to the center of the stage, (through the "x" coordinate). I'm having difficulty with this since the letter movieclips, (example, "letterA"), are within the "singleStrip" movie clip, which sits inside the "mainMovie" movie clip, which are both constantly moving and their x position continues to change.
I've been using the tween class in order to animate them with easing and it's usually the "endx" variable that I'm having trouble because I don't know how I can match it up to the center of the stage, whether it's a "endx = stage.width._x /2; " or something else. Here's an example of some of the [code]...
View 2 Replies
Apr 30, 2009
My problem should be simple but I'm still having trouble. I am making a comic that appears on screen one frame at a time based off of on of the first flash tutorials that come with the program. It allows the user to click a button to move to the next frame. My problem is that the smaller frames need to be centered on the stage.
Here is the code I have so far
/* 0 */
var image0title:String = "Dr. Berg's Clinic. 1 of 4";
var image0uri:String = "images/Berg_frame_1.jpg";
/* 1 */
var image1title:String = "Dr. Berg's Clinic. 2 of 4";
var image1uri:String = "images/Berg_frame_2.jpg";
[Code] .....
My stage is set at a height of 350 px and a width of 500 px and the largest image is a height of 319 px and width of 500 px (the remaining 31 px are where I put the description and the button). The smaller images are a height of 319 px and a width of 166px and need to be centered.
View 4 Replies
Oct 30, 2009
I have this flash website where i use Stage.scaleMode to dynamically resize the swf depending on the browser size. (i use A.script 2.0). So the width takes the whole screen and the height is scaled in proportion. My design is in a landscape format. It works fine, except that i need the swf to also be vertically centered in the browser Window. (explanantion - on certain screens, example a 19 inch PC monitor which is quite "squared", my flash movie expands the whole way across the width, and the height in proportion, but as my design is in landscape, i have a big empty space in the browser below the swf.)
This is how it is: This is how it should be:
Here is the code:
stop();
Stage.scaleMode = "noScale"
Stage.align = "TL";
[Code].....
View 1 Replies
Apr 5, 2011
im loading photos of different aspect ratios with a loader onto a child holder frame_mc. I wanted to know what AS3 commands do i need to work on to get the frame_mc to resize to the new childs dimensions and centerize itself on the main stage? (as in event listeners, functions, vars etc)
View 3 Replies
Jul 24, 2010
I have drawn colored rods which I have placed in the library and have put one of each on the stage with instance names likeblueRod_mc, etc.I place them around with time-line code like
blueRod_mc.x = 300.0;I have now created an Actionscript class called Problem.I build a new object from Problem which I have called Riddle.But when I put blueRod_mc.x = 300.0 in a method (of Problem),I get the message that blueRod is not accessible.So I triedstage.blueRod_mc.x = 300.0;That did not work either.
View 9 Replies
Jun 13, 2010
I did a website using actionscript 2 where the content was centered on the browser window both vertically and horizontally.
e.g. [URL]
all that took was a small piece of actionscript code that i can't remember now.
Now using actionscript 3, I can't find such code anywhere, instead I am guided towards using dreamweaver and css which seems like a nightmare for me to achieve. Such a fundamental thing should be possible with minimum effort surely?
Also, I have a similar problem where I'm trying to repeat tile or just add a textured background behind the stage. This also seems like I'm having to use html/css to achieve. I'd rather just use flash if possible??
View 1 Replies
Aug 28, 2009
I am creating a program and have some objects that animate from off the stage to on the stage. When I run the program in the flash player the objects that are off stage are visible. Is there anyway to stop this from happening. I suppose I could create a layer with a frame in it that could cover the off stage objects, but I am just wondering if there is a better way.
View 3 Replies
May 7, 2009
have a bunch off mc's that are controllable through buttons and using the key controls, but i need to make it so they stay within a 600*600 area within the stage
View 3 Replies
Mar 21, 2010
Almost finished constructing a web site (my first) now suddenly, in all the files, none of the objects are appearing on the stage only their registration points(the white circles right?). If I isolate the object it appears.
View 21 Replies
Feb 17, 2011
how would I go about creating a flash application that has the ability of extending beyond its object width and height on a page? I've seen those crazy flash ads which beg you to hover over them only to have it take over 3/4 of the page you are viewing. How are they doing that? Is it a combination of Javascript and Flash? Or, is it actually a really big stage that is somehow hidden in the HTML? Or (better yet) is there a magic way of pushing flash objects beyond the stage and out into the HTML?
View 1 Replies
Aug 25, 2009
I'm studying the code for a vertical shooter game that is given in the book "ActionScript Design Patterns 3.0." The author is explaining the factory pattern and so covers just that aspect of the code -- doesn't cover hit testing. I would like to figure out how to do hit testing for this example because it's similar to something I am planning.
The code for the game consists of 12 classes, abstract and concrete creator classes, abstract and concrete product classes and a Main class. These classes instantiate the ship and weapon objects at various points in their execution. I made a separate Collision class and I'm trying to find all the objects on the stage using this Collision class so I can hit test them with each other. Here's my code:
Code:
package {
import flash.display.*;
import flash.events.*;
[Code]....
Is there a way to fix this code so I can access objects on the stage? Am I missing a cast somewhere? Or do I need a different approach to find objects on the stage in a multiclass game?
View 4 Replies
Oct 15, 2009
I have a problem with this code:[code]There are two overlapping objects on my stage: character_mc and vanish_mc. As soon as i start the scene [Ctrl+Enter] vanish_mc is VISUALLY removed. But the code still sees a collision somehow. How can i Entirely remove the object vanish_mc?
View 7 Replies
Nov 10, 2009
I'd like to be able to access some objects which are on the stage before compile time (e.g. in my .fla file). I can do this fine from the document class using the names I've assigned to them, but I need to be able to do this from other classes (instantiated at runtime) too.
What is the best way to go about this? Can I use the stage variable (this isn't looking likely from what I've read so far) somehow? Or do I need to pass in references to these objects from my document class when I create the instances of the class that needs to access them?
View 8 Replies
Mar 3, 2010
I'm having an issue accessing items on the stage from some imported code. I found this topic that discusses the same issue... [URL]
I'm not sure I totally understand how to go about this. I don't understand how to make the object global so I can access it from any class. (I have the same problem with an array I'm working with).
View 7 Replies
Apr 27, 2010
I am using Flash CS4 and need to resize my Flash stage and all objects therein.
To do that I activated onion skin tool, selected all objects and all frames and resized by using the transform tool.
However, masks and some motion paths are not scaled proportionally.Is it yet another bug in CS4? Here is a video illustrating the [URL]...
View 5 Replies