Centering A Background Image?

May 14, 2009

I'm told that the following chunk of script will center the stage on resize, but not knowing much of anything about actionscript,

myListener = new Object(); myListener .onResize = function () { ... } Stage.addListener( myListener ); // later ... Stage.removeListener( myListener );

View 5 Replies


Similar Posts:


Actionscript 3.0 :: Centering Stage And Background Image Using Actionscript?

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

IDE :: Centering And Resizing A Background In Existing Code?

Mar 24, 2010

I have a code for a page I am using and I would like to add a background and have it resize with the screen like the rest of the page. I have created a movie button named "pic" with the image in it but I don't know how to write the code and place it in the existing AS3 code file.how to place the code like i was in 3rd grade, that would be great. Here is the existing code.

package com.modules
{
import flash.display.*;

[code]....

View 1 Replies

ActionScript 3.0 :: Centering And Resizing A Background In Existing Code?

Mar 24, 2010

I have a code for a page I am using and I would like to add a background and have it resize with the screen like the rest of the page. I have created a movie button named "pic" with the image in it but I don't know how to write the code and place it in the existing AS3 code file. I am brand new to this so if someone could tell me how to place the code like i was in 3rd grade, that would be great. Here is the existing code.

package com.modules
{
import flash.display.*;

[code]....

View 1 Replies

ActionScript 3.0 :: Full Background And Centering Content (with Ratio)?

Feb 23, 2010

I would like to have a project where the background fits the whole window (can squeeze) and the content is automatically resized and centered; keeping its ratio.Auto-Resizing and Centering your Content But here's my problem :

My main project is 1400*900px.
My MC to handle is 1000*680px.

I load an external SWF in that MC (with addChild).This external SWF is 1000*680px too (same size than parent).I have a lot of clips in my external SWF and some of them are "out" the project zone.So when I load it in my MC; the MC is no more 1000*680 but more.I thought that what was outside didn't matter; but it seems that flash do not ignore what is out.So, when I use the code to resize/recenter the MC; it broke as it do not center as it should.I did try to use masks but it do the same.

View 1 Replies

Actionscript 2.0 :: Centering And Scaling Background Movie Clip Fullscreen?

Mar 26, 2010

So I am working on a full screen website, and background_mc I want to be centered and scaled 100% to the stage. But I also do not want the image to loose it's proportions. Here is my code so far, it is only seeming to center the movieclip:

Code: Select allfscommand ("fullscreen", true);
Stage.scaleMode = "noScale";
Stage.align = "TL";

[code].....

View 1 Replies

ActionScript 2.0 :: Centering Image In The Xml Image Gallery?

Jan 30, 2007

did the tutorial on this site for an xml image gallery - it worked great... My question would be is there a way to accomodate for multiple image sizes that would allow the image displayed to be centered?

View 1 Replies

ActionScript 3.0 :: Centering An Image?

Dec 3, 2011

I have a movieclip on the stage which has the dimensions 400x400.I currently load images,and add them to this component.Each image is a different size. At this moment in time, they are placed at position 0,0 within the movieclip container.Some of the code looks like

var data:XML;
var total:Number;
var url_list = new Array();[code]....

Is there anyway I could get the loaded images placed at the center of the movieclip container.I dont know if I have to do something like subtract the images width and height from the containers width and height, and then divide by 2?

View 3 Replies

Professional :: Centering Image On Stage

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

ActionScript 2.0 :: Centering A Loaded Image?

Jun 24, 2008

i am trying to get an empty movieclip to center after a jpg loads into it. the images load, but they don't center. my first attempt (using loadMovie) would read the size too quickly and would only center after a second click. i thought using a MovieClipLoader would work, but my leftEdge always returns 350. i'm getting a 0 value for _width.

on a related topic, i want to apply a DropShadowFilter to the same empty movieclip.i haven't tried it with the MovieClipLoader, but it didn't work using loadMovie. any ideas on that? if i have to, i can create a generic dropshadow and position and scale it accordingly, but again, i will need to be able to read the size and position of the empty movieclip.

Code:
var mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();[code]...

View 5 Replies

Actionscript 3 :: Centering An Image Inside A Loader

Mar 17, 2011

I'm developing an ActionScript 3.0 app for Blackberry Playbook. I have a Loader with a fixed size of 240x240px. The images that can be loaded inside are smaller or bigger than 240x240px, and also they aren't squared. I use this code to resize that images:

[Code]...

View 1 Replies

ActionScript 2.0 :: Centering A Loaded Image/Movie?

Apr 11, 2006

I am needing to load an external image (probably jpg) into a movie. I am using an empty movie clip, giving it an instance name and the code:

Code:
instance1.loadMovie("image.jpg");

What I also need to do is be able to either place that image in a specific location on the stage or just center it. Any advice you can give me on that?

I am attempting to do something like this: Use two movie clips. One is a holder that contains the second movie clip, which is where the image is actually being loaded. Then, I am using the following math:

Code:
instance1.isntance2.x - instance1._width/2 instance1.isntance2.y - instance1._width/2

Does this look like it would work? Is there anyway I can set instance1 to have a width that is equal to the size of the main movie (1024 x 768)?

View 12 Replies

ActionScript 2.0 :: Centering Image Within Resizing Frame?

Oct 2, 2003

Im having problems of centering my images dead center of my resizing frame.

heres the code:

// All the credits go to Gorlim from www.flashxpress.net
// You need 2 clips in the library: btn and fond
cmpt = 0; //handles depth to attach

[Code]....

View 4 Replies

ActionScript 2.0 :: Centering Image Loader Component

Dec 4, 2011

Im trying to use a Loader component to add images to my flash file externally because i need to use a single loader for multiple images of various sizes the centerpoint is forever changing the centerpoint is ALWAYS to top left (as seen in image) and i cant figure how to change it.Ive used the following actionscript 2 code which i would have assumed it would center it fine but its never truley centered.[code]

View 1 Replies

Javascript :: Video With Transparent Background On Page Above Image Background?

May 2, 2010

I want to embed some video into my HTML page. As background I want to use big picture. And above it I want to insert loop video with (i.e.) walking man.So, can I embed video (without flash and any player controls) in page?Can I decode video with transparent background? Is there any codecs which support transparent background (alpha-channel)?

View 1 Replies

ActionScript 2.0 :: Centering Image On Scaling Flash File

Feb 4, 2011

I'm working on a fullscreen application that doesn't run flash on the browser. Running Flash player 10. When you open the file, I have fscommand to run fullscreen, the flash file is built at 1280 x 800, and I have an image (menu screen) that starts off the flash file. I'm trying to find a way to center the image to the native SCREEN resolution, not the flash resolution. Is that possible?

I have this code running on the menu MC:
onClipEvent(enterFrame){
this._x = Stage.width /2;
this._y = Stage.height /2;
}

I've tried other variations of this, and no luck. On my 1280x800 native resolution monitor, it's great. Tested it, and it works. However, if I run the same file on a 1920x1080 monitor, the image is on the lower right hand corner. Also, the image at the moment has a center anchor point, but I'm sure you realized by my simple code. Also, just escaping the fullscreen mode, and scaling the window also screws up the formula. So I'm not sure what I can do to make it dead center no matter the screen res, or size of window. The reason I need to do this, is also because there are times where I have to change the flash resolution, and I don't want to go into the image everytime to adjust the center.

View 1 Replies

ActionScript 2.0 :: Kirupa Photo Slideshow Tute - Centering Image?

Sep 11, 2006

I've been going through the tutorials and forum trying to build a photo slideshow. I managed to get the slideshow working with buttons, but am really stuck with trying to center the images ... I'm using portrait and lanscape images, and want them both to be vertically and horizontally centered in a 504x504 moive.

View 2 Replies

Actionscript 3 :: Flex4, Centering And Resizing A Image Inside A Group Container

Jan 21, 2010

I'm looking for the best way to get a flex 4 image object to resize and horizontally center whenever its parent container (a custom component based on group) resizes. I cannot set horizontalCenter="0" to accomplish the image centering because I use a move transition to "slide" the image in and out of view.

I'm externally setting the image source in the component. Here is a simplified example of my component code that only addresses resizing the image.

<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" >


[Code].....

View 2 Replies

Image As Background / Resizing / Scalable Background

Jul 24, 2009

I am relatively new to Flash CS3 and i have been learning Action-script 3 over the past week. I have come quite a long way and i have made a site in flash but i just have a question.I have been using an image as my background and i am happy with the way flash automatically scales all the objects in my file but the background image does not scale. Is there a way to do this? I have found out things online which show me how to add auto-resizing to the background but this knocks off the flash auto scaling/resizing for everything else.

View 4 Replies

Actionscript 3 :: Avoid Image To Get Stretched When Used As Background Image, In Flex

Dec 12, 2009

I am developing a website in flex. And in that, i am trying to set the background image of my application. like this: parentApplication.setStyle("backgroundImage", data.image_src);

From a different location.

My issue is that, the images that i have are small and hence they are being stretched when used as background images. I want to avoid that from happening. How can i do it?

View 1 Replies

ActionScript 2.0 :: Image Pan - Making The Background Image Move Around As If It The Scene Is A POV

Mar 7, 2011

was wondering if anyone could assist me with some actionscript. I am working on a project similar to this (thehideout.org.uk/refuge/) and making the background image move around as if it the scene is a POV.

View 1 Replies

ActionScript 3.0 :: Background Image Scroller To The Left Third Or The Right Third Of The Image?

Aug 4, 2009

Iv got a background image 3 times the length of my stage.. what im trying to do is create a scroller so when you press a right button or a left button, it scrolls to the left third or the right third of the image.

[Code]...

View 0 Replies

ActionScript 3.0 :: Add Border/background Image To Display Image?

Jan 12, 2010

I am using this following code to display images using xml.Everything is working fine for me but i have to add background image or border to the displayed image using function BitmapFileMaterial.

using BitmapData or Bitmap Class but same functionality.

[Code]....

View 0 Replies

ActionScript 3.0 :: Background Image Will Change To This Button Specified Image?

Jul 10, 2011

I am making a new flash website and i stack on the as3 part.My site have a menu like all the site do.Now on the site load there is a background picture.When you press one of the menu buttons, the background image will change to this button specified image.But all that in an animation of fade in and out.My problem that i have everything but i cant know which image was before it changes to the buttons specified one. It maybe require as3 which i dont know.I cant upload here my work. its personal.But i ask you the professionals, please make a short fla file which will have the code and animations i need.(if you cant understand me)Please, make a fla file, which contains random 3 images.At the start it will have main background and a menu on it(just text-for fast and short work)The menu is 3 text ine(main,about,contact)now, make that when you press about(for example) it will change the main image(background) to the image of the about page.

View 2 Replies

Set Swf As A Background Image In Vista?

May 28, 2009

Set a .swf as a background image. I want it to still move.

View 3 Replies

Get Swf To Play As Background Image?

Nov 17, 2009

I want to convert a .avi into a flash movie and import it into Dreamweaver as a background image so that it will expand in all different resolutions 1. what do I need to consider when building this in Flash (using MX 04)?2. What should my html look like in order to call this file as a background swf (and poss css file)?

View 7 Replies

Flex :: How To Set Background Image For App

Jul 9, 2010

I'm using Flash Builder 4 to create an application. I need to set an background image for the app. I've pulled through the data from XML. I am using an <mx:Image> for the background-image. But I need elements to then be added inside it. How do I achieve this? I considered using Layers, but dont know how you achieve this.

View 3 Replies

Actionscript 3 :: Set A Background Image?

Apr 8, 2011

I have looked around for about two hours now and I can't seem to find the command to convert this little piece of code to change the ball colour to a bitmap:

on(release){
myColor = new Color(_root.ball_mc);
myColor.setRGB(0xFF0000);
}

View 2 Replies

Flex :: Set Background Image In 4.5?

Jul 10, 2011

I have written a custom skin in Flex 4.5, which shows a custom image. I want this to my background image, so how can I set this skin to the application container?

View 3 Replies

IDE :: Way Of Scrolling Image Background?

Sep 16, 2005

I have come to a solution where I use an invisible button (covering the whole movie) where the action takes place in. Problem is, I can't put buttons on it because the invisible button blockes them.Does anyone know an other solution of making my background image scroll like the example site?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved