Loading Images From File
I need to create an interface that displays image files in a gallery by pulling them dynamically from a folder. I know that this is easily achieved by saving the images in a folder and then dynamically loading them in with actionscript.
However i need to cater for the possibility that the number of images saved in the folder will increase so I cannot hard code the image names into the actionscript.
Is there a way to set up a system that allows new images to be saved in a folder and flash will dynamically pull them into the movie?
Thanks
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-24-2006, 11:49 AM
View Complete Forum Thread with Replies
Sponsored Links:
Loading Images From Txt File
I've got this code that I use to load images that I define in a mylinks.txt file (see below). I want to load this variable called 'number' from the txt file and use it to define how many images there are. Check the "number" bit below. That doesn't work.
So here's my question. How can I define the 'number' in the txt file and second how is the code supposed to be correct?
number=6;
newLoad = new LoadVars();
newLoad.onLoad = function(success){
if(success){
for(i=1;i<="number";i++){
loadMovie(newLoad["link"+i],_root["win"+i]);
}
}
}
newLoad.load("myLinks.txt");
-------------------
This is the data in the txt file:
&link1=pic1.jpg
&link2=pic2.jpg
&link3=pic3.jpg
&link4=pic4.jpg
&link5=pic5.jpg
&link6=pic6.jpg
View Replies !
View Related
Loading Images Through Outside File
Hey, I was wondering if it's possible to load images into a flash file with an outside file, like Javascript or a text file?
So in the Javascript file I would have something like:
link[1] = "images/image1.jpg";
link[2] = "images/image2.jpg";
Then in the swf I would call the javascript file and load the images from the locations defined by "link".
This way I don't have to recreate the swf everytime I change an image or add a new one.
View Replies !
View Related
Loading Images From Txt File
Hi everybody! My apologies if this question has been overasked or if I missed the info I needed when I searched this site, but I'm looking for an example code for loading a slide show movie using image URLs contained within and external .txt file. The idea is to allow the user to write/alter the .txt file and have the .fla load and present the files from that list, without anyone having to touch the .fla file. Thanks in advance and have a great weekend!
View Replies !
View Related
Loading Images From A File
Hi,
I'm making a program in Flash with 5 frames, each with an image on (img1, img2... etc) and buttons to move between frames. The images are loaded from external PNG's using the loadMovie command at the start of each frame.
The problem is, there's a small delay while the image is loaded at the start of each frame. Is there a way to load all the images on startup? I tried putting the loadMovie command for all images in Frame 1, but it only worked for img1 (in Frame 1 itself).
Thanks in advance.
View Replies !
View Related
Loading 3 Images From Xml File
hi, I am a newbie and having problems loading 3 images from an xml file into a frame animation. I can get one loaded fine but I think my syntax is bad on the multiple (3 images total, image11, image12, image13) loading. Any help would be wonderful. I keep getting a "parameter URL must be non-null" error.
-leanbean
Code:
function LoadhomeXML(e:Event):void {
xmlhomeData = new XML(e.target.data);
ParseHomepage(xmlhomeData);
}
function ParseHomepage(KindleItems:XML):void {
titlemc.title_mc.text = KindleItems.page1.@quote;
subtitlemc.subtitle_mc.text = KindleItems.page1.@sub;
copymc.copy_mc.text = KindleItems.page1.text()[0];
for (var i:int=0; i < 4; i++) {
imageLoader = new Loader();
imageLoader.load(new URLRequest(KindleItems.page1.@image1[i]));
cimagemc.imageloop["image" + i + "mc"].addChild(imageLoader);
}
}
this code works fine with one loading:
Code:
function LoadhomeXML(e:Event):void {
xmlhomeData = new XML(e.target.data);
ParseHomepage(xmlhomeData);
}
function ParseHomepage(KindleItems:XML):void {
titlemc.title_mc.text = KindleItems.page1.@quote;
subtitlemc.subtitle_mc.text = KindleItems.page1.@sub;
copymc.copy_mc.text = KindleItems.page1.text()[0];
for (var i:int=0; i < 4; i++) {
imageLoader = new Loader();
imageLoader.load(new URLRequest(KindleItems.page1.@image11));
cimagemc.imageloop.image1mc.addChild(imageLoader);
}
}
View Replies !
View Related
Loading Images From Php File
So I've been reading for a few hours and it seems like theres not really a good way to do this.. Can anyone offer any suggestions?
Originally I just wanted to load in some html into a dynamic textbox to display some images, but when I do the images just overlap. I've tried setting the height,width, etc but nothing works.
Is there a better way to do this? I'm calling a db and getting a list of pictures to display, and then passing that into flash, so I just figured passing it with img tags into a dynamic html box would be simple, apparently not.
Thanks in advance!
Jason
View Replies !
View Related
Loading Images From Exteral File?
Is it possible to have an image load from an external file?
Lets say I make a flash movie with an image 150x100. Is it possible for me to change that image through a .txt or .html file - without having to edit it in flash?
I know I can load text from an external file, but I need to be able to change the images as well.
View Replies !
View Related
Loading Images/variables From .txt File
I have a themed template that is used several different times. Same file but each one needs to load a different image based on the .txt file.
1. numbers.txt includes 0000.jpg
2. numbers.txt includes 0001.jpg
3. numbers.txt includes 0002.jpg
So everytime the template runs the images that load into the MC are based on the numbered .jpg
Does this make sense?
I'm reading about passing variables from a .txt file but my brain is too small.
View Replies !
View Related
Loading Images Form XML File
Hi all,
I'm trying to load a gif image whose path is being imported from an XML file. The image path is retrieved (along with other relevant data) by an onRelease() event when a button is clicked. what I'm hoping to do is place the image in an HTML rendering dynamic text field that is inside a MC, but I can't seem to get this to work. I'm not sure why it's not working.
here's the AS:
ActionScript Code:
myDoc = new XML();
myDoc.onLoad = function(){
var intro = XPath.selectNodes(this,"/countries/country[@name='"+country+"']/intro/text()");
var overview = XPath.selectNodes(this,"/countries/country[@name='"+country+"']/overview/text()");
var country_name = XPath.selectNodes(this,"/countries/country[@name='"+country+"']/name/text()");
var region = XPath.selectNodes(this,"/countries/country[@name='"+country+"']/region/text()");
var capital = XPath.selectNodes(this,"/countries/country[@name='"+country+"']/capital-city/text()");
var surface = XPath.selectNodes(this,"/countries/country[@name='"+country+"']/surface-area/text()");
var population = XPath.selectNodes(this,"/countries/country[@name='"+country+"']/population/text()");
var languages = XPath.selectNodes(this,"/countries/country[@name='"+country+"']/languages/text()");
var currency = XPath.selectNodes(this,"/countries/country[@name='"+country+"']/currency/text()");
var flag = XPath.selectNodes(this,"/countries/country[@name='"+country+"']/flag/text()");
flag_path = "images/flags/"+flag;
countryName.text = country_name;
countryRegion.text = region;
facts.countryNameSm.text = country_name;
facts.capitalCity.text = "CAPITAL CITY: "+capital;
facts.surfaceArea.text = "SURFACE AREA: "+surface;
facts.popul.text = "POPULATION: "+population;
facts.lang.text = "LANGUAGES: "+languages;
facts.curr.text = "CURRENCY: "+currency;
myScrollbar.setScrollTarget(mainContent);
facts.flag.htmlText = "<img src=""+flag_path+"">";
}
the var 'flag_path' is grabbing the image name form the XML file, and then that is being placed in the text firled 'flag' in the MC 'facts' (seen at the bottom of the script). Nothing seems to show up here, though (when I place some extra text in the fiedl, though, it does show up).
Any help would be mnost appreciated. Thanks!
View Replies !
View Related
Loading Images From Text File
I am a flash newbie and assisting one flash based website where the site content is coming from the text file. (readTxt = new LoadVars();
readTxt.load("content.txt"). If possible to mix html elements with the text especially <a href> and image tags. or can i load external images from tht text file?
cheers
raj
View Replies !
View Related
Loading Images From A File At Runtime
Hi,
I was wondering is there a way to load images at run time that are loaded from an external webhost. Basically i want to be able to store the addresses of the images into an array and then each slide is going to contain 1 image, which will load the next image in the array when the user clicks the next button.
I'm fine with getting the array setup etc, but need to know is it possible to use web addresses and load images at runtime?? Aswell as defining a size and position for where the image will appear.
I'm not sure if Flash 8 supports this loading on the fly so the speak?? Basically I will update the images when required by replacing them with the same name and address where the photos are being hosted, but the program will still load from the same address, therefore showing the updated images.
Sorry for that being so long winded, but the first thing i need to know is, is there a way to load images in this way?? If so any general guidance would be appreciated and then i can write the code myself im sure :-D
Thanks in advance,
Dan
View Replies !
View Related
Loading The Images By XML File In Flash
i have created the image gallery. The source of the images are actually from scrapping the websites. ie. when i give the particular url of the webpage it will give all the images that are in the website. The output is in form of the XML file. What the problem i face now is the images are displayed in the place holder without breaking. i.e., only four images to be display in a row and the next four will display below. if more than 8 images then it will show paging to access the other images too. please help me to achieve this concepts. thank you in advance for who reviewing and giving the solutions.
View Replies !
View Related
3D Carousels II - Images Not Loading Via Xml File?
*ack*
I can not seem to figure out why the images are not loading from the xml file...
I am using Flash MX 2004 pro ... (is this the problem???)I have watched the video 15 times over to trace my steps and at the 1/2 way point right where Lee first tests the movie and all the pings load into his project, all I get are the 'inner' place holders for the 'item' and 'ref' movie clips...
I have 6 pings in my xml file and when I test my movie here at the 1/2 way point of the tutorial I do see "6" placeholders in the form of black rectangles as that is what I used for the "inner" movieclip...
Here is my AS code...
var numOfItems:Number;
var radiusX:Number = 250;
var radiusY:Number = 75;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/2;
var speed:Number = 0.02;
var perspective:Number = 130;
var home:MovieClip = this;
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.r.inner.loadMovie(nodes[i].attributes.image);
}
}
xml.load("icons.xml");
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s:Number = (this._y - perspective)/ (centerY+radiusY-perspective);
this._xscale = this._yscale = s * 100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}
this.onMouseMove = function ()
{
speed = (this._xmouse-centerX)/9000;
}
Here is my xml code...
<icons>
<icon image="ES-175.png" tooltip="ES-175" />
<icon image="ES-137-CLASSIC.png" tooltip="ES-137 CLASSIC" />
<icon image="ES-137-CTSM.png" tooltip="ES-137 CUSTSOM" />
<icon image="ES-335-DOT-GLOSS.png" tooltip="ES-335 DOT-GLOSS" />
<icon image="ES-335-DOT-SATIN.png" tooltip="ES-335 DOT-SATIN"/>
<icon image="ES-345.png" tooltip="ES-345" />
</icons>
The xml is in the same folder as the .fla fie.
wow, can somebody please help me?
I am out of ideas...
:)
View Replies !
View Related
Loading Images Into An Array From An External File
Hey, this has probably been asked before but I got an external file that has some URLs for some images. I want to load the images into an array so I can easily advance the array and place the images where they need to be.
I just need help with importing the images from the text file and what the text file should contain.
Thanks
View Replies !
View Related
Loading Number Of Images In One Swf File Dynamicly
I am working on php shopping site. I want to load different images in one swf file. Here is the example if you click plus button (agrandir) it will open popup and this is flash file.
do i need to make separate swf file for each product or can I use one swf to load all images one by one? is there any solution?: mad:
View Replies !
View Related
Loading Number Of Images In One Swf File Dynamicly
I am working on php shopping site. I want to load different images in one swf file. Here is the example if you click plus button (agrandir) it will open popup and this is flash file.
do i need to make separate swf file for each product or can I use one swf to load all images one by one? is there any solution?
View Replies !
View Related
Prolem In Loading The External Swf File And Images
hi,
i hev to load the external swf file and the images consequently,the dats are cmg from the xml and it's looking like this [clip1.swf,clip2.swf,image1.jpg] .
but if the array will be like this means [clip1.swf,image1.jpg,clip2.swf] .. but after loaded the images i's not moving to load the second swf file.
here i am checking the current frame and total number frame to load the swf file
can any one help to solve this issue....
~~Sk
Attach Code
function loadtesting() {
var my_Array:Array = objLoad.returnarray();
var newMovie = true;
var selectMovie:Number = 0;
var totalMovies:Number = my_Array.length;
loadMovie(my_Array[0], MoviePlayerControl1);
setInterval(function () {
if (MoviePlayerControl1._totalframes>1) {
if (MoviePlayerControl1._currentframe == MoviePlayerControl1._totalframes) {
if (!newMovie) {
newMovie = true;
if (selectMovie != totalMovies-1) {
selectMovie++;
loadMovie(my_Array[selectMovie], MoviePlayerControl1);
var str:String = my_Array[selectMovie];
var strArray:Array = str.split(".");
trace(selectMovie+"find the value");
} else {
selectMovie = 0;
loadMovie(my_Array[selectMovie], MoviePlayerControl1);
}
}
} else if (newMovie) {
trace("false");
newMovie = false;
}
}
}, 5);
}
View Replies !
View Related
Loading Images In Text Box From External Txt File...
hello kirupa guys,
i hope to get some help in the loading images in dynamic text box. I am successul in loading images when the text is in the movie ... like in the actionscript with some variables. But when I load an external text file... the same text doesn't work for loading the images. The movie works fine otherwise but the image is not shown.
could anyone explain about it to me?
I tried everything suggested by Macromedia website but the images doesn't seem working with the externally loaded text.
other html tags work with that file.
i look forward hearing something....
sincerely,
rabi
View Replies !
View Related
Loading Images Or Html From Swf File To A Brower From A Cd
I was duin a CD project for someone that involved images. I wrote the code alot of times debugged it but still wouldnt work. I tried the same to an external photo gallery but it only loaded the brower without any display of the index.html file i wanted it to load. Please help me load files fron flash to a brower especially images, html files and audio files.
PLs hELP
View Replies !
View Related
Loading Images In Text Box From External Txt File...
hello kirupa guys,
i hope to get some help in the loading images in dynamic text box. I am successul in loading images when the text is in the movie ... like in the actionscript with some variables. But when I load an external text file... the same text doesn't work for loading the images. The movie works fine otherwise but the image is not shown.
could anyone explain about it to me?
I tried everything suggested by Macromedia website but the images doesn't seem working with the externally loaded text.
other html tags work with that file.
i look forward hearing something....
sincerely,
rabi
View Replies !
View Related
Loading Images From An External Text File
One of my clients has purchased a Flash template from my site.
This template uses an external text file to modify the main elements of the template such as Company Name, slogan, buttons and content for each page. The text file also supports html formatting for the content. This includes paragraph, linebreak, bold, size, Italics, color, hyperlinking and underlining.
My client wants to be able to place an image inline with the text and have the text wrap around it. Is there any way to accomplish this in the external text file? I did not think this was possible until I read Flash support documentation. Flash Player version 7 does support image html formatting.
I tried this myself, but without success. Can anyone give me guidance or example of code that I can add to following code in the external text file? The content area in the Flash source file is Dynamictext and Multiline.
Example taken from text file:
<!---------------edit button1 content here----------------------------------------------->
&contentarea1=This <b>'Flashy' Template</b> has great high-tech effects! Very easy to edit in Notepad or Wordpad only in a matter of minutes. No Flash experience required. <u>Real timesaver</u>!
The images on the right side change to correspond with each page when clicked on. These images can also be easily replaced in the <i>'Library'</i> panel of the .fla file provided using Flash MX or later versions.
This is my example image here <img align='right' src='clint.jpg'/> for content area.
Basic html tags supported... 'bold, underline, line break, paragraph, font size, font color, links'.
Thankyou guys
View Replies !
View Related
Problem In Loading Images From An Xml File In 3d Carousel
Hello,
I am a great follower of Lee and presently I am working on the 3D Carousel that Lee has built with the help of Papervision3d. I am trying to make it dynamic by calling the images from an xml file. I am successful in parsing the xml file but when I am trying to attach the dynamic images with BitmapFileMaterial, I am getting the error and it is not working. Below is my code:
======================================================================================================
Code:
package
{
import flash.display.Stage;
import flash.display.Sprite;
import flash.display.Loader;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
// Import Papervision Classes
import org.papervision3d.scenes.*;
import org.papervision3d.objects.*;
import org.papervision3d.cameras.*;
import org.papervision3d.materials.*;
import caurina.transitions.*;
public class Main extends Sprite
{
private var loader:URLLoader;
private var myXML:XML;
private var xmlPath:String = "images.xml";
private var photos:Array = new Array();
private var thumb:Loader;
//Paparvision properties
private var container:Sprite;
private var radius:Number = 800;
private var anglePer:Number;
private var scene:MovieScene3D;
private var cam:Camera3D;
private var bfm:BitmapFileMaterial;
//private var p:Plane;
private var angleX:Number = anglePer;
private var dest:Number = 1;
public function Main()
{
loader = new URLLoader();
loader.load(new URLRequest(xmlPath));
loader.addEventListener(Event.COMPLETE, completeHandler);
anglePer = (Math.PI*1) / photos.length;
container = new Sprite();
container.x = stage.stageWidth * 0.5;
container.y = stage.stageHeight * 0.5;
addChild(container);
scene = new MovieScene3D(container);
cam = new Camera3D();
cam.zoom = 6;
}
private function completeHandler(e:Event):void
{
myXML = new XML(e.target.data);
//trace(myXML);
for(var i:int=0; i < myXML.img.length(); i++)
{
photos.push(myXML.img[i].@url);
//trace(photos[i]);
}
init3d();
}
private function init3d():void
{
for(var j:int=0; j < photos.length; j++)
{
bfm = new BitmapFileMaterial(photos[j]);
bfm.oneSide = false;
bfm.smooth = true;
//trace(photos[j]);
var p:Plane = new Plane(bfm, 162, 230, 2, 2);
p.x = Math.cos(j*anglePer) * radius;
p.z = Math.sin(j*anglePer) * radius;
p.rotationY = (-j*anglePer) * (180/Math.PI) + 270;
scene.addChild(p);
}
this.addEventListener(Event.ENTER_FRAME, render);
}
private function render(e:Event):void
{
cam.x = Math.cos(angleX) * 1000;
cam.z = Math.sin(angleX) * 1000;
scene.renderCamera(cam);
}
}
}
======================================================================================================
Can anybody guide me where I am making the mistake. Thanks in advance for the help.
Regards,
Simanta
View Replies !
View Related
Making A Loaded Swf-file Loading Images Into The Movie..
Trying to convert my problem from norwegian into english isn't always that easy... :)
Anyway..
I've created som cool buttons that I want to be loaded into a movie (let's call i MainMovie.swf) and from there I want the buttons to be able to load images into a movieclip (ImageContainer) inside the MainMovie.swf.
Is it possible to make the MainMovie.swf communicate with the the loaded buttons (each button is a swf-file containing the actionscript, objects, etc.) so when the buttons are clicked they load different images into the ImageContainer?
My idea here is to include an as.file into the MainMovie.swf as well containing the url's to the images that I want to be loaded into ImageContainer.
I've tried to create a button on a layer above the buttons that's loaded into the MainMovie.swf but I end up with the loaded buttons not working properlu because of the button that I've created and placed above them.
Now, I don't want the url's inside the buttons thats loaded into the MainMovie.swf as I want the ability to be able to replace those buttons-files without having to use too much time writing the url's in each button.
Thanks folks.
View Replies !
View Related
Dynamically Loading Images Set As Vars In A Text File
Hi,
I am new to Flash and was hoping someone could help me.
I have numerous file names stored as vars in a text file e.g.
f1p0=1_short_blue_left.swf&f2p0=0_medium_blue_left .swf&f3p0=3_medium_yellow_left......
So in the main timeline I will have an action that loads the vars from the textfile.
I have to load these movie files(that will contain only a graphic) into specific postions in a movie. I was hoping to mark the positions with var names i.e. I will have a path p0 and the first image will be placed at f1p0 the second image will be placed at f2p0 (somewhere else on the path) etc.
Can I mark the position with var name so that it will be loaded with the movie file assigned in the textfile?
If anyone can help or give alternative approaches I would really appreciate it.
Thanks
View Replies !
View Related
Problem: Loading Thumbnail/dynamic Images From A Text File->have To Click Twice?
Hi guys!
I just joined Kirupa, and wanted to share my dilemma right away.
Los problemos:
I have the thumbs loaded from a text file, which are generated by a php file, that reads the folder's content. This works fine.
So, the problem is that for some reason I have to click the kategory buttons at least twice, to get all the thumbnails appear to the stage in Flash.
Is it a image preloading problem, or is it just my code?
My guess is that the images take longer to load, than the script to execute?
Oh, and in my code I use loadMovie() to load the thumbs.
Is loadClip() a better way?
I'm not a full time coder, but I've done actionscript and php on occasion.
So please wisemen, show me the light!!
Here's the code I wrote: (Don't mind the finnish comments. )
-------------------------------------------------
stop();
//includet
import mx.transitions.Tween;
import mx.transitions.easing.*;
//************************ alkuasetelma ********************************
//kategorianapit
_global.portfolioBtnArr = new Array(
esite,
flyerit,
julisteet,
kayntikortti,
logot,
myymala,
outdoor,
pakkaukset,
printti,
www
);
//julistetaan muutama globaalimuuttuja
_global.kategoria;
_global.images;
imageHolder._y = 44;
imageHolder._x = 25;
//nappien toiminnot
for(i=0 ; i < portfolioBtnArr.length ; i++){
portfolioBtnArr[i].onPress = function(){
//poistetaan luodut thumpit edellisessä kategoriassa
for(a = 0; a< images.length;a++)
{
unloadMovie(_root["picture_holder"+a]);
}
//Puretaan "this" määrite stringiksi
this_String = String(this);
//luodaan siitä uusi string objekti
kategoryString = new String(this_String);
//määritetään onPress-funktion sisällä i:n arvoksi arvo, joka asetetaan for loopissa picture_holderin perään arvolla i
kategoria = kategoryString.slice(23);
if( !_root.picture_holder){
//uusi loadVars
myFile = new LoadVars();
//ladataan textifile napin mukaan "kategoria määritelty napissa
myFile.load("txt/" + kategoria + ".txt");
myFile.onLoad = function()
{
//Pilkotaan tekstifilessa oleva string pilkun kohdalta Arrayksi
picArray = myFile.kuvat.split(",");
//luodaan globaalimuuttuja, joka pitää sisällään ladatun Arrayn
images = picArray;
TheGallery();
}
}
}
//Lisätty, koska thumpit ei näkyny välttämättä onpressillä
portfolioBtnArr[i].onRelease = function(){
//************************ kuvannimien haku txt filesta ********************************
//uusi loadVars
myFile = new LoadVars();
//ladataan textifile napin mukaan "kategoria määritelty napissa
myFile.load("txt/" + kategoria + ".txt");
trace("txt/" + kategoria + ".txt");
myFile.onLoad = function()
{
//Pilkotaan tekstifilessa oleva string pilkun kohdalta Arrayksi
picArray = myFile.kuvat.split(",");
//luodaan globaalimuuttuja, joka pitää sisällään ladatun Arrayn
images = picArray;
};
TheGallery();
}
}
function TheGallery():Void{
//************************ Kuvien lataus ja thumppien luonti ********************************
//wrapper mc
var portfolioHolder = _root.createEmptyMovieClip("portfolioHolder_mc", getNextHighestDepth());
portfolioHolder.onEnterFrame = function()
{
for (i = 0; i < images.length; i++)
{
var pichold = _root.createEmptyMovieClip("picture_holder"+i, i);
pichold.createEmptyMovieClip("thumbnail", 5+i);
pichold.onEnterFrame = function(){
this.thumbnail._width = 36;
this.thumbnail._height = 36;
delete this.onEnterFrame;
}
if(i >= 7 && i < 14)
{
pichold._x = 800; //800;
pichold._y = 315 + (40* (i - 7));
}
else if(i >= 14 && i < 21)
{
pichold._x = 760; //840;
pichold._y = 315 + (40*(i - 14));
}
else if(i >= 21 && i < images.length)
{
pichold._x = 720; //840;
pichold._y = 315 + (40*(i - 21));
}
else
{
pichold._x = 840; //760;
pichold._y = 315 + (40*i);
}
//ladataan thumb kuva
pichold.thumbnail.loadMovie("images/thumb/" + kategoria + "/" +images[i]);
//actionnit thumb painettaessa
pichold.onPress = function(){
trace(this);
//kaikki kategosialinkit pois käytöstä
for(v=0 ; v < portfolioBtnArr.length ; v++){
portfolioBtnArr[v].enabled = false;
}
//lopetetaan kuvan esiintulo, siltä varalta että toista thumbnailia painetaan kesken animoinnin
//näin ei tapahtu bugeja ison kuvan sisäänfeidauksessa
twMC.stop();
picBg._alpha = 100;
//imageHolder._alpha = 0;
//Puretaan "this" määrite stringiksi
test_String = String(this);
//luodaan siitä uusi string objekti
position = new String(test_String);
//määritetään onPress-funktion sisällä i:n arvoksi arvo, joka asetetaan for loopissa picture_holderin perään arvolla i
N = position.slice(22);
//kuvan latauksen jälkeen ------------------------------------------------Ollaan vielä onPressin sisällä
//luodaan movieclip lataaja
var mcl:MovieClipLoader = new MovieClipLoader();
//luodaan listener
var listener:Object = {};
//lisätään luotuun mc-lataajaan listener
mcl.addListener( listener );
//luodaan uusi tyhjä mc
createEmptyMovieClip( 'placeholder_mc', getNextHighestDepth() );
//ladataan clip/movie -tässä casessa kuva
mcl.loadClip( "images/jpg/" + kategoria + "/" + images[N] , imageHolder );
//latauksen alussa luodaan funktio joka tarkistaa latausstatuksen
listener.onLoadInit = function( mc:MovieClip )
{
//ladattu klippi on valmis
//trace( 'loaded: '+mc );
//kehysten koko
tw1 = new Tween( picBg, "_width", Elastic.easeOut, picBg._width, mc._width + 10, 1, true);
tw2 = new Tween( picBg, "_height", Elastic.easeOut, picBg._height, mc._height + 10, 1, true);
tw3 = new Tween( picBg, "_x", Elastic.easeOut, picBg._x, mc._x - 5, 1, true);
tw4 = new Tween( picBg, "_y", Elastic.easeOut, picBg._y, mc._y - 5, 1, true);
//tw2.onMotionFinished = function(){
//kuvan fadeIn
twMC = new Tween(mc, "_alpha", Regular.easeOut, 0, 100,1, true);
for(v=0 ; v < portfolioBtnArr.length ; v++){
portfolioBtnArr[v].enabled = true;
// }
}
}
//kun lataus on käynnissä, tämä funktio toimitetaan
listener.onLoadProgress = function( mc:MovieClip, bytesLoaded, bytesTotal )
{
//more data has been loaded
// trace( ( ( bytesLoaded/bytesTotal ) * 100 ) +'%' )
//kuva pois näkyvistä
mc._alpha = 0;
}
//--
}
// Estää flashia yrittämästä ladata olemattomia kuvia ja thumbeja, tarkastamalla images arrayn
//kumumäärän, ja lopettamalla loopin jos se saavutetaan ennen muita ehtoja.
if(i == images.length -1)
{
break;
}
}
delete this.onEnterFrame;
}
//end of the gallery function
}
//************************************************** ************************
View Replies !
View Related
Dynamically Loading Images From XML File, Pass Image Name In Event Listener
Hey, so I have an XML file with images. I have a function that loops through the XML file and loads all of the images and uses an event listener to tell when the image has loaded. With that event listener I need to pass the name of the image along too. I figured out how you pass arguments with an event listener, but it just passes along the last image name in the XML file.
Code:
function loadPictures():void
{
for (var k in xmlData.page)
{
var request:URLRequest = new URLRequest(xmlData.page[k].attribute("url"));
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event){onDisplayImage(e.target.content, k)});
loader.load(request);
}
}
So in my onDisplayImage function, if I trace k, it always comes up with 16 (because there are 17 images in the XML file) how do I get it to pass the correct number?
View Replies !
View Related
Images Pulled From Folder/txt File, Images Loop With Delay?
I would like to have a flash movie where images change from one to the next with maybe a 10second delay, and it will loop over n over.
I want flash to take images from a folder or a .txt file stating where the images are found so adding new photos or removing photos from this looped movie will be a breeze.
Any help would be greatly appreciated, thanks!
View Replies !
View Related
Images Pulled From Folder/txt File, Images Loop With Delay?
I would like to have a flash movie where images change from one to the next with maybe a 10second delay, and it will loop over n over.
I want flash to take images from a folder or a .txt file stating where the images are found so adding new photos or removing photos from this looped movie will be a breeze.
Any help would be greatly appreciated, thanks!
View Replies !
View Related
Loading External Images Randomly, Getting The Amount Of Images Out A *.txt
hello there!
i've made an a script that loads images externaly from a specific map
randomly. there's only one thing:
how can flash learn to know how many images are loaded?
it's for a client so he can only upload the images and that's it.
can he somehow fill in a *.txt-file that flash can use further???
this is my sourcecode for the external-stuff:
code:
_root.importImage = "background_netomzet"+random(*)+".jpg";
(the * has to be a value that needs to be generated by how many pics
there are in the image map")
thanks a million people!
g
View Replies !
View Related
Loading Images Into A Container-H And V Images Centered
I am trying to load multiple images into a container clip to make an image gallery. Since there are both horizontal and vertical images I want the images to load into the center of the container clip (the center of container clip is aligned with the center of each image) because I cannot align both h and v images in my design by a corner. how do I do this?
Thank you!
View Replies !
View Related
Dynamic Image Loading / Images Not Loading?
This is my first try at loading images with action script. I read through the forums, borrowed code, and adapted it.
///////////////////////////works fine
myvars = new LoadVars();
myvars.load("alldoorsdesc.txt");
myvars.onLoad = function (success) {
if (success) {
_root.doorsinsttxt.htmlText = myvars.d1txt+"<BR><BR>To order call us at 505 934 8888";
//I would like to create a for loop here so addidtional
//items can be added, is this possible?
_global.dr1txt = myvars.d1txt;
_global.dr2txt = myvars.d2txt;
_global.dr3txt = myvars.d3txt;
_global.dr4txt = myvars.d4txt;
_global.dr5txt = myvars.d5txt;
}
};
///////////////////////////doesn't trace to loaded door
var doormovie = _root.createEmptyMovieClip("imgmovie",_root);
doormovie._y = 100;
doormovie._x = 300;
doormovie._width = 300;
doormovie._height = 300;
function loadpic(num){
trace("inside loadpic" +num);
doormovie.createEmptyMovieClip("img"+num, num);
doormovie["img"+num].loadMovie("images/door"+num+".png");
//// I'm not sure about this line
doormovie["img"+num].onload = function(){trace("loaded door"+num);};
stop();
}
function unloadpic(num){cont["img"+num].removeMovieClip();}
function unloadAll(){cont.removeMovieClip();}
loadpic(1);// load the inital picture
----------------------------
Are all these functions loaded into the root visible from another movie that is imported with getURL ? Or do I have to copy the functions to that imported movie?
View Replies !
View Related
Loading Order - Dynamically Loading Images
Flash 5
I am trying to control the loading order of dynamically loading images. If I have 12 placeholders (4 columns by 3 rows) for the images (e.g. 12 instances of a movie clip) each of which loads a different JPG or SWF. I want the 1st instance/placeholder to completely load the image dynamically before the next instance starts to load the next image and so on. How can I ensure image1 is dynamically loaded before image2 and then image3 etc...
If I put each instance on a separate frame on the timeline will it stop on each frame until the instance is loaded before moving onto the next frame? I have seen the effect im trying to recreate on both:- www.rui-camilo.de and www.andyfoulds.co.uk
Many Thanks in advance.
View Replies !
View Related
Small Flash File Loading Into HTML - Weird Sporadic Loading
Hi,
I'm hoping someone can help...
I have a very small Flash file (less than 5k) loaded into a table cell of an HTML page .
On occasion (on Mac/IE) there is a flash of white appears in the table cell before the file starts. On other occasions only a portion of the file appears (while the rest of the cell is white). And at other times, none of the file appears (the table cell that it's in is appears as white).
The background of the flash file is orange (not white) so I guess that means that none of the Flash has loaded. Sometimes when I refresh the page, the problem resolves itself.
Does anyone know what the problem may be? Is there any sort of pre-loading JavaScript that would help, even though the file is very small to begin with?
Thanks for any help, I really appreciate it!
View Replies !
View Related
Dynamic Loading Text File Not Loading Correctly
I am loading info from a text file (noticeBoard.txt) using the following code;
sourceTXT = "noticeBoard/noticeBoard.txt";
nodeSource = new LoadVars();
nodeSource.onload = gotoAndStop(printText);
nodeSource.load(sourceTXT);
Then writing it into a textfield when the timeline moves to the 'printText' frame.
The swf is working when I load my html page (notice.htm), with all my values being displayed. If I then navigate away from this page to one where I write more info to the text file and then return to notice.htm the latest info in the text file does not show in my swf. Even if I refresh the html page the new info does not appear until I shut my browser window then reopen it.
Does anyone have any suggestions to why this info is not coming in on the fly?
Thanks
View Replies !
View Related
Can An Swf File Remotely Use Images?
In Flash 5+ can I configure an swf file to remotely use images... I would imagine it is done by having the image files to be used in the swf as 'linked files' (if this is possible) and then scripting could choose which images to use, plus the owner of the site can upload new images to the webspace which (if they had the same names etc.) would be used by the swf.
View Replies !
View Related
Load Images XML File
Hey
I want to load 50 random images from an XML file. I have 50 movieclips on my Stage. The instances are numbers from 1 to 50. So a movieclips instance name is "1" or "2". Now when i load these images i need to resize them (50%). The images load perfectly. but i cant adjust the width and height????
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("Scripts/Titles.xml");
slides_xml.ignoreWhite = true;
i = 1;
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
StopImage = setInterval(Inladen,50);
}
}
function Inladen(){
Node = random(totalSlides);
NodeItem = rootNode.childNodes[Node];
imagePath = NodeItem.attributes.image;
//this[i]._width = 52,5;
//this[i]._height = 75;
loadMovie(imagePath,i);
i++;
if (i==51){
clearInterval(StopImage);
}
}
What to do??
thx
Diederik
View Replies !
View Related
Dynamic Images From A Txt File
Hey everybody. I'm trying to get a .jpg file to load into a movie symbol in my flash file. But I want the url
(syntax: loadMovie(mypath,targetmovie) )
to be a variable name which gets its value from a .txt file which serves as a MIME.
Here is my action script. It's short. I have a movie on the desktop with an instance name of mymov....
loadVariablesNum("test.txt",mymov)
loadMovie(testimage,mymov)
//testimage is the name of the variable I use to hold the path of my .jpg in the MIME/txt file.
If anyone can help, even with a link to a site which explains how to do what I am going for, it would be greatly appreciated.
View Replies !
View Related
Exporting Used Images Out Of Fla File ?
i use a program called psd2fla witch inserts photoshop layers inside fla file as png files. But many times those file need to be as external png files as well.
is there a way to export the used png files from library to outside files in the same size and format as they were imported.?
mayby a program or method??
View Replies !
View Related
Images In My Exe File Are Jagged
Hi, I am having a problem with placing images in a flash projector file - I have tried placing them as jpegs/ pngs, actual size/ re-sized, rgb/ cmyk (basically everything I can think of!) and when viewed in the exe or projector files they are jagged on screen. Does anybody know how to remedy this?
Thankyou!
View Replies !
View Related
Images In External Txt File?
Hey guys
I have created a movie clip referencing an external text file for a client. This way he can update the news area of his flash site independently. He's now asking if he can include images in these updates.
As far as I know, the answer is 'hell no!' but I thought I'd ask the pro's first!
I always thought the external text file could use bold, italic, break and paragraph tags and that's it. Is there any way to incorporate images?
Thanks!
-w72
View Replies !
View Related
Missing Images In Swf File
Why doesn't the title bitmap from the .fla library, not appear in the swf file? downloadable at:
http://www.fzvastgoed.nl/pcxpert/pcxperting.com.zip
2)
Why doesn't onRollout work properly?
i scripted this:
in MC frame 1:
PHP Code:
stop();
this.onRollOver = function() {
gotoAndPlay("2");
};
in MC frame 2-9:
PHP Code:
this.onRollOut = function() {
gotoAndStop("1");
};
inMC frame 10:
PHP Code:
stop();
this.onRollOut = function() {
gotoAndStop("1");
};
Now, the problem is, whether i'm rolling out at frame 2-9 or at frame 10, i will not be linked to gotoAndStop frame 1. Only if i rollout, then rollIn again, only then i will be linked to: gotoAndStop("1");
View Replies !
View Related
|