ActionScript 3.0 :: Loading External Images But Need A Way To Loop That Allow The Load?
Mar 2, 2012
I 'm checking to see if an image file exist but I don't think the code checks but the last iteration in the loop. Here's my code:
[Code]....
fix this or if you know a better way to check if an image file exist could you let me know.
View 1 Replies
Similar Posts:
Nov 3, 2010
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.
[Code]....
View 1 Replies
Mar 29, 2011
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();
[code].....
View 1 Replies
Apr 22, 2009
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 =
[code].....
View 1 Replies
Sep 18, 2009
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.
View 5 Replies
Apr 1, 2010
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?
View 1 Replies
Nov 10, 2009
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]...
View 9 Replies
Mar 13, 2011
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++) {
}
View 1 Replies
May 17, 2011
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]...
View 9 Replies
May 5, 2010
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?
View 5 Replies
May 29, 2010
I have a file with existing MovieClips on the stage that I want to add Loaders to that will call external .jpgs from an XML file. I have the code working, but currently I have to add the Loaders one by one to the MovieClips. I'm sure there's a way to do this more easily by using a Loop, but I can't seem to get it to work no matter what I've tried.
I also want to be able to call a larger version of the image by clicking on the MovieClip/thumbnail. I've got the code working just fine, but when I tried to add a preloader to the full size image Loader, I got an error: Error #1009: Cannot access a property or method of a null object reference. Flash indicates this is happening at the callFull function so its definitely an error with my preloader code. [code]...
View 4 Replies
Mar 1, 2010
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?
View 2 Replies
Feb 9, 2009
I've got a weird problem that could probably be easily fixed if I weren't such a novice coder. I'm loading external jpegs into movie clips that are within a movie clip which is within another movie clip (because they are animated as a whole within the other movie clips). The XML loads fine. The "Image" class I've made up is defined. The attributes from the XML load into the array of images.
However, I can't loop through the movieclips to actually load the images. But if I define manually the movie clip loads it loads perfectly. Here is the code that loads the images successfully, but not 100% dynamically:
ActionScript Code:
// Define the Images Array
var ImageArray:Array = new Array();
[Code]....
View 9 Replies
Sep 18, 2006
I'm trying to create a slideshow which loads images dynamically from a folder on my server. The number of images in the folder will change on a daily basis, so I'm guessing that this needs some kind of array to predetermine the contents of the folder. The files will not have a regimented naming structure.
Basically, I need to display all of the images in the folder one by one and then loop back to the start.
Has anyone managed to do this before?
View 1 Replies
Mar 26, 2009
I'm loading in a bunch of images with a for loop. The images do appear on stage so that part works, however, spacing them is the problem. this is what the following code traces out:
[Code]...
View 5 Replies
Sep 23, 2011
I would like to create thumbnails in a player. For that, I have to load external swf files in a scrollPane component.
so in a for loop, I attach a thumbnail container in the scrollPane content, and with that container I load the swf.
the idea of the code is that :
mcThumbnailsScrollpane:MovieClip = menu.thumbnailsScrollpane.content;
var X_pos = 30;
var Y_pos = 25;
[Code].....
and so basically 8 or 9 thumbails are visible (on 34). furthermore when I skip the loadMovie and let only the container, I can see all containers. so I feel like the ScrollPane is not refreshing fast enought, or the movies take too long to load ...
View 6 Replies
Jul 28, 2009
I have a bit of a problem finding the correct syntax. I have a whole lot text variables here. The myLV value is in a external text file. So myLV.nr1 from my external textfield is loaded in ovrnr1.text. This way I can easily change the value in my text document.
ovnr1.text = myLV.nr1;
ovnr2.text = myLV.nr2;
ovnr3.text = myLV.nr3;
ovnr4.text = myLV.nr4;
If I put it like this it works fine but I thought, hey, in stead of writing
150 of these I can put it in a for loop. So I tried this.
for (i=1; i<150; i++) {
ovnr[i].text = myLV.nr[i];
}
However, this does not seem to work ? And could I do it to a button too ? So instead of writing 150 button onrollovers I could also make a loop for it ?
Something like
for (i=1; i<150; i++) {
this.btn[i].onRollOver = function() {
[Code]....
View 2 Replies
Jun 25, 2011
I've spent days working on this code, it seems so simple, but yet it never works. All I'm trying to do is make a loop automatically load person0.swf through person4.swf in the same directory. I've got it set-up so that I can change a single number and it loads up to person[whatever-the-new-number-is].swfCurrently it loads the first movie and thats it. I also get this error: "TypeError: Error #1009: Cannot access a property or method of a null object reference.at Menu()"Here is the code
package {
import flash.display.*;
import flash.net.URLRequest;
[code].....
View 3 Replies
Apr 13, 2010
I am making a flash site of all of my lingerie that I sell. There are over 200 pictures that amount to over 20 Mb. I would like to know if placing these images externally would be better than trying to put them in the flash movie file?
View 1 Replies
Nov 15, 2008
I'm loading a external image and want a preloader for this progress.I found this code for a preloader, but how do I connect it so it preloads the image?
View 3 Replies
Apr 15, 2009
I'm new to AS3 but trying to learn. Please be kind and forgiving. I just want to load an external image. I have been cruising the Web for days. Why doesn't this work:
var imageLoader:Loader = new Loader(); imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoadComplete); var request:URLRequest = new
[code]......
View 2 Replies
Sep 1, 2010
I am trying to change the images the following calls up. (Using CS4 and AS 2.0)
onClipEvent (load)
{
imageProperties = _root.getCurrentImageName(0);
loadMovie(_root.url + imageProperties.name, this.cont.pic);
[code]....
I get that I could find the image in the directory and just change it out with the same name/pixel size, but I'd also like to add more images to this particular project with the same conditions.
View 1 Replies
May 27, 2008
I am trying to load external images and .swf's for the first time and was wondering if anyone had any tips, or tutorials they could send my way. I am working with large imagery inside a flash banner animation and I know there has to be a quicker way to get them to load.
View 7 Replies
Apr 1, 2010
I have just started messing around in flash and made a pretty cool site (...design wise, the action script part is my major problem right now) which is suppose to go online sometime soon. I used the following script to load an external SWF into my main SWF: (I placed this script in the main timeline of my 'main' movie on frame 100 or something)
[as]
if(this.contentHolder == Number(this.contentHolder)){
loadMovieNum("content1.swf",this.contentHolder);
} else {
this.contentHolder.loadMovie("content1.swf");
[/as]
The external swf is al working fine, the preloader, buttons and thumbnails behaviour. All except for one thing: the photos wont load when i click on the thumbnails. The external SWF is a photogallery with thumbnails. The script for the small thumbnails is as following: (I placed this on the first frame inside a movie clip of a movie clip which is staged in the main timeline).
[as]
var frameNum:Number;
function photoChange(){
_root.photos.gotoAndStop("img"+frameNum);
_root.photos.fader.gotoAndPlay(2);
} btn1.onRelease = function(){
[Code] .....
View 1 Replies
Mar 13, 2012
My file name is slider_1_1.swf. But once complete file then user next button click load in slider_1_2.swf this use in loop function.
View 1 Replies
Dec 17, 2009
I am trying to find an actionscript that can load an external image.
and this is what I have got[code]...
View 9 Replies
Jun 1, 2010
[code]...
it runs on local but when i upload it it doesnt loads images in browser
View 2 Replies
Sep 29, 2010
I want to make a photo uploader and after uploading the photo to the server you can load all the photo's that are in a folder in kind of a library.
I can load one single image because I name it in AS but I want to load the whole "images" folder so I can see all the pictures that are in it.[code]...
View 7 Replies
Sep 25, 2009
First of I'm using Flash CS4 and AS 3.0 I'm trying to make a photo gallery for my website. I have the gallery all setup and made and now I need a preloader for loading my images. Right now my gallery is setup like this:
-A list of clickable thumbnails. (20 thumbnails)
-A UILoader
-You click a thumbnail and it loads an external image into the UILoader.
Actionscript: I have an array with 20 images. I have 20 different event listeners for each thumbnail.
The eventlistener looks like this:
thumbs.thumbs1.t1_btn.addEventListener(MouseEvent. CLICK, loadP1);
The function looks like this:
[Code]....
The UILoader is inside 2 moveclips because of a transition effect I have. The buttons are also 2 movieclips deep because of motion tweens.specific reason.
View 2 Replies
Aug 25, 2008
I want to rapidly load an image over and over again. Basically it's from a security camera that has a web server running. on it, and it stores the current image in a file called now.jpg. I can do this from AS2 fairly easily as I can just keep calling a loadMovie() on the image, replacing the old one. At one point, I had what looked like 15fps going with that. BUT, with AS3, I can't seem to get this going very fast at all. It takes at least a second to load each image. I am using the code attached to do this. It uses an interval to load, but could be done through other methods. I can run the video out of the security cam into a converter and bring it in USB with the Video() and Camera() classes, but that only gives me 640x480. The camera is actually able to generate 1280x1024 images, which is what I am loading with my AS2 code. So,any ideas as to rapidly load these images? The web server on the camera can display a live image by using javascript to keep loading the image. There must be a way to do it in AS3 if it can be done in AS2 and javascript.
View 4 Replies