ActionScript 3.0 :: Loader Resize Not Working In Distributed SWF?
Jul 5, 2009
I have recently created a game in Flash CS3 with AS3 which displays a random picture (this is a pretty integral part of the game).I have written a small procedure to resize the picture to an appropriate size for the flash application. This is as follows:
ActionScript Code:
function onComplete(ev:Event):void {
var maxheight = 240;
var maxwidth = 400;
[code]....
Here is where it is called, please just take for granted that d_arr[1] contains the correct URL of the image I want to load :-)
ActionScript Code:
var url = d_arr[1];
var urlRequest:URLRequest = new URLRequest(url);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete);
[code]...
This resizes the picture when it is fully loaded. This seems to work fine on my own site, but on the sites to which mochi ads has distributed it, it doesn't resize the image at all, even if it is left to fully load.
View 1 Replies
Similar Posts:
Jun 10, 2011
is there a way to set the loaded SWF's height and width to always use 100% of the Loader's height and width? pretty much like when you're embedding a swf to an HTML page... I know that you can do this by setting the width and height of the Loader on every stage resize, but is there another way wherein you can just specify height and width is 100% and then loaded SWF will automatically resize according to stage and Loader's current dimensions?
try loaded a SWF file which has coordinates based listeners and it seems that the loaded SWF doesn't reposition its listeners correctly even if the stage is already resized... take this swf for example [URL] i tried using an SWFLoader in flex which scales the content and also a normal AS3 flash.display.Loader and it seems that both fails to reposition the listeners correctly.
View 2 Replies
Feb 21, 2009
I need to add the image to an object as a child.. then resize it.. I know how to add it as a child (easy rly)[code]...
View 3 Replies
May 10, 2009
How to resize Loader that load an image using as 3?
View 4 Replies
Mar 10, 2010
I am loading a fairly large image file and want to create a bitmap of the loader content. I want to then use this Bitmap and resize it according to the current dimension of the stage. However, I also want to keep the loader content as "originally loaded" as a reference in case the stage is resized and the user wants to view this particular image again. The way my AS is written as of now, I am manipulating the loader content. How do I not do this? How do I "copy" the loader content so I can manipulate the bitmap copy while leaving the loader content unaltered?
<AS>
var lightboxImage:Bitmap = new Bitmap();
function resizeLightbox():void{
lightboxImage = myLoader.content;
lightboxImage.width = myLoader.content.width;
lightboxImage.height = myLoader.content.height;
[Code] .....
View 8 Replies
May 12, 2010
Here is my problem (unfortunatelly didn't find solution @google):I'm loading external swf[AS2] into main swf[AS3] using Loader class. The main swf is 800 x 600 and the external swf is 300 x 200.After adding the external swf to the main swf the external swf expands it's size from 300 x 200 to the main swf's size: 800 x 600.
View 1 Replies
Mar 8, 2011
I have an application developed in Falsh (EXE) that is to be distributed on CD-Rom and was wondering if anyone had any suggestions on protecting the application from copying.Is there a way within the dev environment I can "stamp" it to prevent copying, or another technique?I don't mean using getDate(), getMonth(), getFullYear(), etc.I have used this to create an expiry date on versions that are being distributed, which then shows an out of date message (which can be easily worked around with the system clock unfortunately).But I wish to protect the disk from being copied, and wondered if there was any techniques from within Flash to do so.Glass mastering and watermarking is not viable as it'll only be a very small duplication run (10, maybe 20 disks).Alternatively, are there any stable utilities that anyone has used (and recommends), prior to me investigating available commercial copy protection software?
View 2 Replies
Jan 17, 2012
I am starting to learn how to use Flash. I am trying a simple exercise of creating text, breaking it apart, then distribute the objects to layers. When I do this, the layers in the timeline box appeared not in order, intead of Top to Bottom, the letters appeared Bottom to Top (See attached picture).
View 2 Replies
Oct 6, 2011
I wanted to create an application installer (per chapter) like the one implemented on the product on this site:[url]...i have no problem creating flash apps but i'm so lost on making installers , like update installers for the same app.. the idea is that on first installation of my app, other contents are not available until the user downloads it from my site and install it on their pc. and that installer will just update the existing one with the new downloaded content.
View 1 Replies
Dec 3, 2010
First, just to give a visual idea of what I'm after, here's the closest result (yet not exactly what I'm after) image that I've found:[URL] BUT, it doesn't exactly solve the problem I'm after. I would like to store an array of points of a very specific spiral algorithm. The points are evenly distributed The 360 degree cycles have an even gap If I'm not mistaken, I think it's obvious that the two first points would be:
[Code]...
View 2 Replies
Jun 19, 2010
The following action script for loader is working fine:
var l:Loader=new Loader();
addChild(l);
l.load(new URLRequest("MyLogo.swf"));
But when I added one more loader to it like the following...It doesn't show anything but gives an error:
[Code]....
View 5 Replies
Dec 1, 2008
I'm trying to simply have 4 images at a time appear, then scroll over one image when a button is clicked. I'm using the Loader component to call in the external jpgs. This works perfectly in Firefox and when I preview it in Flash, but in IE the images don't load properly. I'm scaling them down using the Loader parameters, but IE usually tries to load the full-sized images. You can see the problem if you visit [URL]
View 1 Replies
Jul 7, 2009
URL...Its a dynamic positioning template, basically.I'm importing docked_icons.swf onto the stage via the holder movie clip (at the end). However, the position is messed up until I resize the window. From there, it's perfect. How do I set the initial position to be correct?[code]
View 1 Replies
Feb 18, 2009
Why the mc's are staying where I want them when you resize the stage?
View 2 Replies
Jun 25, 2009
I'm trying to do in this case is populate a List UIComponent that I created with information that I get back from the PHP file. For some reason the loader.addEventListener(Event.COMPLETE, userOnLoad) isn't working and my program never gets any farther than that.
Here is my code:
import fl.controls.*;
import flash.display.Sprite;
import fl.managers.StyleManager;
DECLARATIONS
var backgroundArea:Sprite = new Sprite();
var loginArea:Sprite = new Sprite();
var userArea:Sprite = new Sprite();
[Code] .....
View 1 Replies
Jun 22, 2007
why this isn't working with as 1.0? I have to publish it with 1.0 for other reasons. basically i want a simple preloader:
[Code]...
it goes straight to 100% when viewed through the download simulator, but the image isn't actually loaded. I don't really know as 1.0, just 2.0.
View 1 Replies
Dec 24, 2009
I want to create an image slideshow. When the user clicks the next button, I want the current image to fade out and the next image to fade in. I'm using Loader to load images, using .load(new URLRequest("imagename.jpg"). When the first image loads and next button is pressed, the image fades out just fine. The problem is when the second image loads. the image loads, but doesn't fade in, it just appears without the tween. Here is my code:
Code:
import flash.display.MovieClip;
import flash.events.MouseEvent;
import com.greensock.*;
[Code]....
View 7 Replies
Dec 6, 2011
I'm trying to load a .png and display it but the iPad and iPhone show a white screen. Here is my code:
Code:
public class Test extends Sprite
{
private var loader : Loader;
private var urlRequest : URLRequest;
[code]....
This works fine when tested in AIR but not when I test on the device using the [TEST on DEVICE] build. My TestImage.png is in the bin folder where my Test.swf gets compiled into.
View 7 Replies
Jan 6, 2011
Well I have now managed to trace down the problem. It seems as the microphone stops working if I resize my flash application. In other words if I resize my flash application from its original size, the allow microphone dialogue is no longer displayed at the start of the application and the microphone remains muted.
View 2 Replies
Apr 21, 2010
The floating elements stop floating on the y axis when javascript resizes the scrollbars.
It seems that when externalinterface calls the resize function that after that then flash uses that value as the Stage.height value.
I need a way for the scrollbars to be forced to accomodate 2000 px worth of content. But still have the elements float within the actual open browser window which could be much smaller than 2000.
View 4 Replies
Mar 14, 2012
I just inherited some code that produces an embedded rdio music player into a swf. It works great in firefox and safari, except the embedded player does not appear in Firefox... Is this a common issue with the Loader class or contentLoaderInfo events?
import flash.display.Loader;
import flash.display.Sprite;
import flash.display.StageAlign;
[code].....
View 1 Replies
Apr 22, 2010
I'm having trouble with a simple loader not loading an external swf file.I have a set of menu buttons (created from a class) that store the swf file name. When these are clicked they run a function that supposed to load the swf file but for some reason it doesn't (but maybe it does load it, just not display it). So here's the code:
Code:
var urlLoader:Loader = new Loader();
var pageHolder:Sprite = new Sprite();
[code].....
View 3 Replies
Oct 23, 2009
In my current flash application I and my co-workers are using Loader to load some SWFs from our server. It works perfectly while we have the flash application on our computers running it trough Adobe Flash CS3 but when we publish it and move the html page to our server and try and run it from there the loading doesn't seem to start. I have the firebug plugin for Firefox so I checked if flash actually loaded the images and according to firebugs network monitor it found all needed resources and downloaded them successfully. But the behaviour of our application is as if the loading starts but the complete event is never sent.
View 3 Replies
Feb 4, 2008
I'm having trouble getting my preloader working using the Loader class, here's the code so far...
[Code]...
View 5 Replies
Jan 26, 2009
I have a really simple class that loads in some XML and splits it into an array, but for some reason the URLLoader wont trigger the COMPLETE event.
Code:
package com.georgecrabtree {
import flash.events.Event;
import flash.net.URLLoader;
[Code].....
View 6 Replies
Sep 21, 2009
I'm running into a problem loading an external swf. Check it out here: [URL]
If it's working right, the top and bottom red areas should end up looking exactly the same.
I have "init.swf" loading "cc_home.swf" into a container. When successful, it should fade up (that animation is in "init.swf") and then load the white text (cc_home.swf). What you're seeing on that page is init.swf on top, and cc_home.swf down below.
When I test init.swf directly from Flash, it works fine. In the browser, though, it doesn't load the movie.
Here's the code I'm using in "init.swf" to load cc_home.swf (which I got from Kirupa):
var mycontainer:MovieClip;
var myloader:Loader = new Loader();
var urlrequest:URLRequest = new URLRequest("cc_home.swf")
myloader.load(urlrequest);
[Code]....
View 1 Replies
Jan 17, 2011
I'm having trouble with a simple loader not loading an external swf file.
I have a set of menu buttons (created from a class) that store the swf file name. When these are clicked they run a function that supposed to load the swf file but for some reason it doesn't (but maybe it does load it, just not display it). So here's the code:
Code:
var urlLoader:Loader = new Loader();
var pageHolder:Sprite = new Sprite();
pageHolder.height = 420;
[Code]....
The "page loaded" trace is being displayed, so must load the swf but not show it.
I can't even see the preloader. I also tried a very simple swf file with just some shapes and 1 frame but still no luck.
View 1 Replies
Oct 25, 2007
I'm having some strange luck in building an image slide show.I load the image paths into an array from an XML page and then step through the array elements w/ forward and back buttons.I have an empty image clip on the stage where I create an empty movie clip inside each time a new image is loaded.I load the image into the second movie clip like this:[code]Now, 98% of the time this works perfectly, but there is some certain times where the image resizing is completely ignored and the image gets loaded as it's normal size.Can anyone see why the image sizing get's ignored in some instance?
View 1 Replies
Feb 26, 2010
All this code works properly, however when I include the part which controls the video resize metadata the scrubber stops working... (see the section between the ">>> <<<").
Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(2);
ns.onStatus = function(info) {
[Code] .....
View 2 Replies
Sep 28, 2010
Is anybody else finding their flash website event.RESIZE isn't working in Windows 7?My website works fine when I run it at home in Vista, however at work in Windows 7 it just does not work and I have no idea why???! Essentially the bit that says portfolio works should stick in the top right corner on resize and the mute and sound button in the bottom left.
View 9 Replies