ActionScript 3.0 :: Images Not Scaling Or Centering When SWF Online
Aug 20, 2011
I only recently switched to AS3 from 2 and I'm sure there are concepts. When I load a grid of images and scale and center them, why does this work locally but not when I upload it to a server? These images do not scale or center online, they just position themselves at top left at full size. Here's the portion of my code that centers the image when loading of image is 'done.'
ActionScript Code:
function thdone(e:Event):void {
if(e.currentTarget.width > e.currentTarget.height){
scaleFactor = (120/e.currentTarget.height);
} else {
scaleFactor = (120/e.currentTarget.width);
[Code] .....
View 1 Replies
Similar Posts:
Jan 10, 2010
I have a full flash website built using Flash (of course). So I publish it using flash itself. But I am having a difficult time aligning it in center with its original dimension. I dun want my swf stretch out or scale at all. I want to display it without scaling and also in the center of the browser window.
stage.scaleMode = StageScaleMode.SHOW_ALL;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP;
I did try these and also tried changing my publish settings but didn't work.
View 7 Replies
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
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
Jan 18, 2010
I have downloaded this slideshow but cannot for the life of me figure out how to center the images. The slideshow calls the images from an XML.I have edited the width of the slide show just fine but the images are still justified to the left.
View 7 Replies
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 8, 2009
I am using ActionScript 3 in Flash to load images into a UILoader. There is a bay of thumbnail images, which are all movie clips. When one of these movie clips is clicked, AS3 calls a larger image to display in the UILoader. All of these images are narrower than the UILoader, some very much so, and they all have different widths for the most part.I would very much like for these images to be centered within the UILoader and (obviously) am unsure of how to go about doing it. If it would be possible for them to be both horizontally and vertically centered, that would be ideal, as they are also of varying heights.
View 3 Replies
Mar 7, 2006
Is there a way to center images that im am loading externaly using XML. Im new to this xml business and have found myself in over my head.
View 2 Replies
Jul 10, 2005
ive just butchered myself a gallery together which loads different xml documents (with image references in them) into an empty movie clip on the main stage-however- the images are all different sizes, and I cant seem to modify the script so that they will center correctly- i know I need to preload them in order to get the correct size for each image and then reload and display so that the x and y coordinates are correct-im using this script from kirupa's xml gallery tutorial- each different section of the gallery has this script attatched to the button that displays it-but im really stuck as to where to add a loop to ***** the images.- my brain hurtsI
on (release) {
function loadXML(loaded) {
if (loaded) {
[code].....
View 8 Replies
Feb 2, 2006
I got this far with my images display. I found code and it was able to work, but I'm not savvy enough with the code to unload images.I have 'searched' thru kirupa to see if someone had something similar. Found other 'centering images' type .fla's, but can't connect them to mine.I don't want to change the navigation or the way I have it set up -- I need it scripted frame-by-frame as it is. I was hoping someone knows how to get the images to 'unload' as you press each button.
View 1 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
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
Aug 9, 2004
what it has to do is to generate "j" buttons (j being the number of registrations from my database) and arrange them in rows of 5 or 6. unfortunately the buttons are generated but are not arranged properly. i have 9 registrations in the database so there are 9 buttons... the first 8 are next to each other and the last one is somewhere to the right.further on, at the release of a button it should create the lwLogo movieclip and load there a certain pic (the path being taken from my database). then the lwLogo mc should be centered on the screen... as this doesn't happen in the _root the center of the screen would be -442 in this movie clip so normally to center the image i should place lwLogo at -442-(lwLogo._width/2) but this doesn't work. the photos are loaded but not in the center.[code]
View 3 Replies
Jun 28, 2009
I'm making a 3d fly-through gallery, which is XML controlled, and loads in thumbnails, and then after loads in the images when you click on the thumbnails.Everything works fine when on my local hard drive, but after testing it on a website, it doesn't work.It loads the XML fine, but it never loads the images, or the thumbnails. The .xml file is in the same directory as the .swf, but the images and thumbnails are each in their own folders ("images" and "thumbnails").The funny thing is that it only does this when I tested it using Mozilla Firefox. I tried with Internet Explorer, and voila, it works magically!
I'm using the Loader class, and URLLoaders to load in everything, including the XML file, so it's either a thing about the different directories, or the fact that it's images...
View 4 Replies
Sep 24, 2009
I have an interesting issue, I am trying to load 12 images into their own "Loader" with Scale content set to "true" so they scale down a bit. If I run this in Flash it works great, the 12 images show up fine inside the loader. If I then load it to a website and view it with FF it works fine, however, if i load up IE one or two of them will be fine but the others will be huge, basically not scaling to fit. By Loader, I mean the component loader. I'm sure I'm not the first person to have this issue, my first thought was they are not loading 100% before Flash is trying to scale the content? If that's the issue, how do I preload them?
View 2 Replies
Dec 8, 2009
I'm running into a very strange issue when testing an application I'm building online: loaded images aren't showing.When testing locally everything works fine.I'm retrieving the images from an Adobe Scene7 server, and there's a crossdomain.xml in place there with the correct entries. I'm getting the right bytesLoaded and bytesTotal. I'm not getting an IOError Event.What could be wrong?
Here's a piece of the offending code: (I replaced Event.COMPLETE with Event.INIT, hoping it might make a difference, but it doesn't)
[AS]loader.contentLoaderInfo.addEventListener(Event.IN IT, onImageComplete);
[code].....
View 2 Replies
Jun 6, 2011
I have a flash project that uses an XML doc for data. The URL's in the XML load fine locally, but when published and placed online, they do not load. Is a policy file needed? If so, how do you do that?
View 1 Replies
Jan 11, 2012
I am having a problem where, when I scale an SVG in flex, it clips a part of the image, as shown below (the bottom right is clipped off, it should be rounded, like the top left)
Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" actionBarVisible="false"
xmlns:s="library://ns.adobe.com/flex/spark" title="Table">
[Code]....
View 2 Replies
May 8, 2009
I have a grid with 17 columns and populating it with images through XML. I would like to scale the images on Mouse over. I can get this to work but the problem is that some of the images when scaled are below the surrounding images. I thought maybe setChildIndex, but perhaps I was not implementing it correctly.
View 1 Replies
Apr 27, 2005
have a situation where i have 30 images on a splash page and when you rollover the small image it creates a larger version at the 4 corners of the page. See example here:SplashCurrently i am using this script:
Code:
on (rollOver) {
this._width = 128;
[code]......
View 11 Replies
Oct 25, 2009
i'm using uiloader to load my portfolio images... and when i test my movie the images appear, but when i put them online they don't... all my site is ok but my portfolio images just don't appear... i don't know if i'm missing some code... here's what i have in my actions layer:
[CODE]...
View 0 Replies
Aug 23, 2010
But it works fine locally.
I've created an extremely simple flash website. I need it to display some pictures and to keep the filesize down I want to load these images on demand. The images are hosted on my server in folders in the same directory as the website swf and the html file that initializes the swf.
I use the most rudimentary way of loading an image, it looks like this:
Code:
var loadStart:Loader = new Loader();
loadStart.load(newURLRequest("images/start/screenshotstart.jpg"));
startScreenshot.addChild(loadStart);
When I upload the website to the server it simply does not display the image, it's not loaded, the place where it's supposed to be is blank.
I've searched the site and there have been some threads with similar issues but the answers given just don't seem relevant. Something about cross domain policies, but all my images are on the same domain as the website swf.
View 2 Replies
Oct 9, 2008
I have a problem where my images are not fully displaying their dimensions (cannot see the whole image). How can I have the image being loaded scale to the properties of the holder? Would the whole image show properly, if I were to make the images the same size as the holder via photoshop?
function largeImageLoaded (e:Event):void {
holder.addChild(loader); // here
loader.alpha = 0;
TweenMax.to(loader, 1, {alpha:1, ease:Sine.easeIn});
TweenMax.to(loader, 2, {colorMatrixFilter:{amount:3,
brightness:1.5, saturation:1.2, hue:10}});
}
I assumed, that once you've brought in the image it would scale automatically? I am loading these via XML. So now, I will need a way to scale each of the loaded images to match that of the holder.
View 6 Replies
Jan 19, 2010
I have a Movieclip containing five images in a row. I have seven images inside a mc next to eachother like a T (Five across and three down) with one image being the center image. The images are under a mask an then the images tween on the X and Y but obviously only the masked part of the image is visible. The mask is 1280x649 and I was wondering how to proportionally scale only the masked area to full screen. I have the following code which works perfectly on a single image inside a mc but how do I do now?
Code:
stage.align = "TL";
stage.scaleMode = "noScale";
var picHeight = pic.height / pic.width;
var picWidth = pic.width / pic.height;
[Code] .....
View 7 Replies
Jan 24, 2011
I have a few 180 panoramic images in pan.xml and firstly I want to load the first image (width=2737) onto stage, then adjust its size (according to the stage size) with adjustScale function and finally tween it with slidePanorama function. The problem is that first image tweens to the initial position (x=-2737/2) and not to the new position (-scaled width/2), so there's some empty space left on the right of the screen... I tried putting that adjustScale function everywhere, it doesn't seem to work. What am I doing wrong? The second thing I want to do is to be able to navigate between other panoramas e.g. clicked on a button, load another panorama and repeat the same process as explained above..
ActionScript Code:
private var imgNum:Number = 0;
private function createP():void {
imgData = panXML.item[imgNum].imgURL;
[Code]....
View 2 Replies
Apr 28, 2011
scaling image for an image gallery project I am creating. I am adding each image inside a SQUARE Movieclip of their own so I can position them nicely on stage. As not all images are exactly square, there are always vacant gaps. What I want to achieve is to scale the image proportionally so that the smallest dimension of the image ( width or height ) will equal the same dimension of the square Movieclip, though anything that overflows the MovieClip is not visible.
View 1 Replies
Dec 23, 2010
I need to scale images so that they always fit within my browser but also retain their aspect ratio. All other examples I have seen at some point either the width or height is cropped off by the edge of the browser. I need my images to always stay inside but also I do not want them to ever scale above 100% i.e. no enlargement. owever the images don't stay within 100% scale and also get cropped off.else as much as I can.The code I have is like this
Code:
if(mainTL.allImages._width > Stage.width){
mainTL.allImages._width = Stage.width;
[code].....
View 2 Replies
Jan 24, 2011
The app itself will require some data from an online database to be downloaded and stored locally, so that the kiosk can be safely disconnected from the internet while running, and reconnected later to update its data.I'm currently trying to figure out the best way to do this. I figured that the data's easily enough loaded from a server-side PHP script and saved to a local SQLite database for offline usage, but I haven't been able to find any solid method of downloading and saving images. At least, not without using a save dialog.
View 1 Replies
Nov 8, 2010
Is there a way to use 9-slice scaling with images loaded at runtime? To clarify, let's say that I build an application that lets a user skin a button with whatever image they want. This would be an image that's not embedded with the swf. Is there a way to set that runtime image as a background and use 9-scaling?
View 1 Replies
Jan 27, 2009
I'm working on a Flash application that has thumbnails and fullsize versions of an image. The steps I'm taking:
- import the image at runtime, and attach to a movieclip (we'll call it polaroid, since that's what I'm calling it).
- resize polaroid via polaroid._width=3; polarois._height=3; to get my thumb
The image quality is OK for pictures, but it's also fairly important that text not look too pixelated. Is there anything relatively simple (i.e. not too taxing on RAM) I can do here? Even a blurring layer would do the job, if there is any such thing.
View 8 Replies