Using Xml Loaded Images As Buttons
I am new to actionscript. i know this has been hashed over in various forms before but i have honestly been working at this for over a week. I got a script from Kirupa on loading images for photogallery with xml, but I do not want to use "next" and "previous" buttons but want to use the images themselves as buttons to load the larger images, prefferably on rollover. Right now i have the thumbnails loaded but can only give them on event handlers as a group not individually. i will post the fla I could be way off with the way I am approaching this, i don't know. thanks for your patience and help! I can also post a link for an example website that I am trying to create.
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 03-28-2005, 07:40 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Using Loaded Images As Buttons
hey,
i'm dynamically loaded a number of images from an xml file. i want to use these images as buttons but the code doesn't work.
Code:
for(var u = 0; u < imageLength; u++){
var thumbImages:String = "thumbImages" + u;
this.createEmptyMovieClip(thumbImages, this.getNextHighestDepth());
this[thumbImages]._x = 0 + (80 * u);
this[thumbImages]._y = 100;
var thumbURL = _root.portfolioXML.firstChild.childNodes[r].childNodes[2].childNodes[u].firstChild.nodeValue;
trace(this[thumbImages]._x);
loadMovie(thumbURL, thumbImages)
this[thumbImages].onRelease = function(){
trace("test");
}
}
does using a string variable instead of the intance name prevent this from working. any ideas
thanks
adam
Using Xml Loaded Images As Buttons
I am new to actionscript.
i know this has been hashed over in various forms before but i have honestly been working at this for over a week. I got a script from Kirupa on loading images for photogallery with xml, but I do not want to use "next" and "previous" buttons but want to use the images themselves as buttons to load the larger images, prefferably on rollover. Right now i have the thumbnails loaded but can only give them on event handlers as a group not individually. i will post the fla I could be way off with the way I am approaching this, i don't know. thanks for your patience and help! I can also post a link for an example website that I am trying to create.
Buttons From Externally Loaded Images?
Hi there,
I'm looking to create buttons from externally loaded images but am not sure whether I'm going about it the correct way, or if it's even possible.
I've loaded my images externally onto the stage, and over these (on higher layer) I've created invisible buttons to the exact dimensions and positions which when clicked will cause some text to appear.
Should this work in theory ? Or is there an easier way to achieve this? Basically the buttons will change when content is updated.
All suggestions appreciated.
Many thanks
Q.
Dynamic Loaded Images As Buttons
First is first: hi and u all r doing a great job with this site. Thank u!
I did not find a straight help for my "problem" so: I loaded images dynamiclly in my flash movie and now i want to make them behave like buttons. I mean, I want [onRelease] function to work. I am sure i am doing something wrong because i cannot make it work.
I hope it makes any sense.
Turning XML Loaded Images Into Pressable Buttons
Hi, I'm looking to find out how to turn individual thumbnails I've loaded through XML into pressable buttons that each have different functions.
here is the code I'm using to display the XML ...
Code:
function callThumbs() {
_root.createEmptyMovieClip("container_mc",_root.getNextHighestDepth());
container_mc._x = _root.gallery_x;
container_mc._y = _root.gallery_y;
var clipLoader = new MovieClipLoader();
var preloader = new Object();
clipLoader.addListener(preloader);
for (i=0; i<_root.myImagesTotal; i++) {
thumbURL = myImages[i].attributes.thumb_url;
myThumb_mc = container_mc.createEmptyMovieClip(i, container_mc.getNextHighestDepth() );
myThumb_mc._x = _root.thumb_width*i;
clipLoader.loadClip("thumbs/"+thumbURL,myThumb_mc);
preloader.onLoadComplete=function(target){
target.onRelease=function(){
callFullImage(this._name);
}
}
preloader.onLoadStart = function(target) {
target.createTextField("my_txt",target.getNextHighestDepth,0,0,100,20);
target.my_txt.selectable = false;
};
preloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
};
preloader.onLoadComplete=function(target){
target.my_txt.removeTextField();
new Tween(target, "_alpha", Strong.easeOut, 0, 100, .1, true);
target.onRelease=function(){
callFullImage(this._name);
}
target.onRollOver=function(){
this._alpha=50;
};
target.onRollOut=function(){
this._alpha=100;
};
}
}
}
Thanks if anyone can help
C
Problems With Positioning Dyn. Attached Buttons & Centering Loaded Images [renamed]
this is a piece of my script...
what it has to do is to generate "j" buttons (j being the number of registrations from my database) and arrange them in rows of 5 or 6...
unfortunately the buttons are generated but are not arranged properly. i have 9 registrations in the database so there are 9 buttons... the first 8 are next to each other and the last one is somewhere to the right...
further on, at the release of a button it should create the lwLogo movieclip and load there a certain pic (the path being taken from my database). then the lwLogo mc should be centered on the screen... as this doesn't happen in the _root the center of the screen would be -442 in this movie clip so normally to center the image i should place lwLogo at -442-(lwLogo._width/2) but this doesn't work. the photos are loaded but not in the center...
would anyone please take a look?
thanks in advance
Code:
serie=0;
serii=0;
for(j=workEntries-1;j>=0; j--){
var mc = copyButton.duplicateMovieClip("copy"+j,j+10);
mc._x = (j-serii)*20;
if (mc._x>=120) {serie=serie+35; serii=serii+5}
mc._y =(15 + serie);
mc.id = workSection.childNodes[j].childNodes[1];
mc.nr=j;
mc.onRelease = function(){
removeMovieClip(_root.lwLogo);
this.createEmptyMovieClip(lwLogo)
lwLogo._alpha=0;
lwLogo.loadMovie(unescape(workSection.childNodes[this.nr].childNodes[2].firstChild.nodeValue));
if (lwLogo.getBytesLoaded() == lwLogo.getBytesTotal()) {
lwLogo._x=-442-(lwLogo._width/2);
this.onEnterFrame = function() {if (lwLogo._alpha<=100) {
lwLogo._alpha += 10;
Buttonless Scroller - How Do I Link Buttons Inside Mc To Dynamically Loaded Images?
Hi, I've made this scroller, http://www.flashkit.com/tutorials/In...-909/index.php and it works fine. One thing though is, it leaves out how to link the contents of the scroller to that dynamic field. In my case, I'd like to link the thumbnails to an image. I guess I'd make each image an swf with preloader? Since I need to add captions too...? Right?? Can someone help! I'm lost!! And, what is the code that I put on each button?
THANKS!
Problems With Positioning Dyn. Attached Buttons & Centering Loaded Images [renamed]
this is a piece of my script...
what it has to do is to generate "j" buttons (j being the number of registrations from my database) and arrange them in rows of 5 or 6...
unfortunately the buttons are generated but are not arranged properly. i have 9 registrations in the database so there are 9 buttons... the first 8 are next to each other and the last one is somewhere to the right...
further on, at the release of a button it should create the lwLogo movieclip and load there a certain pic (the path being taken from my database). then the lwLogo mc should be centered on the screen... as this doesn't happen in the _root the center of the screen would be -442 in this movie clip so normally to center the image i should place lwLogo at -442-(lwLogo._width/2) but this doesn't work. the photos are loaded but not in the center...
would anyone please take a look?
thanks in advance
Code:
serie=0;
serii=0;
for(j=workEntries-1;j>=0; j--){
var mc = copyButton.duplicateMovieClip("copy"+j,j+10);
mc._x = (j-serii)*20;
if (mc._x>=120) {serie=serie+35; serii=serii+5}
mc._y =(15 + serie);
mc.id = workSection.childNodes[j].childNodes[1];
mc.nr=j;
mc.onRelease = function(){
removeMovieClip(_root.lwLogo);
this.createEmptyMovieClip(lwLogo)
lwLogo._alpha=0;
lwLogo.loadMovie(unescape(workSection.childNodes[this.nr].childNodes[2].firstChild.nodeValue));
if (lwLogo.getBytesLoaded() == lwLogo.getBytesTotal()) {
lwLogo._x=-442-(lwLogo._width/2);
this.onEnterFrame = function() {if (lwLogo._alpha<=100) {
lwLogo._alpha += 10;
Buttonless Scroller - How Do I Link Buttons Inside Mc To Dynamically Loaded Images?
Hi, I've made this scroller, http://www.flashkit.com/tutorials/In...-909/index.php and it works fine. One thing though is, it leaves out how to link the contents of the scroller to that dynamic field. In my case, I'd like to link the thumbnails to an image. I guess I'd make each image an swf with preloader? Since I need to add captions too...? Right?? Can someone help! I'm lost!! And, what is the code that I put on each button?
THANKS!
Skipping Missing Images For Dynamically Loaded Images?
Hey all,
I'm creating a image viewer for a photography studio.
I have it dynamically load the images. I'm using a text file to tell flash how many pics there are, the starting number, and the prefix and suffix for the file name ie. Ahp1234.jpg. Im using a simple counter when a person clicks on the "next" button it will add an increment to the starting number. My problem is photography studios often throw out images that didn't come out right, so there is a jump in numbers, and hence I get an error when trying to load an image that isn't there. I was wondering if there was a way to tell if an image has loaded properly using loadMovie. Or perhaps a better method than what I'm using?
I tried
square = new loadMovie;
square.load (_root.Filename);
square.onload = function (success){
if (success) {
//coding
}else{
counter++
}
}
If any one has any insight I would appreciate it.
Thanks.
Is This Possible With XML Loaded Images ?
Can I make something like this but with XML loaded images ?
http://www.flashkit.com/tutorials/Sp...-636/more2.php
Can I do that all in Code , where I do my import of my XML ?
If yes any suggestions what steps I have to take to make something like that.
I wanne do that effect on the Carconfigurator of http://webdesigns.blackz.be/maserati/
(PS: dont expect to much I have to make a schoolproject about the maserati spyder but I cant really work well with flash , but I try)
Getting A Loaded Images Name
Is there a way to pull an images name from an MC that its loaded into?
Say I have a container MC that loads random jpegs and I want to be able to click on the container to get just the current image name and extension. Can you do this?
<edit>
As usual, 5 minutes after posting I figured out a workaround. When the image loads I also load its name to a hidden dynamic text box that I can access for other uses. It seems to work fine but if anyone knows a better way Im all ears.
Getting A Loaded Images Name
Is there a way to pull an images name from an MC that its loaded into?
Say I have a container MC that loads random jpegs and I want to be able to click on the container to get just the current image name and extension. Can you do this?
<edit>
As usual, 5 minutes after posting I figured out a workaround. When the image loads I also load its name to a hidden dynamic text box that I can access for other uses. It seems to work fine but if anyone knows a better way Im all ears.
Checking Loaded Images
Is there any way to check when the image is loaded.
something like LoadVars.loaded for variables.
I would really appreciate it.
Dynamically Loaded Images (.jpg Only?)
I'm loading images from outside my movie using the load movie action. Everything I've read and tried myself so far implies that you can only load .jpgs... Is this correct? I want to load .gis or .pngs so that I can have a transparent background. Any ideas?
thanks
Loaded Images Problems ...
I am in the process of migrating from Flash 5 to MX (I had no idea it was so different! Better of cource, but will take some re-learning!) ...
I am playing around with dynamicaly loading images into published swf's and have come across something I cant work out ....
When a image is loaded into a swf, can you get that images width and height? I tried loading the image into a MC, and retrieving the MC's width and height, but it seems to stay at the size it gets set to by the largest loaded image ...
I want to be able to scale the MC the images are loaded into, so that the image always fits the screen ..
can any one help with this?
Cheers!
Problems With Loaded Images
i'm having some problems when using loadMovie to load some images into my flash movie
in the first section of the script i load a jpeg and set the movieclip's alpha to zero
then i use a script like this
if (this.newClip.getBytesLoaded>= this.newClip.getBytesTotal) {
this.newClip._alpha+=5
}
hoping that once the jpeg has loaded the image will slowly fade in.
What happens is the first time i load the picture the fade in doesn't work. From then on if the image is removed using removeMovieClip and loaded again the script executes correctly. I assume this means the jpeg is in the cache or something. can i refine the script in such a way, that makes sure it will wait till the jpeg is fully loaded and then actually execute the slow fade in, the first time around as well? On occasion the jpeg will not appear at all the first time round. But again from then on it works o.k.
any insights will be appreciated
Allow Smoothing On Loaded Images?
If you view the properties of an image in the Library, you have the option to turn off "smoothing", which is nice if you want to use an image that appears "pixelized", you can load a small image and transform the width and height to stretch the image and show off its lovely pixels very nicely.
Can this be done with images loaded dynamically into the movie at runtime? Is there a property in AS that will control this property? Thanks!
Mozilla Bug: XML Loaded Images
I have a Flash application, that loads a list of images into an array from an XML file. It then goes through the array, displaying the images - fading in and out using the _alpha attribute. There are also navigation buttons, to quickly navigate through the images. While testing, I noticed that if you click the navigation buttons repetatively, the image just disappears. In the FlashMX file, I have traces on it, and the alpha is set to 100, yet the images are still not visible. I tried it in IE (ungh), and it seems to not have this issue. I have set up a temporary link to the published files:
http://www.frontlinesolutions.com/te.../featured.html
Has anyone encountered anything like this?
If you need action script snippets let me know.
Thanks! in advance
Dynamically Loaded Images
Hi, I am working on a product display module for a client.
I have 10 images of the product in a movie clip and am using action script to enable the visitor to rotate the product and zoom in and out.
When I place the images within the flash movie, I get a very smooth transition.
But when i load the images dynamically using load movie, there is a delay before each of these images are displayed giving the rotation feature a very shabby and broken effect.
Please let me know if a smooth transition can be achieved when i use dynamically loaded images and if so, Please guide me on how to do it.
Any help will be sincerely appreciated.
Thanks in Advance.
How To Wait Until Images Are Loaded?
I'm not talking about a preloader...
I have a bunch of images loaded dynamically from an XML file, in a fashion such as this:
function foo(){
for(){
cclip = createEmptyMovieClip(mclip[i], depth);
cclip.loadMovie(jpegs[i]);
}
...
}
And after that for loop is run, I want to place the clips around based on their width and height...but the clips, at this point, don't have those properties...so how do I wait in this function before doing the placing?
Dynamically Loaded Images - Help Please
HI, I'm trying to build a portfolio in which each image loads dynamically, a movie clip resizes to the dimensions of the image being loaded, the image fades in and out again when a new image loads. I have had no problem with any of this except getting the dimensions of the images as they load and centering the images. I want the 'holder_mc' clip to tween from "w"(the current width of 'holder_mc') to "a"(the width of the loaded jpg) and I want them to be centered inside the clip i load them into. Below is the script I have used so far. An example of what I'm trying to acheive is at the address: http://www.iso50.com/iso50.html . Any ideas?
PHP Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
my_mc.loadClip("frames.jpg", "container");
button1.onPress = function() {
var alpha_tween:Object = new Tween(container, "_alpha", regular.easeOut, 100, 0, 1, true);
alpha_tween.onMotionFinished = function() {
my_mc.loadClip("frames.jpg", "container");
};
};
button2.onPress = function() {
var alpha_tween:Object = new Tween(container, "_alpha", regular.easeOut, 100, 0, 1, true);
alpha_tween.onMotionFinished = function() {
my_mc.loadClip("911.jpg", "container");
};
};
button3.onPress = function() {
var alpha_tween:Object = new Tween(container, "_alpha", regular.easeOut, 100, 0, 1, true);
alpha_tween.onMotionFinished = function() {
my_mc.loadClip("tree.jpg", "container");
};
};
w=holder_mc._xscale
h=holder_mc._yscale
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._alpha = 0;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
};
preload.onLoadComplete = function(targetMC) {
trace(targetMC+" finished");
};
preload.onLoadInit = function (targetMC)
{
a="imported image width?";
b=="imported image height?";
trace(contentainer._xscale);
var size_tween:Object = new Tween(holder_mc, "_xscale", Regular.easeOut, w, a, 1, true);
var size_tween:Object = new Tween(holder_mc, "_yscale", Regular.easeOut, h, b, 1, true);
size_tween.onMotionFinished = function() {
var alpha_tween:Object = new Tween(container, "_alpha", regular.easeOut, 0, 100, 1, true);
};
};
Masking Loaded Images, How?
Hey ive been trying for quite some time to load in images, give each image a mask.... i have this code here of what is happening, it doesnt seem the mask is being loaded but it should be... also ive attached my file to my site if someone could look it over, it would help a great ordeal! thank you everyone:
http://www.teksunstudios.com/_misc_p...flash_show.zip
PHP Code:
function loadImages(blankMC:MovieClip, newMask:String, amount:Number):Void {
blankMC.onLoadComplete = function(mcTarget:MovieClip) {
this.attachMovie("newMask_"+i, mcTarget._name+"_mask", this.getNextHighestDepth(), "");
mcTarget.mask = this[mcTarget._name+"_mask"];
mcTarget.setMask(mcTarget.mask);
};
for (var i = 0; i<amount; i++) {
//Making MovieClips that will be used to load images
var mc:MovieClip = blankMC.createEmptyMovieClip("img_"+i, blankMC.getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(blankMC);
var sURL:String = "images/0"+i+".jpg";
mcLoader.loadClip(sURL, blankMC["img_"+i]);
}
}
//Images are loaded
this.createEmptyMovieClip("blank", this.getNextHighestDepth());
loadImages(blank, "mcMask", 4);
//attachMovie("newMask_", "", 0)
stop();
How Can I Use Loaded Images As Thumbnails?
I am working on image gallery. I am loading images in this gallery.
Is there any way to use these loaded images as thumbnails also without loading them again.If yes then how?
Thanks in advance.
Loaded Images Not Show Up
hi.
i'm making an image gallery for a new project.
everything is fine except the problem : when preloader loads the image the image does not show up sometimes.
here are my hierarchy and the code ;
the preloader code;
at frame 10 :
_root.content.resim.resim_content.resim_drag.resim _imaj.loadMovie(_root.yuklenecekresim);
( root.yuklenecekresim is the path of the image here )
at frame 12
var resim_yuklenen = Math.floor(_parent.resim_content.resim_drag.resim_ imaj.getBytesLoaded()/_parent.resim_content.resim_drag.resim_imaj.getByt esTotal()*100);
resim_percent._width = resim_yuklenen*1.7;
( here i calculate the loaded percent of the container mc for the image )
at frame 15
if (resim_yuklenen == 100){
gotoAndPlay("opening");
}else{
gotoAndPlay("pre");
}
at the frames labeled opening the preloader becomes transparent.
when clicked on another pic the preloader becomes opaque again.
here is the project :
http://www.kaktus.com.tr/demo2
click on kaktüs kafe link to see the image gallery.
thanks...
[F8] Randomly Loaded Images
Hello there, I was originally going to post this in the Actionscript area, but after reading some of the posts my question appears to be much too simple to warrant it's inclusion among such complicated scenarios, I suspect the solution to mine is much simpler. So here goes..
I want to have some movie clips that will randomly load images from a specified image folder, every time the is brought to this specific frame, they would encounter a new series of images. I'm familiar with using a move clip loader, and I know there are ways to make things random within Flash.
What I'm not sure about, however, is how to integrate the two, where if perhaps I had a folder of image001.jpg, image002.jpg, etc. that I could use something which would select these images randomly - this is still in it's conceptual stages at the moment, but any input would be appreciated greatly. Much thanks.
Loaded Images 'displaced'
I'm trying to load images into an MC called images ... it works fine apart from one little niggle: every image that is imported seems to be displaced one pixel right and one pixel down.
It normally wouldn't be a problem, except that the images I'm importing have a 1px border, and when imported the displacement makes it look like there's a 2px border on the top and left and none on the right and bottom.
Any ideas about correcting this?
[F8] What Is This Called? (images Appear As They Are Loaded)
hi!
i've seen many sites that may have a page that contains a set of thumbnails and instead of a preloader loading them all at once, they appear 1 by 1, as loaded. is this a special AS script or component or is it just that they are actually loaded all at once and a script is used to make them appear one at a time?
also, i've seen sites where the text types itself out, character by character. how is that done?
thanks for your help!
[F8] Loaded Images Dissapear After A While?
Hi,
I'm having this really weird problem;
from a menu movieclip I load several png files into a mc_loader on the main timeline.
To create a nice fade effect everytime a new image is loaded into the mc, I attached this AS to the mc_loader:
PHP Code:
onClipEvent(load){
this._alpha=0;
}
onClipEvent(enterFrame){
this._alpha+=5;
}
This works great, but the weird thing is:
After a minute or two, the loaded png just dissapears suddenly! And again after a minute or two it comes back again!
I think it has something to do with the AS, but I don't know what exactly.
I allready tried:
updateAfterEvent();
But that doesn't work either. Anyone an idea?
Thanx!
[F8] Referencing Loaded Images
I have created a flash photo-gallery that is driven by XML database (none of the images are imbedded in the flash). I have created an image pre-loader with the help of some of the people here that works great. Now that I have the images loaded, I am trying to access/place the loaded images on the stage when called for in frame 2.
I have the movie split over two frames (one for the loader and the next for the gallery). The images get loaded in frame 1 and in frame 2, I need to access the loaded images for the gallery. When I run the SWF in a slower download simulation speed (56k), I see the pre-loader working on frame1. When the pre-loader is done, I tell it to go to frame 2 which is the gallery. Here however, I see that the images get downloaded again so there's a delay after the pre-loader before the first image is displayed.
I think that the problem is in my frame2 code where I have the following:
Code:
template1_imageHolder1_mc.loadMovie(movie1);
That "loads" movie1 again even though it was just loaded in frame1.
What is the best way to get aroud this issue? Is it to use loadVariables and not loadMovie because the image is already loaded? I have read about Check for Loaded Data and using the use XML.onLoad() function but it isn't very fleshed out unfortunately.
Thanks.
B
Loading MC On Top Of Xml Loaded Images...Help
Hey,
I recently bought a file from this website here: http://flashden.net/item/myslideshowsitepro-v2/9977
I want to customize this by adding other elements onto the main stage, however, the images always appear on top of any element I add. Is there a control or somethign in the script to determine what appears in front?
Basically, I have another flash MC which I want loaded ON TOP of everythign else.
Can I save this MC as a SWF and somehow load it up on top of the xml image?
Someone recommended this :
Make your graphic a Movieclip, right-click that movieclip in your library and select Linkage.
Type in a new name or keep the current name for the Identifier.
Checkbox Export for ActionScript & Export in first frame.
Now, in the Actionscript panel, select a frame and type in:
_root.attachMovie( idName, newName, _root.getNextHighestDepth() * 100);
That code will drop your movieclip on top, times 100 levels above any element on the stage.
but that does not work.
I need this working tonight, and would appreciate a response ASAP from anyone PLEASE!!!
2 Problems With Loaded Images
Well, I discarded the photoFlow thingie, mainly because everybody is using it.
I made some new effect for displaying my pictures. Now I used this "tutorial" to load my images in with xml:
http://board.flashkit.com/board/showthread.php?t=755188 , which works quite well for now.
The first problem is to get my loaded images on the place I need them to be. With the code, my imgHolder is a movieclip in with a linkage "imgDisplay" to make it a class. This movieclip/class contains another movieclip "imgBtnAni", of which are 2 instances off, "imgAni" and "reflect". The "reflect" begin turned and tinted to give that reflect effect.
The movieclip "imgBtnAni" has the movieclip "imgContainer" in it, where the loaded image needs to go. Intance name is "afbeelding".
Problem is that the image won't load into both instances, that of "imgAni" and "reflect". It allways takes the last one. Now how can I get my loaded image on both locations?
This is the code:
Code:
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, onLoaded);
var xml:XML;
var xmlList:XMLList;
var xmlLength:int = 0;
var imgArray:Array = new Array();
var imageLoader:Loader;
var imgHolder:imgDisplay;
xmlLoader.load(new URLRequest("portfolio.xml"));
function onLoaded(e:Event):void{
xml = new XML(e.target.data);
xmlList = xml.categorie.children();
xmlLength = xmlList.length();
//trace(xmlList.length());
for(var i:uint = 0; i < xmlLength; i++){
imageLoader = new Loader();
imageLoader.load(new URLRequest(xmlList[i].attribute("bestand")));
imgHolder = new imgDisplay();
addChild(imgHolder);
imgHolder.x = i * imgHolder.width;
imgHolder.name = "beeld_"+i;
imgHolder.imgAni.afbeelding.addChild(imageLoader);
imgHolder.reflect.afbeelding.addChild(imageLoader);
//trace(imgHolder.imgAni.afbeelding.width);
imgHolder.imgAni.afbeelding.x = -175;
imgHolder.imgAni.afbeelding.y = -175;
imgHolder.reflect.afbeelding.x = -175;
imgHolder.reflect.afbeelding.y = -175;
imgArray.push(imgHolder);
}
}
Second problem is that the loaded image don't seem to get the properties width and height. I need them to correct the placement of the images more to the center, since they have different sizes. For now I just place their x and y value on -175.
Grtz
Check If BOTH Images Have Loaded
I'm using below code to load two images in two seperate movieclips. I want the rest of the animation to start when BOTH images have been loaded into the movieclips. How do I do that? I know it's with onLoadInit, but that would make ik start when 1 clip has been loaded.
Code:
stop();
//load images in container
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.loadClip("image1.jpg", imageclip1);
mcLoader.loadClip("image2.jpg", imageclip2);
//
//add listener object
var loader:Object = new Object();
mcLoader.addListener(loader);
//
//check if images have loaded
loader.onLoadInit = function(mcLoader){
gotoAndPlay(2);
}
Images Loaded But Not Showing
I have an application in three steps: The first is a global one that will contain the two others. The second is a list of products which are shown as images. When you click on one of thoses images, it loads the third one which contains the details for the product in question. My variables used in the third one are section, subSection and product. section is the main menu from which it comes, subSection is the subMenu from which it comes from and the product is the image clicked on the second section.
Example: The first item of the main menu is called "Men". The first submenu of that main section is called "Masters" and in that section you click on the first coat. So section=1, subSection=1 and product=1.
Now when I load the third flash directly from the first one without going through the second one and by giving it the right value for the right variables, it loads the right text but no images are shown. But it sees the path for the image and you can click on them but you can't see them.
What gives?
Sorting Xml Loaded Images
I'm trying to create an image gallery that reads data from an xml file and uses check boxes to filter what get displayed.
Crude as it is, my script loads the images into rows and columns, but creates "spaces" where image data has been "filtered out".
When filtered, I want the loaded images to be displayed without spaces between them.
Can anyone help me please?
Centering Loaded Images
I've been making a modified version of the Dynamic JPG image loader thing that comes with Flash MX I've got it loading captions in from a loaded textfile and then I'm pulling the captions I need from an array.
Basically I'm having a great time until.... I started pulling in pictures of that were both Landscape and Portrait in format. The problem is that they always load in the top Left corner of the clip I'm loading them into. I understand this is because of the "zero" point and the fact that the data loads into positive x and y co-ords. Is there a way to make portrait and landscpe pics load so that their center point are in the same spot regardless of the image size?
Did I explain that correctly....?
Thanks in advance,
Rupert
Switching XML Loaded Images?
I have this script:
ActionScript Code:
// Load Details for Main Page
function loadDetails(xml, n) {
details_mc.eventName = xml.childNodes[n].childNodes[0].firstChild;
details_mc.eventOpener = "w/" + xml.childNodes[n].childNodes[1].firstChild;
if (details_mc.eventOpener == "w/null") {
details_mc.eventOpener = "";
}
details_mc.eventLocation = xml.childNodes[n].childNodes[2].firstChild;
details_mc.eventTime = xml.childNodes[n].childNodes[3].firstChild;
details_mc.eventDate = xml.childNodes[n].childNodes[4].firstChild;
details_mc.eventPrice = xml.childNodes[n].childNodes[5].firstChild;
poster_mc.loadMovie(xml.childNodes[n].childNodes[6].firstChild);
gotoURL = xml.childNodes[n].childNodes[7].firstChild;
}
and I am just trying to get it to switch the data and image on the stage from what I loaded originally. It works for the data but when it gets to the image it tells me this:
Quote:
*** Security Sandbox Violation ***
Connection to file:///Macintosh%20HD/Users/bdpmutli/Sites/BDP/undefined halted - not permitted from http://bdp.uwstout.edu/images/posters/none.jpg
-- Remote SWFs may not access local files.
Anyone know why right off hand?
Thank you!
EDIT: Posting this I might have seen the problem. I will play with it and and keep checking back here. Thanks.
Images From XML Are Being Loaded Backwards
The clip should be loading from left to right. At first it did but the function that imports the images "makeAThumb" was changed so the images would fade in.
Now it loads from right to left. weird.
here's the file's code:
Code:
***************import classes***************/
/*********declare variables and instances*******/
var nextX = 0
/****************create objects**************/
var xmlPhotos:XML = new XML();
var initThumb:Object = new Object();
/****************handle events**************/
xmlPhotos.onLoad = function() {
for (var i:Number = 0; i<xmlPhotos.firstChild.childNodes.length; i++) {
initThumb.photo = (xmlPhotos.firstChild.childNodes[i].attributes.photo);
makeAThumb(i);
nextX += 360;
}
};
/******************functions****************/
function makeAThumb(num) {
thumbName = "mcThumb"+num;
var thumbClip:MovieClip = mcScroller.attachMovie("advLoaderHolder", thumbName, num, initThumb);
thumbClip.onEnterFrame = function(){
this.BJCAdvLoader.load ("images/"+thumbClip.photo+".jpg");
delete this.onEnterFrame;
}
thumbClip._x = nextX;
}
/****************set properties**************/
xmlPhotos.ignoreWhite = true;
/******************run now*****************/
xmlPhotos.load("beautyphotos.xml");
this.createEmptyMovieClip("mcScroller", this.getNextHighestDepth());
any one have ideas?
Alan
Loaded Images Not Centered
I have two problems that may beable to be answered in one swoop...
I created a simple slideshow that loads images from an external XML file. The problem is each image is a different size and I want every loaded image to always br centered, which thay are not. How can I get each image to load centered instead of to the right of the placeholder?
Also, since thumbnails are many different sizes they have wierd spacing. By defult I set the set "var thumb_spacing = 105;" . Is there any way the spacing can always be equal without changing the size of the thumbnail?
*.FLA and XML FILE ATTACHED*
MovieClip And Loaded Images
Hello all.
I have a movie clip with three frames. Each frame has an image loaded using loadMovie. The problem is, when I change the frame, the image I have loaded is not there, and when I switch back to the original frame, the image I loaded there is gone. Is there a better way to do this, or a fix for it?
Thanks in advance.
Resizing Mc Loaded Images
Hi
I need for an image that loads to an mc to be resized to the size of the mc while keeping proportions . the images are loaded by users so the image name is always different.
this is the code that loads the image i guess I just need the part of the code that resizes it.
this code is on the same frame that the mc is on the timeline:
Code:
stop();
if (_root.contenturl1 == "") {
loadMovie("img1" add _root.zimgpage add ".jpg", "img1");
} else {
loadMovie(_root.contenturl1 add "/" add _root.userid add "/img1" add _root.zimgpage add ".jpg", "img1");
}
the movie publishes in flash player 6 and is actionscript 1.0
Please any help with this is appreciated.
Loaded Images Not Showing Up
so i've got a collection of images loaded via an xml file. it works just fine locally but when i upload it.. all of the sudden it's loading only the beginning 3 images as opposed to all of them. i'm at a loss for words. i got it working then it pooped on me.
ActionScript Code:
var intCounter:Number = 0;
for(var t:Number = 0; t < how_many; t++)
{
boxes[t] = new MovieClip();
addChild(boxes[t]);
loaders[t] = new Object();
loaders[t].loading = new Loader();
loaders[t].theRequest = new URLRequest(myXML.image[t].big_url[0]);
loaders[t].loading.load(loaders[t].theRequest);
loaders[t].loading.contentLoaderInfo.addEventListener(Event.INIT, imgLoaded);
}
function imgLoaded(event:Event):void
{
loaders[intCounter].loading.content.y = 0 - (loaders[intCounter].loading.content.height / 2);
loaders[intCounter].loading.content.x = 0 - loaders[intCounter].loading.content.width / 2;
boxes[intCounter].addChild(loaders[intCounter].loading.content);
intCounter++;
}
Dispose Loaded Images
Hi,
I wrote a flash photo viewer using actionscript 3.0. There is a sprite called pic_container containing say 10 images. When the user clicks the button for "next page", the code loads the next 10 images using a loader object. But before loading I remove the current 10 images with:
while (pic_container.numChildren) pic_container.removeChildAt(0);
During runtime I monitor the RAM consumption and I see that when I click "nextPage" the consumed RAM increases. When I click "nextPage" again it increases more. Also when I click "prevPage" the RAM further increases and the machine really has hard time.
This means that the images are not removed from the RAM when removeChild is used.
So how do I dispose the images from the RAM?
Thanks...
Loaded Images Appear Wierd
Hi i am currently working a website and i have some images that are loading in but when they load in they look completely wrong, i have programed the site so that the menu images for each menu item will vary each tim eit it loaded. the picture below is what the menu items should look like:
and here is what it actually looks like:
and this is the code for that section:
Code:
stop();
var thumbPathVar:String;//variable to store the thumbnail locations
ranImage = Math.floor(Math.random()*3) + ".jpg";
var loadedImage:Loader = new Loader();
var imageURLRequest:URLRequest = new URLRequest(thumbPathVar + ranImage);
loadedImage.load(imageURLRequest);
loadedImage.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
function imageLoaded(event:Event):void {
loadingTarget.addChild(loadedImage.content);//this tells the site were to load the thumbnail
}
//the code below sets the roll over effect for the buttons
invisBttn.addEventListener(MouseEvent.MOUSE_OVER, overButton);// this listens for a mouse over event by the name overButton
invisBttn.addEventListener(MouseEvent.MOUSE_OUT, outButton);// this listens for a mouse over event by the name outButton
function overButton(event:MouseEvent):void{
invisBttn.gotoAndStop(2);
}
function outButton(event:MouseEvent):void{
invisBttn.gotoAndStop(1);
}
Waiting Until All Images Are Loaded
Hello,
I have a function where I load multiple images using the Loader class and load() method. I don't want the function to exit until all the images have been loaded, or I want a way to know when all the images are loaded. Unfortunately, the load() method retuns immediately, and you have to use an event listener in order to know when an object has completely loaded (using contentLoaderInfo.addEventListener(Event.COMPLETE, func)). Is there a good way to do this?
Thanks.
Dynamically Loaded Images
Hi I have a problem with some images i've dynamically loaded into a flash Movie. For some reason the images look very poor. They are not scaled (at least not all of them). So i don't know what the porblem is. In the authoring environment they look perfect and once they are published tehy look like hell. Please help !
Cant Use DuplicateMovieClip() With Loaded Images?
I know its called duplicateMOVIEclip for something , but I thought that if I duplicate a mc with images loaded inside, they would alse be duplicated...
anyone has a solution other than reloading the image??
thanks!
Smoothing Loaded Images
How can I set the smoothing property on a loaded image in flash 8?
I'm using moviecliploader to bring them in, but now I don't know what to do. The help only refers to smoothing on the attachBitmap section, but this is not what I want, and it seems to be only for stuff loaded from the library.
Dynamically Loaded Images
hi,
i am loading jpegs from an external folder into separate movie clips on the stage. this works fine. however, due to the structure of the movie, i need to attach these loaded clips to another movie clip which exists further along the timeline.
when i try to do this, nothing happens and tracing for the movies returns undefined.
does anyone know if this is because the jpegs are loaded dynamically?
e.g of loading jpeg:
loadMovie("content/design_1.jpg",im_holder1_mc);
and then later in the movie...
image01_mc.attachMovie("im_holder1_mc", "new", 300)
trace(im_holder1_mc.new); (returns undefined and the movie does not load)
anyone got any ideas?
many thanks,
lukemack.
|