ActionScript 3.0 :: Flash Resizing And Centering Child Holder On Stage, After Loading External Photo?

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


Similar Posts:


Flash 10 :: While In Full Screen, Main Stage Resizing When Loading An External Swf

Nov 10, 2010

My main swf is 960x600 and loads full screen. it is a projector or swf, local. I have the code on frame 1 to ensure full screen and show all:

stage.scaleMode = StageScaleMode.SHOW_ALL;
stage.displayState = StageDisplayState.FULL_SCREEN;

Then I load an external swf into a mc, and it goes full screen as expected. BUT the main swf that loaded that external one, at the time of load, suddenly gets scaled back down to its normal size: 960x600, on the top left corner of the Player Window (or the full screen), so somehow at 0,0. Whn I unload the external swf, I can put the code stage.scaleMode = StageScaleMode.SHOW_ALL; to get it back to where it was. But unfortunately I have some buttons from the Main swf that are supposed to be on top of the loaded one, and should stay where they are. But now they all move because of this scaling down.

the mc that is being used as a container for the loaded external swf is an empty mc located at 0,0. The external swf has the same size as the main one: 960x600

I searched and tried things but could not get it to stay in show-all mode when loading this external swf...

View 0 Replies

ActionScript 3.0 :: Load Swf From A Child MovieClip Button Into A Holder On Parent Stage

Apr 10, 2011

I am trying to load a swf into a holder movie clip from the child movieclip.It's parent has a holder that i want to load a swf into.I am navigating from within a child clip.It would be nice to have the swfs load from an external xml file but it isn't mandatory.

View 3 Replies

ActionScript 2.0 :: Centering An AttachMovie In Its Holder?

Jul 3, 2007

how to center an image that is smaller than its attachMovie parent. Basically I have a blank slide (a 94 x 94 square) that I load dynamically image thumbnails into. Some of them may be 92 wide and others 92 tall but never anymore than that. The problem I have is that all images loaded are aligned to the top of the mc they replace and if a thumbnail is 92 wide by 20 tall than theres alot of space underneath it - i need to center (both vertically and horizontally) the loaded data and I have come up stumped.

View 5 Replies

ActionScript 2.0 :: Loading External Swf Into Movieclip Holder?

Jan 6, 2011

note I have to change some file names and urls for company privacy.I am working on an online banner ad which tight size requirements. In order to stay under the file size, I want to load an external swf housed on our server into an empty movie clip on a button press. I have this working with the following code on a button:

on (release) {
loader_mc.loadMovie("location where swf file is housed");
}

I then want to unload this movie if a different button is pressed. However I am receiving the following error.

*** Security Sandbox Violation ***
Connection to file: XXXXXXXX halted - not permitted from "location where swf file is housed"
-- Remote SWFs may not access local files.

How can I unload this external swf file from my move? Again the external swf file is housed on our sever and the main swf file will be housed with the place we are advertising.

View 0 Replies

ActionScript 3.0 :: Flash - XML Photo Gallery Swf Not Loading In External Swf?

May 17, 2010

last step in my interactive CD project.The photos in my xml photogallery swf work fine. However, when I load the xml photogallery swf into my index swf, the pictures stop loading after picture 1.AS 3.0 code for xml photo gallery swf (adapted from the tutorial)

Code:
import flash.events.MouseEvent;
function loadXML(loaded) {

[code].....

View 1 Replies

ActionScript 2.0 :: Centering Pics In Kirupa Photo Gallery Using XML And Flash

Mar 24, 2006

I am using the kirupa xml foto gallery and I am loading different sized images... if they would load nicely centered the problem is solved... (not to stage width/height..!!) The movieclip "picture" has to load the images centered from its own registration point so that it can be placed anywhere on the stage.... now its loads the images from aka left top...

[Code]....

View 14 Replies

ActionScript 3.0 :: Resizing External Image On Stage

Feb 6, 2009

This code works. It puts my external image on the stage:
Code:
var pngurl:URLRequest=new URLRequest("image.png");
var pngloader:Loader=new Loader();
pngloader.load(pngurl);
this.addChild(pngloader);

This code works to, but not completely. It stores the same image inside of a movie clip that I've named "panel". However, the image is bigger than "panel":
Code:
var pngurl:URLRequest=new URLRequest("image.png");
var pngloader:Loader=new Loader();
pngloader.load(pngurl);
panel.addChild(pngloader); //panel is the name of my movieclip

I almost fixed my problem by changing my code. My image is smaller than "panel" now, but its width and height should be the same as "panel":
[Code] .....
(Original image size= 350width and 250height) (Panel size=100width and 100height)

View 3 Replies

ActionScript 3.0 :: Loading External Swf / Resizing

Sep 27, 2010

I'm loading external swf into my main project for sub sections to keep size down.My main project is 1280 x 700px in size.In those sub-section I have some content with a scroller.When I load the swf and check the size its ok. But as soon as the scrollbars is initialized scroll bar is initialized the size of the external includes the text that goes off-stage for the sroller.I can resize it propotionaly when after its loader because i have the correct values. But if the user resizes his browser I get the wrong values and my resize code doesnt work because it's height is now incorrect.So is there a way to not include the off-stage elements to count as the height ?

View 1 Replies

ActionScript 3.0 :: Centering And Resizing Content ?

Feb 28, 2009

I was looking at this tutorial, this is exactly what I am trying to do with my website, but this is AS3, is there a way to change the code so it will function exactly the same but with AS2 code instead.

I have already contstructed my site with AS2, which then wont allow this code to work, Is there even a way I can have an AS3 index file that loads the movies with the AS2 and applies the same resizing to the movies that have been loaded.

View 2 Replies

ActionScript 3.0 :: Loading Next Photo Keeps Previous On Stage?

Oct 18, 2009

Been fiddling around with AS 3 once more and i have this issue.

I got a mc on stage named imageArea

each next or previous click triggers function that increments the xml node plus some extras and then does the loadImage function.

when i click next image the correct image loads, but the previous one is still in the display. how i prevent that?

Code:
var imageLoader:Loader;
function loadImage (url:String):void
{
// Set properties on imageLoader object

[Code].....

View 2 Replies

ActionScript 3.0 :: CS3 Inherent With Loading And Resizing External SWF

Sep 23, 2008

When I load an external SWF into a container (be it a sprite or mc), and then retrieve the contentLoaderInfo for 'height' and 'width', and attempt to resize the either the SWF (loader content) OR the Sprite/MovieClip to a smaller size, using the loaderInfo to maintain aspect ratio, it resizes all the elements that are offstage as well.

[Code]...

View 7 Replies

ActionScript 3.0 :: Centering Object When Resizing Window?

Aug 1, 2010

I've been playing around with a code that keeps a specific object on the center of the movie when the window is re-sized. It works well but here is the issue: I don't want the object to be centered at the very center of the window but on a specific x,y coordinate. How can I modify this code to assign an x,y coordinate so that the object will be "centered" in reference to that coordinate?

Next, is the code. "centerlogo" is the object to be centered and "backgroundImage" is as the name implies the background. I know that what i ask has to do with the part under the "//center content" comment

function init()
{
stage.align=StageAlign.TOP_LEFT;
stage.scaleMode=StageScaleMode.NO_SCALE;

[Code]....

View 5 Replies

ActionScript 2.0 :: Auto-Resizing And Centering Movie?

May 17, 2009

I have a request to bulid the Flash website looking somewhat similar to LabelloI need a fullscreen flash that position elements dinamically, based on the stage dimensions. I found this tutorial on Kirupa:I need to do the same, but in AS 2.0, since it is the requirement.Is there any tutorial or finished script for this or I just need to write the code from scratch, as I'm not so good in AS3?

View 3 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 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 1/2 :: Photo Gallery - Create An Empty Movie Clip Holder That Would Reside On The Main Timeline?

Mar 7, 2011

I am using CS4 and ActionScript 2.0.I am trying to create a photo gallery.I have created 4 different movie clip buttons that reside on the content layer.Each button consists of one image.When the movie clip button is pressed, I want the full size image to appear on the stage next to the buttons.You can see the buttons in the image below.I am trying to create an empty movie clip holder that would reside on the main timeline while the buttons reside on the content layer.I need to get the images to load into the empty movie clip and then unload when the next button is selected?I can't seem to get the buttons to "talk" to the empty movie clip holder.I did manage to create code for an empty movie clip holder within each button, but then I end up with all four images on top of each other.

View 7 Replies

ActionScript 3.0 :: Values Of Holder And Child Alpha?

Dec 16, 2009

If my holder's alpha equals 0 can its child's alpha be effectively > 0 ? In my case I have holders (custom clases) with many children, some of which are holders them selves (with their own children and holders and so on).

I would like to:
-pick out a single holder from the 'tree'
-have all of the 1st level children of that are NOT holders themselves have an alpha of 1.

View 4 Replies

ActionScript 3.0 :: Loading External Swf To The Background And Resizing It According To The Browser?

Oct 20, 2009

I want to load an external swf to the background and then have it resized proportionally according to the browser window so it can fill up the whole screen.

View 2 Replies

ActionScript 3.0 :: Loading External To Background And Resizing It According To Browser

Oct 20, 2009

I want to load an external swf to the background and then have it resized proportionally according to the browser window so it can fill up the whole screen. Could anyone point me to any online tutorials or show me how to do it?

View 0 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 :: Auto-Resizing And Centering Content Tutorial?

Aug 11, 2009

I've just run through this tutorial and I've got my site centering in my browser as planned.However when I resize my browser window the text (I'm using a pixel font) is going fuzzy.Is there some way I can lock 'centerRectangle' to a rounded X and Y coordinate so that this doesn't happen?

Code:
function init()
{

[code]....

View 2 Replies

ActionScript 3.0 :: Ignore Mask Content On Resizing And Centering

Mar 24, 2010

I have a main flash container move that loads in multiple swf files. I created a movieclip container in the main flash container that resizes and positions according to the stage height and width as follows:

Code:
swf_width=stage.stageWidth;
swf_height=stage.stageHeight;
new_container_height=swf_height;

[Code].....

This works fine if no graphics are off the stage in the loaded swfs. Otherwise if I have a scrolling menu and the buttons out width the containing mc it takes into account the masked content width and centers the movieclip accordingly throwing alignment off.

Is there a way to ignore masked content when getting stage width and height?

View 1 Replies

ActionScript 3.0 :: Loading A Photo Gallery As An External Swf?

Oct 15, 2010

I am loading a photo gallery as an external swf.So I have a preloader for the ext swf that loads.Then there is a 3 - 4 second delay before the % preloader for the photo gallery starts to load.I'm loading it via xml - is it taking 3 - 4 seconds to read the xml page before the image starts to load?

View 6 Replies

ActionScript 2.0 :: Centering A Photo That Is Resizeable In Fullscreen?

Sep 24, 2009

I am having a problem centering a photo that is resizeable in fullscreen. Meaning it adapts to your monitor size. How would I keep the aspect ratio? I would not mind having black bars at the top and bottom as well.

Example is like this here:

[URL]

It may look fine if you have a normal monitor but if you have a widescreen the photo is distorted. The photo is saved as a movieclip.

View 1 Replies

ActionScript 2.0 :: Photo Gallery - Centering Images?

Apr 26, 2007

i have both vertical and horizontal pictures... The horizontal pictures work great! But what code and where would I add it if I wanted to tell Flash to center the vertical photos in the large gallery.

View 1 Replies

ActionScript 3.0 :: XML Photo Gallery Swf Pictures Not Loading In External Swf?

May 17, 2010

The photos in my xml photogallery swf work fine. However, when I load the xml photogallery swf into my index swf, the pictures stop loading after picture 1

Code:
import flash.events.MouseEvent;
function loadXML(loaded) {

[code].....

View 1 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

ActionScript 3.0 :: Image / Video Player - Remove Previous Child From Holder

Sep 10, 2009

I have a player that loads both images and videos. I am having a problem removing the previous child from the holder and am close to using tricks to fix it. I'd rather not. Here's the code that loads the image:

Code:
var _mediaLoader:Loader = new Loader();
_mediaLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
_mediaLoader.load(new URLRequest("blah.jpg");
function imageLoaded(e:Event):void{
videoConsole.imgHolder_mc.addChild(_mediaLoader);
}

And my flv loader is a bunch of mumbo jumbo with this code at the end:
Code:
videoConsole.imgHolder_mc.addChild(flvPlayer);
So, how can I remove the previous child, if there is one, when loading the next item on the playlist?

View 0 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







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