I'm trying to load a couple of images and store them in an array. After this process is complete, I want to loop through the array and add these pictures to the stage.Here is my code:
Code:
var imagePaths:Array = new Array("1.jpg","2.jpg");
var imageArray:Array = new Array();
iam creating a pallete in that i have a class movieclip with 1 image and 2 text (title, desc). Here iam connecting a xml and creating the same class and adding it to the scrollpane. in that each item (movieclip) i need to load images and fill the text. iam filling the text and loading the images. but i need to scale the pictures to 35x35. actual size of the pic is 70x70.my code is :
function fillitem() { var ypos:Number = 10; //reptitle.text = myxml.toptitle; reptitle.text = options[0][0].tit; var tf1:TextFormat = new TextFormat(); tf1.color = options[0][0].col; tf1.size = options[0][0].siz; tf1.bold =
I need to load a bunch of images using a for loop looping through xml. This will be called over and over for various groups of images. Memory management is a major concern. In the for loop I create a loader
ActionScript Code: var thumb_loader:Loader = new Loader(); var thumbContainer:Sprite = new Sprite(); thumb_loader.load (new URLRequest (panelViewer [categoryPanels [indexCategoryPanels][i]].@pathName)); // set the thumb node from xml thumb_loader.contentLoaderInfo.addEventListener(Event.INIT, thumbLoaded); thumbContainer.addChild(thumb_loader);
I also add the thumb loader as a child now in the init handler ActionScript Code: function thumbLoaded(e:Event):void { //when all thumbs are loaded I set them alpha to 0 and then to 1, for a nice effect var thumbTarget:Object = e.target.content; thumbTarget.alpha = 0; Tweener.addTween(thumbTarget, { time:1, alpha:1, transition:"easeOutSine"} ); }
The issue I have I keep adding sprites and loaders and this keeps sucking resources this is for an air app that has to run for several days cycling through hundreds of images. How to keep my resources low and load a group of images delete the loaders and then on the next cycle delete the previous group.
I am loading several images using a loop. My question is, would it be better to put the "contentLoaderInfo.addEventListener(Event.COMPLETE..." in the loop so it loads the complete handler each time it goes through the loop, or is it fine to put it outside of the loop at the end?
I have a group of 16 images that I would like to load 1 of each into each movieclip. I want image1 to be inside of visual1, image 2 inside of visual2, and so on. the images are named like, 1960s_(1).png where the 1960 (year) part is coming from the rangeNum variable. The above gives me this error: 1061: Call to a possibly undefined method addChild through a reference with static type int.
i have been building a library that has thumbnails which you click to view the full image. i have built the application it works but i want to change the way the image on the actual thumbnail loads using code instead of manually adding the value to the url loader component.
var myX;var instanceN:String;trace(instanceN);var currentLoad:uint = 0;// current loader and image loadingvar thumbnailURL:String;//Thumbnail URLvar thumbReq:URLRequest;// Thumbnail url requestfor(var k:uint = 0;k < iL_btn.length; k++)[code].....
the loop runs fine without the last line of code which i've commented out.the make up of these thumbnails are a uiLoader component which are each inside there own movieClip.what i wanted this to do was every time the loop runs it currentLoad adds 1 to its value then that value is subbed into instanceN:String and thumbnailURL address that bit works the trace statements read correctly.but my issue is using the instanceN value as the instance name path which then loads the current thumbnailURL value which is the URL address for the thumbnail picture.when i try to load the url address using the commented out code above i got the error .TypeError: Error #1010: A term is undefined and has no properties.the trace statements correct values below
the first value is the currentLoad value.
the second value is the instance name path.
the third is is the URL address for the thumbnail.[code].....
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.
im 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.
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.
I have typical situation where big loop is loading lots of images and its done asynchronous which make browser to frees during loading and I want to make it synchronous but having big trouble doing it. I found this class synchronous loader and it work great but you cant add mouse event listener to loader. Here is sample code:
I want to have an AS3 app load images from url supplied by the user. But I don't want a malicious user to be able to load an SWF file in place of the image, such as with an altered extension "maliciousSwf.png". Well, not sure how big a security threat that is above and beyond the ability of the hacker to decompile swf, but I think that ideally such behavior should not be allowed.
So, is there any way to prevent this? When people allow users to load images in their Flash apps, do they somehow guard against loading of SWF? Or is this really absolutely no big deal?
How would you defer loading of other graphics on the page until after the images in a Flash gallery's images.xml file are finished loading?Is there any way to detect for this, or would I only be able to check if the flash swf object is finished loading? I'm pretty sure the swf object would be loaded/ready as with document.getElementById('flashobject').onload = function(){}; before the corresponding images have loaded though, instead of after.
I am loading images of different size and then images are scaled and border is drawn for each image as shown in below link,[URL]... I want that border of images to be of the same width and height and for that I need to find out the max width and height size image before loading all the images. Is there any way that I can know the width and height of an image before loading it completely?
I am working on a Digital Signage-type application. I am attempting to change the script below so that the slideshow loads using the variables set in the slides.xml file, plays 3 times and then reloads the slides.xml to pick up any changes to it.
The script below is a sample file supplied by Cisco. It loads the slides.xml once and loops the slides indefinitely. I am attempting to modify it to allow it to pick up new slides that are added throughout the day. I know I need a loop, but not sure where to put it so it works correctly.
I'm making a highscore table in flash using AS3, I have successfully got working code that displays the names and the scores but also part of my high score table it needs to display the users country flag. The images for the flags are stored on a remote server.
Now I know how to load in a single image and add it to my movie clip but things get very complicated when I want to load in 20+ by iterating through a loop. I've looked at many examples and just cant adopt the sample code to work for me. Anyway without a further a do here is what I have so far.
I have 8 sprites and I want to load png for my buttons but I don't want to have to type all that loader stuff 8 times, so i wanted to try to create a loop with it.
Hopefully that makes sense, This is me trying to do it with just two but the plan is to have 8 buttons.[code]...
I am modifying the Flashr wrapper for the Flickr API by [URL]
the code below uses a loop to arrange thumbnails gallery along x. I have changed the wrapper so it is now loading medium sized images rather than the thumbnails.
The flickr thumbnails are the same size so "360" is used in the code below to space them along x. Now im using images that are different widths i need to set this value dynamically so the next image is placed along side the previous one with space in between no matter the width, but i dont know how.
ActionScript Code: function onPhotosSearch(resultsSet:ResultsSet) { var currentPhotoIndex:Number = 0;
I am trying to load 10 images through an array using a loop. I have the images loaded as movieclips and this set up but nothing is working. Any suggestions?
var picArray:Array = new Array[img1,img2,img3,img4,img5,img6,img7,img8,img9,img10]; for (var i:Number=0; i<10; i++) { }
Is there a way to load multiple images with a loop and an array... i mean without using xml as said all forums that i've already read... i have 15 images and i want to know if it's possible to load all of them without a loader and a URLRequest for each one... there is the position problem too.[code]...
I've made a script which loads in, at intervals, images in a sequence (image1.jpg, image2.jpg ). However I've being doing my nut as to how to remove the preceeding image from memory as looking a the Windows Task Manager, each image gets added again and again, accumulating memory usage. I've tried removeChild, and null; stuff, but to no avail.I want it to go through the 10 images, and with each step to the next image, remove the last one from memory.[code]
I've always struggled with this for some reason, but say I have 5 images loading from XML. How would I make it so they would cross fade each other on an endless loop? I can make it so it gets to the end by loading them on top of each other and then fading each one out, but once I get to the end I'm lost.
I have an image which i am attaching, it is the white portion of the image( i saved it on a black background so it is easy to see, but it is on a transparent background saved as a gif and imported to flash). When my for loop runs, i am trying to position this image on stage programatically, but it seems as it is not doing it right. It scales the image, and positions some all over the place.I wanted the images (8 of them) to appear in 2 colums each one spaced out evenly, but it fails to do that. The movie clip holds the image below. Also since it is a irregular shape, it seems to make the edges look really rought.
1) Why is the for loop generating these images all over the place like that?
2) Would it be more ideal to draw this shape with flash, rather then using a gif image? Is such a shape even possible to draw?This is the code:
import fl.transitions.*;import fl.transitions.easing.*;import flash.events.TimerEvent; var imageLoader:Loader; var xmlData:XML;[CODE]............
I am trying to load multiple images by iterating through a for loop. For each image I instantiate a loader and send a loader request. I want to stop the iteration of the loop and cancel all loader requests sent, in case a user navigates out of the screen. How can I do this?
I made a movie clip with infinite loop in which there are images that move from right to left something simple like a marquee, and each image has a blank space between them, but between last and first image there is a more space, how I can do to make all images have an equal space between each one and that the motion never stops.
I am 1 step away from finishing my for loop. I have a item mc I have duplicated 8 items (indexarray.length) and what my loop currently does is display these 8 blank movieclips on the screen positioned 4 in each row. Inside this blank item mc I have a dynamic text field name_text within this item that call on names from a previously declared array. I also have a empty movieclip called image_holder with property name imageHolder. So far the below displays my 8 items with names but without the image:
function displayItems() { var xPos = 0; var yPos = 0;
[Code]...
All my images are in my library in movieclips name item0 to item 7 to fit in accordingly. What do I need to add to the above code to get these images inside my image_holder mc?