ActionScript 3.0 :: UILoader.content Stays Null After Load?
May 14, 2009
I've started with a new Flash file and wanted to toy around with loading images and resizing the UILoader to the size of the loaded image. I've added a UILoader (instance name: loadImage) component to the main timeline and added the following code in the Actions window:
loadImage.source = "bookmark.png";trace( loadImage.content );
The image displays properly after compiling and viewing the SWF. However, loadImage.content returns null, instead of the DisplayObject that contains the image. This way, trying to resize the UIloader according to the loaded image doesn't work, since I can't access variables of an object that hasn't been initialized.
All the documentation states that loadImage.content should contain the DisplayObject that's loaded after setting loadImage.source or using loadImage.load( new URLRequest( "bookmark.png" ) ) (which also has the same problem).
View 2 Replies
Similar Posts:
Jan 26, 2011
I have to dynamically load an image in 2 separate places, but I don't want to have to load the same image twice (this consumes more bandwidth and makes the user wait longer than needed).Is there a way to, say, copy the contents of a UILoader into the contents of another? I am aware that flash performs caching, but I still see a slight loading delay on subsequent reloads.I am using as3, btw, on flash cs5.
View 1 Replies
Aug 8, 2011
I'm creating a UI which utilizes UILoader component to load content that I won't have control of.The "window" where I want content to appear is 950 x 420. Doing a simple test, I created a .swf with a stage size that matched, but with content bleeding over the edge of the stage.To ensure users only see what's on the stage of the loaded content - and not what's bleeding off - would the correct action be to create a mask for the UILoader instance? Are there any alternatives to using a mask? Like a property or something? (I didn't see anything.)
View 4 Replies
Aug 31, 2009
i am using flash cs3 with as3. i want to slide content of uiloader with some percentage whenever i click slide button.i have a UILoader of size 1024*768 with scaleContent=false , and the mask of size 1024*768 set on uiloader. i have an image of size 2048*768 and i load this image to uiloader, now i have a two buttons on the screen one for slide left and other for slide right.i want to slide uiloader content by 256 pixel every time the button was clicked in particular direction(depends upon which button is clicked).
currently i am working on right button only. so ignore left sliding at this point.The problem is when i clicked button first time it works fine but when i clicked the same button second time the slide of image is disturbed and it first goes 256 pixels behind zero and then slides to 512 pixels (at third click again it starts from -256 and then come at the target position) . i want to slide the uiloader contents from 256 to 512 at the second click and so on.
View 1 Replies
Oct 7, 2010
Is there any way of getting the size value of an image that is loaded into, and scaled down, a UILoader?It's not the original image size I'm looking for, nor is it the size of the UILoader, but the present size of the content of it. I found setSize, but I need something like getSize.
View 0 Replies
Nov 25, 2010
I have UILoader that loads images 427x240, then I thought to load an external swf dimensions 427x273. So I resized UILoader to height 273, now the images on load are positioned vertical middle, gap top and bottom, i need this to be absolute Top. How do I set UILoader loaded content to position Top?
View 2 Replies
May 5, 2011
I have picked up a uiLoader component, and copy-pasted four times, so now I got five of them in my flash movie. Each got a different source (dresses/dresses1.swf, dresses/dresses2.swf, dresses/dresses3.swf, dresses/dresses4.swf, dresses/dresses5.swf). But When I launch the movie, all the 5 uiLoaders display the same content: dresses/dresses2.swf, and I can't understand why. For a test, I have replaced the .swf file with some jpeg files, and they were ok, but as I put the swf files back they show the same content again. The sources are ok, they work perfectly separately, so I can't figure out what is the reason why the swf files are loaded incorrectly..
View 3 Replies
May 19, 2010
I have changed the UILoader box position for different labeled frames. But the UILoader keeps loading the content at the same place, no matter what the content I ask him to load. If I move the UILoader at the middle of the page, the content still loads / appears on top of the page as if the UILoader
View 0 Replies
Dec 24, 2009
I have several external loaded swf's in my website.For example;When in home and clicking to contact. Then contact gets a little bit smaller.When clicking back on home, home gets smaller and so on..if i repeat this process everything gets smaller and smaller..
View 3 Replies
Jan 30, 2010
I have a problem with the Home button. I want to disappear content of the 3 UILoaders components that I have on stage.I try to use the method removeChild(UILoaderName) but it doesn't work. This is my code:
function goStart(event:MouseEvent):void
{
gotoAndPlay(200);
count=1;
removeChild(central);
[Code]...
View 3 Replies
Jun 18, 2009
The whole problem is in the title. I have a gallery which looks a lot like coverflow. Each button in it loads a new gallery which is a swf with a new XML. The Problem is it only works on the first time i click on a button. The XML does not renew when i click on another button. It does load the new XML.
[Code]...
View 8 Replies
Mar 31, 2003
i need to know how do i make a menu on flash but i dont want to load a hole new site evry time i go to a section so i wana get the codes for that
View 1 Replies
Jul 23, 2009
my UILoader won't allways load its image.I named it "imagem".The source string comes from the buttonīs label.The click function loads simultaneously 3 UILoaders (imagem, imagem_prev and imagem_next and one caption (legenda) consisting of a simple string.Every now and then it doesnīt properly load the images.I have pasted the function for the click EventListener bellow.
function abrir_obra(e:MouseEvent):void{ var theContent:String = e.currentTarget.name var contentArray:Array = theContent.split("_"); index2=contentArray[2]; var alvo:String = e.target.text; var st:String=myArr1[1];
MovieClip(this.parent.parent).gotoAndPlay(31); imagem.visible=true; imagem_prev.visible=true; imagem_next.visible=true;[code].....
View 3 Replies
Nov 15, 2010
do anyone know how to load in an UIloader purely with action script withoud dragging it onto the stage?I have try the following code but it just can not work.
View 3 Replies
Mar 13, 2009
I'm trying to load an external .swf using UILoader. If the .swf doesn't have any code, it loads fine. But if I add any code, even only comments. It gives me this error.[code]...
View 1 Replies
Aug 31, 2009
is it possible to load dynamic/animated gifs using a UILoader by any chance? Simply stating its source just gives a static image which is no good ~_~
View 2 Replies
Oct 15, 2009
I'm would like to use the UILoader to randomly load an image from an array according to the day of the week. The attached FLA file is in AS2, it is exactly what I would like to do but now in AS3. I've been able to successfully trace the date using:
var today_date:Date = new Date();var dayOfWeek = today_date.getDay();trace(today_date.getDay());
In AS2 I used this the loadMovie function to randomly display SWF's in the movieClip. From what I can tell loadMovie is not an option in AS3 making me think that using the UILoader may be a good solution.This is what my code looks like in AS2 (also attached the FLA file):
loadShow = function() {
var today_date:Date = new Date();var dayOfWeek = today_date.getDay();trace(today_date.getDay());[code]....
View 8 Replies
Dec 3, 2011
I have a typical logo on the right top corner and a menu bar just above it. Above the menu bar, I have a UIloader in which I load photoalbum.swf when one of the menu buttons is pressed. The problem is that setting the scaleContent property to true doesn't load my external swf.Setting it to false, everything appears as expected, except that the bottom part of my photo album is cut since the scaleContent property set to false (this makes the loaded swf file's size the same as the stage's and as the UIloader begins just above the menu, the bottom part gets cut off).
View 2 Replies
Aug 15, 2009
I'm have made some buttons (movie clip) and when I click on it, I want a file (home.swf) to load in a loader (mx.contents.loader) and I want the other buttons to do the same, all load into the same loader. I have no Idea how to do that. The way I have it set up now, the home.swf will load over the entire screen and that is not what I want. I just want the content to load into the loader and have its content change once I click on the other buttons. Here is a copy and past of that I have at the moment, I'm using Flash 8 to do it all.
[Code]...
View 1 Replies
Feb 18, 2010
I load successfully an external image using a Loader class but every time i trace the loader.content property is found null.
View 1 Replies
Oct 17, 2009
I`m using AS3 + CS4, and have a problem. At the main page I have "loader" - UILoader, in which I want to load one of the 2 swfs - it depends of 2 buttons on stage
[Code]...
By default main_ru.swf is loaded, and after I press en_button I can see only a part of main_en.swf, and larger part of main_ru.swf. why?
View 14 Replies
Feb 15, 2009
I put in the stage 3 instances of uiloader and name pic1, pic2, pic3. How can i load a bitmap in these 3 instances of uiloader with a loop structure;
View 5 Replies
Jul 24, 2009
I have a UI loader that loads images (arabic file names) from folder based on some user input. The images loads fine when i'm opening the SWF file, but when it's on an HTML page, the files' names are encoded some how and then not loaded. When I write the full path of an image in the browser's address bar, the image opens fine. Is there away I can keep the file names in arabic, and make them load when the swf object in an HTML page?
View 5 Replies
May 7, 2008
I have an array of loaders loading .jpgs. After the Event.COMPLETE fires, I trace the content at the current page and it tells me the content is null, BUT on testing the images appear just fine. Here's my code:
Code:
for (var i:uint = 0; i<pages.length; i++){
pages[i].contentLoaderInfo.addEventListener( Event.COMPLETE, loadImg, false, 0, true );
[code].....
View 1 Replies
May 5, 2009
I'm trying to load different XML content with buttons. Basically all i'm able to do right now is have the XML load when I test the movie. Outside of that I haven't been able to get my script correct to call up the XML when a button is clicked.Here's the code i've been trying:
var content_req: URLRequest = new URLRequest ("http://www.kirupa.com/net/files/sampleXML.xml");
var content_ldr: URLLoader = new URLLoader (content_req);
content_ldr.addEventListener(Event.COMPLETE, onComplete);[code]....
So this is wrong because when i export my movie and click on the button I get this message:
TypeError: Error #2007: Parameter text must be non-null. at flash.text::TextField/set text()
at dynamicText_fla::MainTimeline/getnewText()
Also, when the XML does load into the text field, I'm getting the entirety of the XML document, not just the bits of information that I want. It wasn't doing this before when I would just export the movie and the XML information would come up in the output panel.
View 1 Replies
May 9, 2009
The title describes the problem: Loader.load() is firing the INIT event, but in my listener it's reporting loader.content as null. The description for INIT event is "Dispatched by the associated LoaderInfo object when the properties and methods of the loaded SWF file are accessible."I'm loading a lot of JPG images, and 95 percent of the time it works fine; the init listener fires and reports valid loader. content.I absolutely need loader.content available because I need to set the bitmap smoothing property to true.I've tried using Event.COMPLETE and it has the exact same problematic behavior.
View 13 Replies
Sep 6, 2009
I've built a photo gallery that resizes with the window browser. The only problem is that when I first open up the window the gallery is not properly scaled to fit the window size. I was given a tip that when you place resizeListener(null); in the code. This worked, but the only problem is that the image scales disproportionately when the window loads. I've noticed that when I tinker around with some of the code (highlighted in RED below) it effects this, but I have not figured out how to resolve it.
import gs.*;
import fl.transitions.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
[Code].....
View 1 Replies
Jul 16, 2009
Ive been using the same bit of code to load XML data into various little projects... but I keep getting the same error (thought oddly not in all browsers)
[Code]...
View 3 Replies
Apr 23, 2009
Url...He wants something similar but his site will be 100% flash and so this will have to be done form a flash form.I'm having problems even getting this running from an HTML form. I've done my best here:URL...but since I don't know the original output settings of these flv files I'm trying to load over the submitted page, the versions are messed up and when I run the form, I keep getting prompted to download flash player.Do I need to embed these flv fiels of presenters I have and plonk them into a swf file and then load that swf file from the form, rather than link directly to the flv?I'm tearing my hair out over this - I thought I'd be able to work it out easily from the numerous pages out there that offer the same service but there don't seem to be any resources online that point me at creating a form to load flash content over a submitted URL.
View 2 Replies
Feb 9, 2011
I would like to create a Flash menu but want to load HTML inside a targeted div on the same page dynamically without refreshing. I've seen several people say iframes can be used but I would prefer to stay away from iframes and use divs if possible. I'm guessing some fancy javascript would be required?
View 1 Replies