ActionScript 3.0 :: How To Unload Images
Nov 11, 2010how do I unload images from this function?[code]
View 4 Replieshow do I unload images from this function?[code]
View 4 Repliesfairly new to AS3 and just get'n the hang of it.. i'm have'n trouble unloading images from a holder MC...
thb_btn_01.addEventListener(MouseEvent.CLICK, load01);
function load01(event:MouseEvent):void {
var image:Loader = new Loader();
image.load( new URLRequest ("test01.jpg"));
holder_mc.addChild(image);
}
[Code]....
i'd like to clean the holder every time a new thumbnail is clicked.
I have a problem trying to unload some images from a movie clip ,What i have is a movie clip called " thumbnails" on the stage which loads some images from an array . the movieclip "thumbnails" , holds at the begining the first 4 images , then i have a button called "next_btn" which loads the next 4 images .basically when the next_btn is click it is loading the next 4 images which place them on top of the first ones , and is fine , but what i need to do is to clear the movie clip before loads the next images into.i have tried the unloadMovie method and it is not working , place the code below if anyone has any ideeas what i'm doing wrong ( actionscrip2 )
Code:
function LoadImages(startNo,end)
{
//thumbLoader.removeMovieClip();
//thumbLoader.unloadMovie(thumbnails);
// thumbnails.unloadMovie();
[code]....
was trying all 3 commented options from above , and none of them does what i want the first 2 are removing only the last image from the movieclip and the last one removes the all movieclip and is not loading anything else after
I'm a complete newbie to AS3 but I've recently been thrown in at the deep end I'm trying to teach myself (I'm a designer mainly, for my sins!).
I'm putting together a UI which includes a demo frame whereby I want to load a speech bubble image if the user hovers the mouse over a particular button.
I've bought various reference books and browsed through the forums, but I can't find any examples of how to do this (seemingly) simple task. I've found some examples of drawing a rectangle and other methods, but nothing for loading/unloading images.[code]...
I want the current swf to unload and the new one to load only after a transition occurs. Is there a more efficient way to do this than if. switch()?
View 2 RepliesI am working on a school project that requires me to load external .swf or .jpg files. I currently have all of the buttons working and are loading an external .swf file on to the screen. The problem I am having is that when I go from one button to the next the loaded .swf stays on the screen and the next .swf gets loaded on top of it. I know that I need to unload the file but I am not sure where to put the code for the unload or what code exactly to use. I would like when the button is pressed to unload the previous loaded .swf and load the new .swf without having a separate button to unload.
[Code]...
I'm trying to unload an external SWF on _root to load a new one instead. I've tried (almost) everything but can't figure it out... I get this error : "Error #1010: A term is undefined and has no properties."
[Code]....
I have a flash file sitting inside of a web page in our company domain. There is another server (used to store images) that is part of the domain but is not running any web services (for security reasons). A folder on the images server is however shared in such a way that any site on the web server can display images from the images server as long as the user is plugged into the domain. For example, both I and my boss can pull up a web site on the web server and see all the information, but only he can see the images
because I have Vista Basic and no domain support. This is done via "<img src='\serverNamedirectory.'/>"
That's ok, but on this particular instance I don't want to display the image on the webpage, I want it in a SWF on the page. However the SWF can't seem to load the images even though the page it's sitting in could. I've tried tons of variations of URLRequests and Loaders, most resulting in security errors. Since most of the online discussions about these errors revolve around cross-domain access, I can't seem to find any tech support for our specific situation.
i couldn't find a tutorial on this matter so i sorta started making my own hypothesis... what i'm trying to do is: have a gallery of images automatically scrolling horizontally while having the set of images loop. like at[URL]..
here are a couple of my theories and questions for AS commands to have this work:
1) display a range of pixels of an image at certain positions, i.e. if gallery is scrolling to the left, leftmost image when its parts are disappearing out of the viewing area, they become visible at the right.
2) have two instances of each image and when an image is disappearing on left, the second instance of that image comes visible on the right. this I imagine would take up more HD space.
i guess what i was wondering more about is how jager did their gallery where there's only enough images are in a set to be viewed in the viewing area.
Explaination: MX 04' Pro Thumbnail Nav. loading images with XML Loader resizes and displays images when users click on Nav. reading XML Problem: Users click Thumbnail Nav. first image gets loaded and loader resizes to image. However the next choice by user on thumbnail click, the second image doesnt get resized in the loader. It goes beyond holder. Here is my code for Thumbnail and Loader:
[Code]....
Now the first image loads fine and the loader sizes to file from XML. However, when users click second choice from Thumbail the loader doesnt resize to new image size. It only gets resized on the first selction or if users click the next or prev. buttons then the images fade correctly but nothing fades back in. Now if they do hit next or prev and then hit a thumbnail option it loads and resizes.
I am pulling external images, I have my main image, and five small images, I have that to make the small images when click to appear in the place of the main image, but I am not obtaining to make they to click, I am placing my archive who to want to make download
View 2 Repliesim loading multiple images but how do I make sure the program will start once all images have dispatched a complete event. like make a universal loader for all the other "small loaders" if you understand.
View 1 RepliesThis is my first post as i m just beginner in Flash JavaScript. I want to prepare a FLash Movie in which all the images r dynamic and the images should change after a time say every 30 secs the image changes.
View 1 RepliesIs there a way using flash you can display images but each one selected randomly from say an array of different images?
View 4 RepliesI am trying to load multiple images into a scene and then cycle through the images one at a time.So, here are the essentials what I've put together in AS3:First I set up a counter and a Loader
[code]....
Then, after loading a list of images from an XML file, I call a function that I called "createImages". This function then takes the list of images and creates a bunch of loaders:
[code]....
So far, so good! I now have a bunch of loaders each with a different name "img1","img2","img3" etc.
I have a photo gallery that loads many images using a for loop (image data is from XML file). Simplified code looks like this:
Code:
var photos_xml = new XML();
photos_xml.ignoreWhite = true;
[code].....
I would like to have my background image change images every so often. I would like to use only AS3 for this. Could someone point me in the right direction. I am new to the language as well as flash.
View 3 RepliesI've tried a lot of online tutorials for photogalleries but can't find what I'm looking for.I need to bring in my images from xml so that they will fill the thumbnails (if the width of the image is greater than its height then it will scale to the height of the thumbnail) and center within that thumbnail.
Then, when I click on a thumbnail, I need that image to fill the space allowed for the large photo (this time if the width of the image is greater than its height then it will scale to the width of the photo space)and center within that space again.In terms if centering the image,I have created movie clips for both the thumbnail and the large photo space (let's call them "imageHolder")and within those movieclips there is an empty movie clip called "image" which is aligned to the centre of "imageHolder". I thought that this would work:
imageHolder.image._x = 0-(imageHolder.image._width/2);
imageHolder.image._y = 0-(imageHolder.image._height/2);
But no such luck.
As for resizing the images to fit the image holders,
the easy part is to create the image and the mask for it:
// The jpg
var elementImage:Image = new Image();
elementImage.source = "/assets/materials/9/main-body.jpg";
[Code].....
but that's not working here. the event listener reacts even if i hover over the trasparent parts.
if i draw an vector graphic and use it to mask the image it works just fine...
I need to load dynamically a few images (4-6) so that by clicking on particular image user would invoke particular action. Embedding images solves the problem but at the expense of file size. If I load them dynamically, they lose their ID.
<comps:ExercisesScroller id="scroller" x="300" y="100"
ex1="@Embed(source='assets/Exerc_1.png')"
ex2="@Embed(source='assets/Exerc_2.png')"/>
and so forth this works. But instantiated in CDATA it does not work:
import components.ExercisesSCroller;
private var custScroller:ExercisesScroller;
private function init():void {
[Code].....
is it better to import images to the timeline at runtime, or export them from the library for use in action script?
I have a few images which make up the background to my website (ie they are unlikely to change very often - if at all), which I am currently exporting from the library for use with my action script code, and the rest of my images I am dynamically loading in based on a set of paths held in a csv file (these may change often).
As I have already built the class to dynamically load in external images, I was wondering if I should also load in those images which make up the background.
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 RepliesIn flash there are some n number of images like a list.If i drag on image and drop it somewhere between two images the images should arrange automatically as we changed. I have no idea of how to do it.
View 4 RepliesI am using actionscript 3. I can load an image in a class but how do Iload a number of images eg 4 images that animate.?These 4 images are a walking sequnce of a character. I am unclear after googling an loading multi images in as3( just love google).
Loading a single image I load this into a loader Once loaded I load the image into a bitmap and add to a sprite I then add the spite to the stage Q)Now for 4 related images I load 4 loader or 4 sprites or 4 bitmaps or do every thing 4 times?I want to do collisions eventually and I need bitmaps but bitmaps seem useless to use other than collisions.Googling for answers isnt helping me clarify this!
[Code]...
I have an swf, lets call it 1.swf, that has a button that calls another swf to level one. In that second swf, lets call it whatever.swf, on layer 1 it has an flv file of about 40 seconds. on layer two it has a button that has this action:
on (release) {
unloadMovie(1);
loadMovie("../swf/1.swf", 1);
}
So if that button is pushed, then it unloads whatever.swf as I need it to.
the problem is that if that button is not pressed, then when that 40 second flv finishes, it just sits there with a black stage and the button. What i need it to do is that when that 40 second flv is finished, it automatically unloads whatever.swf on level 1, again showing 1.swf on level 0.
Also, before anyone anwers, the way i did the flv is that in whatever.swf the flv was imported to the stage, i slected the "already deployed" put in the URL and then it created a flash video component which is on the stage.
how I can do to unload a swf before I load the next one?
var mLoader:Loader = new Loader();
function loadSWF(e:Event):void {
var imageId:Array = e.target.name.split("_");
var targetId:int = imageId[0];
[code]....
I am trying to add a external Swf files to my home page because my other pages are swf files. when i click other page it will call to my swf file. but my current home swf file running under my new page swf... so how can i unload my old swf.
View 2 RepliesI'm using AS3 to load one swf (a document viewer) into the main swf. the loaded swf takes up the entire stage, so I need the unload button to be in the loaded swf.
is there an AS3 equivalent to this.unload?
I have an AIR application which load/unload external AS2 SWF files. My problem is that when SWF is unloaded its Enterframe events keeps runing.
View 1 RepliesI have a random number of sprites that are created, each of them hurts the other when the collide, and when they die, I wanted the collisions to not do anything anymore.
I can fade the sprites out to make them invisible when their "health" reaches 0, but they are still there, and when they collide, they cause "ghost deaths" to other mcs. How can I get rid of a sprite from within itself? Or at least disable its onEnterFrame function?