ActionScript 2.0 :: Creating Comic - Centering Smaller Frames On Stage
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
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
Jun 25, 2004
I found this really neat photo gallery on flashkit but there is no support or readme included. how to size this thing.. the AS code does have comments but I am not a coder.I'd like to make the image window smaller and the overall movie smaller. 325x325 or so
View 10 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
Apr 25, 2010
I'm a total beginner at ActionScript, and I'm running into a big problem with a Flash banner I'm writing. The problem is that my Stage width and height appear to be much smaller than the width and height specified in my <object> and <embed> tags of the HTML. My goal is to get the Stage width and height to be equal to the <object> and <embed> width and height, so that I can make commercial banners with full-size backgrounds.
The width x height specified in the <object> and <embed> tags is 400 x 300. To force the Stage to be 400 x 300, I've added a 400 x 300 TextField as a child of my main Sprite object. As a diagnostic, I even printed the Stage's width and height as part of the TextField text content -- which confirmed that the Stage thinks it's at 400 x 300. I've tried different things to get it to work. I've tried playing around with the Stage's scaleMode property, using all the possible different values, but still the problem persists. Still, when viewed on the web page, the width and height of the Stage appears much smaller than the <object> and/or <embed> tags which contains the Flash content area. I know this because I'm using colored backgrounds as a diagnostic.
[Code]...
View 3 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
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
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
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
Aug 24, 2010
I am trying to create a web-comic using flash cs4. This is the first time that I use this program, but I understand that what im trying to do can be easily done.All I need is basically a Previous and Next button like a slideshow.[URL]
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
Feb 25, 2011
I am trying to make a comic by putting the comic in a movie clip called graphic_novel (also the instance name) but I want to have individual thumbnails in the comic zoomable so that if you hover over them then you get a further zoom into each thumbnail of the comic.
So far I have the following actionscript on the main comic which also has a motion tween between frame 1 and 20 so that it zooms in or out over that amount of frames.
The zoom works fine but I have tried numerous methods of creating invisible movie clip buttons over the individual thumbnails and tried to add similar actionscript to make a further zoom. Basically I want to navigate around the comic using zoom in zoom out.[code]...
View 5 Replies
Mar 6, 2005
I'm trying to setup a situation in my comic where the user chooses one of two options, to side either with goblins or a dwarf. I would like to set it so that if the user chooses the goblins, it updates a shared object that keeps that choice saved on the computer for the next time they watch the movie so it skips the asking process. I've tried everything I can think of to get them to work, and the choice will replay if you are in the movie, but once you close it, the choice is not saved.
The .fla file can be found at www.manatheater.com/MXhelp2.fla, the initial set up is in Scene 0, Layer "Masking", Frame 0. The button code is in Scene 2, Layer GLeft and Gright, Frame 459. The replay code that checks the variable can be found in Scene 2, Layer "Masking", Frame 416. The variable for the choice is "gob", gob==1 is for goblins, gob==2 is for dwarf.
[Code]...
View 1 Replies
Aug 13, 2010
As a UI specialist, I am often asked to build tool-tip displays and other sorts of popups that display text. One of styles clients seem most keen on is text in a comic-book balloon. I would like to create this balloons programmatically (as opposed to embedding or linking to rendered graphics), because these balloons will have to change size at runtime, depending on how much text they have to hold.
Balloons are easy to draw for the most part: circles, rectangles or rounded-corner rectangles. The tough part, for me, is the tail (the little arrow-like part of the comic balloon that points towards the speaker). If you google comic balloon, you see that there are many varieties of tails. They ones clients request from me most often are curved. E.g...
[URL]
The tail will always be on the bottom of the balloon, and it will sometimes point left and sometimes point right. I have been trying to come up with tail-drawing algorithms for a while, but I'm not happy with the results. I'm basically stumbling around in the dark, changing variables, looking at the results, and using trial and error to try to move closer to the magic numbers that will work. "Work" just means a result that looks pleasing, which I realize is subjective. Most of my clients will be a happy with anything that looks reasonably good and professional.
I want this result to scale. And it would be great if it could work with as few inputs as possible, maybe just isFacingLeft, tailWidth and tailHeight (Which could maybe be a percentage of the whole balloon). Maybe an adjustable curveAmount.
If it matters, I'm using Flash/Actionscript, but any system that has some sort of turtle graphics engine should work pretty much the same way: I'm working with that standard flipped Cartesian grid (y increases downward), x and y coordinates, the ability to move a pen, draw lines and draw curves.One caveat: Flash only allows me to draw 3-point bezier curves -- start point, control point, end point.
Note: balloons won't have to scale after the are drawn.
View 1 Replies
Apr 13, 2011
I am trying to create a quiz in Flash CS5. I have coded all the quiz so that it is done in different frames, such as the start screen in frame 1, then the five questions in frames, 2, 3, 4, 5, and 6 (one for each question). How would I create a scoring system so that if the user got a question right it would add 1 to the score but continue scoring through to the next frame? It needs to have a pass rate of 4 out of 5 correct answers.
View 1 Replies
Sep 29, 2011
I am trying to make an API in which there are 3 screens:
1. User drags items to a blank square(area) and makes a flag in the area with the items-i will call it "the flag" from now on
2. User dresses a puppet-i will call it "the puppet" from now on
3. User can print puppet+the flag(and he can arrange it-over/under the puppet, resize, rotate etc.)
I think all I have to do is create an MC with the flag and then move it over frames, or insert the flag (blank square+components used) to an MC in advance, and by code remove unused items and then "pop" it in the other frame (but then i need it to be the edited one, not the original). I attached the frame. The square is the area and the blue squares are the draggable items. I want to preserve that edit (post drag locations).
View 0 Replies
Dec 25, 2010
By default when I create a new motion tween, it automatically comprises all frames on the layer I want only a 72-frame tween, not a 350-frame tween.
View 2 Replies
Jun 1, 2011
I have created a flash website and have encountered a problem. I am using Flash CS3 and ActionScript 3.0.I have created a text box (at the moment it is Dynamic because I have it scrolling) with text entered into it. I want hyperlink sections of the text to other frames within the flash movie. The text box is on the "news" frame - this is a page for archived news. I want to highlight pieces of the text and create hyperlinks to each of the archived news stories (each of which is on a different frame).I know how to create buttons from text and link them to different frames, however I do not want to do this because I want to maintain the text box (with hyperlinks within the text box) so that I can make this page scrollable.I have tried highlighting the text and hyperlinking it to the frame number, to the frame name, to the frame anchor, ec..
View 3 Replies
May 31, 2011
I have created a flash website and have encountered a problem. I am using Flash CS3 and ActionScript 3.0.
I have created a text box (at the moment it is Dynamic because I have it scrolling) with text entered into it. I want hyperlink sections of the text to other frames within the flash movie. The text box is on the "news" frame - this is a page for archived news. I want to highlight pieces of the text and create hyperlinks to each of the archived news stories (each of which is on a different frame).
I know how to create buttons from text and link them to different frames, however I do not want to do this because I want to maintain the text box (with hyperlinks within the text box) so that I can make this page scrollable.
I have tried highlighting the text and hyperlinking it to the frame number, to the frame name, to the frame anchor, ec... but I cannot get anything to work.
View 1 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