Dynamically Load Images From Server Folder?
Hi, I'm looking for a way to build a gallery so that I can simply upload a folder with images to the server and the .SWF will load all images within that folder, whether it be 3 images or 10 images. I know how to do this using PHP on just a basic HTML page but I want to have some animation in there. Is there a way to do this with only Actionscript? Or if PHP is the answer, how can I put this into a Flash file?
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 05-08-2007, 04:32 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
# Of Images In Folder To Load Dynamically
I'm loading images dynamically from a folder. Is there a way for the SWF to count the number of available images to load at run-time (so I don't have to specify before hand)?
Nick
Dynamically Load Images From Folder?
I'm trying to figure out how this flash file is pulling images from a folder.
http://www.andrewberg.com/photobrowser/afpb_flash.html
He included the PHP file, but didn't include the flash source file. I can't see how he's calling the PHP from the flash.
Does anyone have a clue to how he does it?
Thanks!
Load And Loop Folder Of Images Dynamically...
Hi,
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? Can anyone direct me to some help or offer some assistance?
Many thanks :-)
Load And Loop Folder Of Images Dynamically...
Hi,
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? Can anyone direct me to some help or offer some assistance?
Many thanks :-)
Creating Folder On Flash Media Server Dynamically
hello every one,
can any one tell me how can i create a folder with user name and record the vdieo file on the desired location. i want to create a folder on the server with the user name and want ot record file into that particular folder
thanks in advance.
Any Server Script To Count No. Of Images In A Folder ?
Hi ! all
I just want to count how many images in a folder.
Can anyone give me such .asp, php or any script, which can count no. of image in a folder, so that i can call that value to flash.
For now, i m doing this with the text file, but i manually have to enter a value for no. of images in that text file. Instead of that, I want that my script should count no. images in that folder.
Plz, help me in this................
Any Server Script To Count No. Of Images In A Folder ?
Hi ! all
I just want to count how many images in a folder.
Can anyone give me such .asp, php or any script, which can count no. of image in a folder, so that i can call that value to flash.
For now, i m doing this with the text file, but i manually have to enter a value for no. of images in that text file. Instead of that, I want that my script should count no. images in that folder.
Plz, help me in this................
Loading Images Dynamically From Folder
Hi guys,
I need to know how to load images into a Flash MX file dynamically. The images are in a folder and they are updated with new images periodically...
Can anyone please help me out ?
Thanks and Regards
Sudhindra
Flash Object That Dynamicly Loads Images From A Folder On My Web Server
Want to dynamicly load images from a folder on our web server. I am a senior programmer specializing in asp.net/c#/sql and I can prolly hold my own in Cold Fusion. What I need to do is get a list of files on the server side, pass the list into the flash object, then load the first image, fade it out and fade in the next image. Keep doing that until im out off images, and then start over. Im not good at Flash by all means, but im sure I can figure it out with some help. If anyone could help out that would be great! You can email me at brian@flutterbystudios.org or post on here..
I want to have a folder on my web server with images in it. IE. 1.jpg, 2.jpg. 3.jpg. I want the flash object to be able to get a list of the images and use those images. So if I add or remove an image, I dont have to rebuild the flash object. I know im somehow on the server side going to have to build the list of images since the flash object is a client site thing, but I dont have a problem writing server side code to hand a list of URL's with the images in it to the flash object. Im just not sure how to get the flash object to do what I want it to do.
Thanks in advance!
Brian D. Danford
FlutterBy Studios
Load All Images From The Images In 1 Folder (named By Random Number)
Hi Guys,
I've got a gallery style viewer, you click on an image and it enlarges. It pulls in images which are numbered 1 to 12 in a folder called 'images'. I want it to pull in randomly numbered images instead. so i suppose i want it to search the folder for images named 1.jpg up to 1000000.jpg and pull them in.
I've uploaded it to: www.dhardy.co.uk/gallery.zip as it'll become clearer then!
Thanks in advance! dave.
Please Help Can You Dynamically Load A .txt In A Different Folder?
Hello everyone,
I'm trying to keep my site tidy, and really would like to keep all my .txt files that I'm loading dynamically. However, I only know how to point to files in the same folder as the .swf. Is this even possible? I know that I can point to my folders in my harddrive, but I need to point to a folder on the website. Could someone please help me figure this out?
Thank you for your time in advance!
How Can I Load Pictures Dynamically From A Folder?
More clearly=> I know how to load a picture from a folder dynamically but what I want is.. how many pictures are in that folder that much pictures must show when I press a button without naming all of them...(so using one button and pressing next all the time to view next pictue on that folder)
on(release){
MyClip.loadMovie("pictures/pix1.jpg");
}
this code will just load that "pix1.jpg" from "pictures" folder..
but I don't wanna name them one by one.. Is it possible to make it to understand to load all picture one by one without naming those pictures one by one so I could simply upload many pictures to that folder without renaming the pictures...
or is there any better way to do this trick?
pls, gimme a hand on this
-GM
Can I Load Fonts Dynamically From A Folder?
i'm making an application in flash and my client simply wont agree to anything but this. the application should be able to load fonts dynamically from a folder. it could be on the server. i'm prepared to use php if its necessary.
so is this possible?
the tool is supposed to give the end user a wide range of choices for fonts for the text he enters.
How To Load Images From Client Side When The Swf Is Hosted On A Server Without Uplaoding It To Server?
I'm trying to build a online image resize tool.
problem i face are:
1. I build a button that allow user to browse the file. Once file is selected, it doesnt show full path.
2. lets say if it shows fullpath, but i try to load it into a movieclip, and it doesnt work because the swf file is located at the server and not the client's place.
3. as far as i know, flash can only load images which is located in the same server or internet.
4. if i use php, asp, cgi.. it can only allow me to 1st upload the image then resize later, but this is not wat i want.
5. I need to 1st resize then upload later, because if i have 100 and more photos taken from digicam, it's going to be very slow and heavy.
What i have tested:
1. upload "image3.jpg" into the same directory as the "viewer.swf", and it works.
2. do not upload the swf to the server, but run locally from the user's computer and open "image3.jpg" and it works.
3. upload the swf to the server and open "image3.jpg" from the user's computer and IT DOESN"T WORK!
please help me out.
Thanks~!
Attach Code
//---------- Import -------------
import flash.display.BitmapData
import flash.net.FileReference;
//---------- objects -------------
var dlgOpen:FileReference = new FileReference();
var dlgOpen_Listener:Object = new Object();
//---------- _root.value -------------
//Value transfer from <object> or <Embedded> tag.
var strOutputFileField:String = _root.OutputFileField;
var iMaxPPI:Number = eval(_root.MaxPPI);
var iMaxWidth:Number = eval(_root.MaxWidth);
var iMaxKB:Number = eval(_root.MaxKB);
var bDebug:Boolean = eval(_root.bDebug);
lblNo.text = "Picture " + _root.PictureNo;
//---------- Variables -------------
//var bCropProcess_Flag:Boolean = false;
//var bIsValidFormat_Flag:Boolean = false;
//---------- Listener -------------
//dlgOpen_Listener
dlgOpen_Listener.onSelect = function(selectedFile:FileReference):Void
{
//Flag the crop process has been started
bCropProcess_Flag = true;
//update filename, cannot get full filename because flash don't allow
txtFilename.text = selectedFile.name;
//Create into a movie clip or a bitmapdata
_root.tmpBitmap.loadMovie(selectedFile.name);
CreateBitmap();
};
//---------- Functions-------------
//OpenImage
function OpenFileDialog(event:Object):Void
{
dlgOpen.browse([{description: "Image Files", extension: "*.jpg;*.gif;*.png;*.bmp;*.tif"}]);
//_root.tmpBitmap.loadMovie(txtFilename.text);
}
//Load Image into Bitmap Object
function CreateBitmap()
{
}
function sendData(pixels:Array, h:Number, w:Number){
//Create the LoadVars object and pass data to PHP script
var output:LoadVars = new LoadVars()
output.img = pixels.toString()
output.height = h
output.width = w
//The page (and this movie itself) should be in a server to work
output.send("jpeg.php", "output", "POST")
}
//---------- Others -------------
//Add Events and Listener
dlgOpen.addListener(dlgOpen_Listener);
btnBrowse.addEventListener("click", OpenFileDialog);
//Clean up and stop
stop();
Edited: 11/23/2007 at 07:34:09 PM by zerodevice
Load Images From Folder
I havent used flash in a couple years and i'm feeling a little lost (not that i knew what i was doing before!) I am however determined and can understand the code, i just am a little overwhelmed.
I'd like to tell a movie clip to look into a specific folder (via url or whatever) and load all images from that folder into the movie clip. I do not want to have to give the movie the exact address of each image, as they files may change / be added to over time.
i know in AS3 i have to use the loader class and then the addChild to put the loaded stuff into the movie (and thats all i know), but i just dont know how to get all available images blindly. any help? please and thank you
Load Images From A Folder
Hi....
I would like to have a flash movie that loads image files from a folder. The idea is that the flash movie will stay the same but i can use a script to load images into the folder and then the flash will auto pick them up.
Could anyone help me out?
Thanks
Dynamically Load Array Based On Folder Contents
Tough one...
I'd like to have the contents of an mp3 folder entered into an array (containing strings of each file name in the folder).
I'd like this to be totally dynamic so I can modify a playlist simply by dropping more mp3s into this folder.
File names must come in as strings in an array (i.e. "js bach - air on the g string.mp3")
How about it? Any thoughts or ideas?
Thanks
-dave-
Load And Crossfade Images From Folder
Hi there,
The task
---------
To get a slideshow of images to load from a folder, and to crossfade them as they appear. Attempting to do this with AS only in case images ever change, plus it would be a good tool to re-use. Images should remain about 2s on screen (can be a variable).
How far I got!
I've got as far as fading-in, then fading-out a single image. Independently I can loop through all the images in the folder successfully one at a time. What I canna do is get the two scripts to work together, and night has fallen already !
The following code on the main timeline is what I'm working with, with one static movieclip:
The fade script:
----------------
code: _root.fadeInc = 5;
_root.fade = 0;
loadMovie("eye/0046.jpg","imageHolder_mc");
function imageFader() {
var nTimeNow = getTimer();
if (nTimeNow <= 1000) {
trace (_root.fade);
if (_root.fade <= 99) {
_root.fade += _root.fadeInc;
imageHolder_mc._alpha = _root.fade;
trace("fading in now: alpha(" + _root.fade + ") at time: " + nTimeNow);
}
} else if (nTimeNow >= 2000) {
trace (_root.fade);
if (_root.fade > 0) {
_root.fade -= _root.fadeInc;
imageHolder_mc._alpha = _root.fade;
trace("fading out now: alpha(" + _root.fade + ") at time: " + nTimeNow);
} else if (_root.fade <= 0) {
trace ("reached 0 alpha, remove clip and stop timer");
clearInterval(nFaderInterval);
unloadMovie("imageHolder_mc");
nTimerNow = 0;
}
}
}
// this is the thing that sets it all off
var nFaderInterval:Number = setInterval(imageFader, 10);
-------------------
And the following does the loop through all files:
-------------------
_root frame 1 (preload frame)
------
// for images numbered 1 to 168 in a folder
var aImageNames:Array = new Array();
for (var i:Number = 1; i < 168; i++) {
aImageNames[i] = i;
}
var imageNumber = 1;
var maxNumber = aImageNames.length;
---------
_root frame 2 (after preloader) contents
---------
function nextImage() {
if (imageNumber < maxNumber) {
trace("loading the following movie: " + aImageNames[imageNumber]);
unloadMovie("imageHolder_mc");
loadMovie("eye/" + aImageNames[imageNumber] + ".jpg", "imageHolder_mc");
imageNumber++;
} else {
trace ("reached the max number of images, clear the timer");
clearInterval(nMovieInterval);
}
}
var nMovieInterval:Number = setInterval(nextImage, 1000);
---------------
So I got all tied up in my setIntervals and where I could put them - I only need the fader check to occur AFTER each image has loaded, not every 10 ms.
That will do for a start, then the task is to get the images loaded into two movieclips so they crossfade. I can handle that bit as long as the fading script is working.
Please can anybody help me with this probably simple problem! I've had a search with no results yet but am still looking, I'm stuck in a rut!
If you need the FLA or SWF samples just shout.
Many thanks,
Alun
Load Images In To Flash Through An External Folder
Hi i'm really stuck in this pls help me out......
is there a possibility where i can load external images which are there in a folder in to flash and run as a loop with a time break.
pls let me know the cording or what ever the possible way to get this thing done.
Thanks
pls mail me if possible --- dimuth@jkcs.slt.lk
Dimuth
Trying To Load Multiple Images In A Folder To Stage
I'm trying to load multiple images to the stage at random XY positions and, through functions, affect those images that are loaded. I'm trying to figure how to write within the URLRequest code how to call upon a folder and not just an image. Here is a part of my code that deals with this:
var imageRequest:URLRequest = new URLRequest("movieclip.jpg")
var imageLoader:Loader = new Loader();
imageLoader.load(imageRequest);
addChild(imageLoader);
imageLoader.x = Math.random() * stage.stageWidth;
imageLoader.y = Math.random() * stage.stageHeight;
Any help would be greatly appreciated. thank you
Photo Gallery: Load Images From Folder?
I am trying to make a user's Flash photo gallery easier to update.
I want to use either XML or PHP to scan all the files in a specific folder to include in the photo gallery for the gallery to cycle through.
Of course, I can't edit ANY files like the xml or php because the user will be uploaded new photos at their convenience.
Any ideas or can anyone point me in a good direction?
Thanks!
Calling Images From Server Dynamically
I assume this is easier than I am making it.
I have developed a site for a photographer. Currently, the site calls about 40 "swf" files to display images with some fancy flash stuff, including a preloader and some fade-in effects.
What I want to do is have the photographer control the images by replacing (overwriting) them on the server.
So how exactly is the best way to do that?
Am am new to this.
The actual site is HERE
See If Server Is Online?AND Load Image Dynamically
Can this be done? Here is this website, and I wanna know if in flash I could make the MC check if the server with the name SOE Server is up online...can this be done with flash? Here is the site:
http://208.231.90.229/DFUSLOBBY5_CUS.HTM
How can I load a jpg. bmp. gif. or pcx. image dynamicaly into an MC?
Load Function For Duplicating Jpg Images Fails On Server
Howdy,
I have a function in a presentation application that duplicates jpg data that is being loaded into movie clips on the stage as bitmaps, and attaches the resulting bitmap to movie clips held in a 'magnifying glass'.
Both the main stage and the magGlass are preloaded with movie clips equal to the number of slides that will be shown, and then as each slide (JPG) is loaded into the stage clip stack in the appropriate place, a duplicate bmp is created and attached to the mag glass stack in the same place. The basic code that does the job is attached below.
The function works great locally, that is to say when I test it on my own machine the mag glass is loaded and content shows immediately when I activate the magnifier. However, the same app loaded to my server fails. The mag glass shows only a plain, white content. No magnified image at all.
This seems a bit odd, I would figure that I would get either the slide content loaded up or nothing at all. How do I end up with a white background?
I don't think this is a security issue, I have all the appropriate permissions set to load the jpgs, and they show up fine on the stage.
Any suggestions?
Attach Code
for (var i=0;i<depth;i++) {
var loader = new MovieClipLoader();
if (loadMagnifier) { // If we are supposed to load the magnifying glass (we may not always want to)
var listenerObj = new Object();
listenerObj.lvlIndex = i;
listenerObj.magSlide = magGlassSlides.getInstanceAtDepth(i); //magGlassSlides is the stack in the mag glass
listenerObj.onLoadInit = function(target) {
bmp = new BitmapData(target._width,target._height,true);
bmp.draw(target);
this.magSlide.attachBitmap(bmp,0);
}
loader.addListener(listenerObj);
}
var loadSlide = this.getInstanceAtDepth(i); //this whole thing is a movieClip prototype method, works on stage slide
// stack
var loadURL = slidesArray[i].attributes['url']; //get the url for the slide to be loaded from the data xml
loader.loadClip(loadURL,loadSlide); // go ahead and load the clip into the slide using the given url
}
How Can Load The Images Dynamically
How can i use the dynamic image in my movie. In the whats new setion of flash mx these guys are telling that now we can load the image dynamically but they havent provide any tutorial for this.
PLease tell me how to do this.
cheers
Ritesh
Dynamically Load Images
this may OR may not sound difficult but
if anyone has a link to a tutorial on
loading images dynamically to a flash
movie I would appreciate the direction.
The general problem is this;
To have a menu for images and as is obvious
after a link is pressed on the menu, the image loads,
BUT,
If the owner of the site wants to add new images
daily, then, all he would have to do is upload
the images to the server and the Menu would be updated
and the pic along with the menu item would be accessable.
About the menu, I am going to take care of that myself,
About the images, I will direct the owner of the site
to specifically name each new pic that he uploads,
so that Flash can go through the file each time it loads
and determine if there is another image in the file,
basically it would just loop once and count the number of images. so again, that is not my problem,
the problem is simply loading the data remotely...
Thanks in Advanced everyone
Load Images Dynamically
pls can someone tell me how i can upload images dynamically & also to have a motion for each image i upload.
is there a tutorial which i can go through as well
thanks
Dimuth
How To Load Images Dynamically?
Hi guys,
I'm making a small flash file that will randomly display a series of 10 logos, 1 at a time. I'm wondering how I set up a fla file where Average Joe Schmo can just upload a new logo to a directory, and it will be automatically inserted into the FLA file? Hope this makes sense, I know it's a pretty broad question but if anyone can point me in the right direction that would be great. thanks
Dynamically Load Images
I'm working on a site and I have to do my navigation header in flash for all of the content pages but I have a background image that I have to change on each page. So, instead of having a different swf for each page I'm trying to change the image by using an empty movieclip in one swf and somehow linking it with variable names. My problem is that I'm not savy with actionscripting in flash and I'm not sure the exact coding that I need to use. I named my mc variable with imageLoader and in my html coding I have it pulling the correct jpg and placing it in the imageLoader space but I have to tell the swf to place the jpg in that space...does this make sense to anyone?
Thanks so much!
Dynamically Load And Resize .swf Images.
Hi,
I'm needing to dynamically load in .swf images from folder on my server.
Once loaded, they need to be resized automatically so they look the same size as the mc I loaded them into.
Any ideas on how to accomplish this?
Thanks,
Dynamically Load Images In Flash 5?
I love the new feature of dynamically loading images with MX and was wondering if anyone has found a way to do it in 5. I am thanking anyone in advance for a reply.
Stream And Dynamically Load Images
I have a 1 MB swf movie. The reason it's so large is because of many jpgs. So I reduced the size of the movie by removing the jpgs and using loadMovie to insert them as the user moves through each frame. The problem is that there's a delay, sometimes a long delay, whenever an image is loaded, especially on a 56k modem.
Is there anyway to stream the images into the cache while the user is in prior frames. In other words, if the user is on Frame 1 looking at an image, how do I get the images on Frame 2 and Frame 3 to load before the user gets to those frames?
Component Can Load Images Dynamically?
i have a component i purchased for flash that has images in it, since it is a component, can i still preload the images dynamically??... does loading them dynamically like music, make the file a lot smaller ? someone wants a slideshow with 40 images is that possible to do under 600k or so ?
thx
Dynamically Load Images With Transparency
I don't think this is possible, but i need to pull images from a folder on a website into flash that have a transparency. So i know you can dynamically build a list of jpg's and have the user select them, and then load them in. But i need an image type (like a gif) to load in with a transparency on it. Is this possible?
Thanks.
Dynamically Load Images For Menu
I'm creating an image slider menu. My client would like to swap out images in the future for his portfolio. When images are clicked a larger view will show up.
Can you load an image using geturl and then alter it position/ size/ etc...?
That way wehn he wants to replace an image he can just copy the new image to the server with the same name as the one he's replacing.
Load Faded Images Dynamically
Hi Everybody
I am creating a set of thumbnails which are all individual movieclips because of the animation which takes place, but I am having a problem trying to load in jpegs dynamically into a container using fade in and out.
I have tried a few downloaded bits of code but have had no luck.
I could do with some help, please
Dynamically Load Random Images
I have three rectangles I converted to movie clips named pichold1, pichold2, pichold3 and placed horizontally side by side on the stage. I want to use actionscript to dynamically load these images from an images folder. Each image is named "image#" (ex. image1, image2, image3, ...) I want the movie to be placed on a webpage that when a user visits the page, the movie will load random images and cycle through them displaying them in the movie clips. I also want to use some sort of transition effect to fade the images in and out, any help with this?
Load Dynamically Images For Thumbnail
Hi, I am trying to create a thumbnail and load images located in a 2D array filled with a XML.
pArray[x][5]= preview image
Here is a sample of the XML
Code:
<project id="0">
<name><![CDATA[Test1]]></name>
<date><![CDATA[01/01/01]]></date>
<technologie><![CDATA[AS2, AS3, Kek Chose]]></technologie>
<img><![CDATA[behappyfarmer_img.jpg]]></img>
<preview><![CDATA[/behappyfarmer_preview.jpg]]></preview>
<description><![CDATA[Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque sed lectus imperdiet felis tempus aliquet. Suspendisse sem nulla, faucibus eu, eleifend at, scelerisque vitae, elit. Donec luctus dui vel urna. Integer at diam. Donec et risus. Praesent vestibulum pede ut urna. In facilisis tempus magna. Cras quis dolor sed dui pharetra blandit. Pellentesque vel arcu a nisi consectetuer iaculis. Ut.]]></description>
</project>
here is my XMLLoader Class
Code:
import mx.utils.Delegate;
class com.cc.XMLLoader
{
private var _xml:XML;
private var xml_result:Array;
public var xml_loaded:Boolean = false;
public function XMLLoader(path:String){
this._xml = new XML();
this._xml.ignoreWhite = true;
this._xml.load(path);
this._xml.onLoad = Delegate.create(this, dataLoaded);
}
private function dataLoaded(sucess:Boolean):Void {
if (sucess) {
createArray();
}
}
private function createArray():Void {
var xmlroot:XMLNode = this._xml.firstChild;
var i:Number;
var j:Number;
this.xml_result = new Array();
for (i = 0; i < xmlroot.childNodes.length; i++) {
xml_result[i] = new Array();
this.xml_result[i][0] = xmlroot.childNodes[i].attributes["id"];
for (j = 0; j < xmlroot.childNodes[i].childNodes.length; j++ ) {
this.xml_result[i][j + 1] = xmlroot.childNodes[i].childNodes[j].firstChild.nodeValue;
}
}
this.xml_loaded = true;
}
public function getXML():Array {
return this.xml_result;
}
public function getToken():Boolean {
return xml_loaded;
}
}
Here is my class
Code:
import com.cc.XMLLoader;
import mx.utils.Delegate;
class com.cc.projects.Projects extends MovieClip
{
private var objXmlLoader:XMLLoader;
private var pArray:Array = new Array();
public var container : MovieClip;
public function Projects() {
objXmlLoader = new XMLLoader("../lib/xml/Projects.xml");
this.onEnterFrame = Delegate.create(this, getToken);
}
public function getToken() {
if (objXmlLoader.getToken() == true) {
delete this.onEnterFrame;
getArray();
}
}
public function getArray() {
/*
This is the part which is supposed to show every preview images of my xml. from 0.0 to 80.0 and so on.
*/
pArray = objXmlLoader.getXML();
var k:Number = 0;
var i:Number;
for (i = 0; i < pArray.length - 1; i++) {
container.createEmptyMovieClip("mc" + i, 100);
container["mc" + i].loadClip("../lib/img/projects/" + pArray[0][5],this);
container["mc" + i]._x = k * 80;
k++;
}
}
}
Can you please tell me why it doesnt works?
The problem is obviously from the getArray function. I know that if I call them by their name manually it works but I am trying to assign them a dynamic name and call them with it which doesnt work.. please tell me how I can do that.
Thank you.
Dynamically Load Images Into Flash
Hi everyone, I'm new.
I'm not too experienced with flash, but I was recently making a website in flash (trying to get better at this) and I wanna be able to change images in the folder of the site directory as opposed to having to open the .fla file, change the images in flash, then recompile and re-upload the site (like I said I'm not too experienced, and this seems like the only way I know ).
Right now I have a movieclip symbol called 'dynamicIMAGE', its one frame with one line of actionscript applied:
loadMovie("image.jpg", 1);
then I drag this movieclip to the stage of the website, but whenever I preview the site, the image DOES appear (so it works there), but the problem is that it appears in the upper left, no matter where I drag the movieclip onto stage. I've also tried messing with the _x position and _y but I got nothing from that. I have the image named "image.jpg" so that when I wanna replace the picture displayed on the page I can just drag another image file called "image.jpg" to overwrite the previous one.
Any help would be greatly appreciated, I've been racking my brain over this for the past day, meanwhile its probably just something stupid and simple that I need to do . Thanks in advance.
Dynamically Centering Images In MC As They Load
I am dynamically loading images into a movie clip (MC), but as they load the images load from the MCs registration point which is fine if you want the image to load in the top left side of the MC.
What I would like to be able to dynamically change the registration point of the image to the centre when it is loaded. I would expect you would have to change the registration point of the MC (as the image takes on the properties of the MC).
Basically I would like the images to load from the left, right, top middle, botton middle etc... so that per project I can dynamically change the above.
Here is an example of what I am trying to achieve. I have everything else down pat except the images positioning....
http://www.evb.com
In the above case the images are loaded and their centre point becomes the centre of the image and the frame then expands or contracts depending on the image width and height.
Even if I could be able to make the centre point in the middle would do me...
Can anyone help??????
Using LoadMovie To Dynamically Load Images?
Hi There,
I've managed to use AS to dynamically create empty movie clips and offset them so that they appear side by side. The problem is, I can't use loadMovie to load in images into my empty movie clips. I can successfully use loadMovie outside of my for loop, by directly referencing each of the dynamically created clips (holder_mc1.loadMovie(...), holder_mc2.loadMovie(...),etc) after they have been created. This is ok but I really need to create and fill the empty movie clips within a single for loop. By the way, the references to the images being loaded are contained within an external text file, but this doesn't seem to be part of the problem. Does anybody know if there is a problem using loadMovie in this way or if there is anything I can do to fix the problem?
Thanks
ActionScript Code:
if (succes) { var imageNum = this.imageNum; trace("imgeNum="+imageNum); offset = 200; for (i=1; i<=imageNum;i++){ duplicateMovieClip("holder_mc", "holder_mc"+i, i); setProperty("holder_mc"+i, _x, offset); "holder_mc"+i.loadMovie(this.Image); // won't load offset = offset+200; } } else { trace("Error loading data"); }
How Do I Dynamically Load Images With DuplicateMovieClip()?
I want to duplicate this Movie Clip so that "bird.jpg" is loaded into all 6 Movie Clips. Why doesn't this code work?
for (i=0; i<6; i++) {
miniHolder.duplicateMovieClip("miniHolder"+i, i, {_x:i*10, _y:i*20, _alpha:50});
var bb = "miniHolder" + i;
bb.loadMovie("bird.jpg", this.getNextHighestDepth());
};
Dynamically Centering Images In MC As They Load
I am dynamically loading images into a movie clip (MC), but as they load the images load from the MCs registration point which is fine if you want the image to load in the top left side of the MC.
What I would like to be able to dynamically change the registration point of the image to the centre when it is loaded. I would expect you would have to change the registration point of the MC (as the image takes on the properties of the MC).
Basically I would like the images to load from the left, right, top middle, botton middle etc... so that per project I can dynamically change the above.
Here is an example of what I am trying to achieve. I have everything else down pat except the images positioning....
http://www.evb.com
In the above case the images are loaded and their centre point becomes the centre of the image and the frame then expands or contracts depending on the image width and height.
Even if I could be able to make the centre point in the middle would do me...
Can anyone help??????
|