Load Dynamic Pics To MovieClip
Hi Everyone
I'm trying to load dynamic pics to movieClip and that's the action: onClipEvent (load) { loadMovie ("1.jpg", "_root.place"); }
I dont get any error massage and if i load the pic out of the movieClip, it works.
is it posible to make it?
Thank's
Ofir
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-04-2005, 05:49 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Sometimes Embedded Pics And Dynamic Text Does NOT Load
Here is my little site: here
(yes i know it isn't complete and i copied the design )
Sometimes after the preloader, the site doesn't display the pictures that are embedded nor does it load the dynamic text. This doesn't happen all the time, just maybe 1 out of 10. So does anyone know what is happening?
Thanks for your time.
Dynamic Load Pics In Photo Album?
Hi all,im using the photo album form iparigrafika.com.
I cant seem to figure out how to load the photos from an external source(on the server).
Ive used it before but i have always imported the pics into the fla.
anyone know how this is done?
Xml Pics Into Dynamic Movieclips... To Load Images...?
Can anyone help me please...I'm new to xml and flash integration.... so please bear with me!
I'm calling in images from xml like so....
Code:
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
The image paths are appearing in the output window via a trace. So that bit works.
I cant get them to load into the movieclips generated to hold them.
Code:
while (Number(n)<_root.no_ofpics) {
n = Number(n)+1;
bn = "button" add n;
duplicateMovieClip("button", bn, n);
setProperty(bn, _x, Number(getProperty(bn, _x))+Number(n*(getProperty(bn, _width)-12)));
//for (var i = picsroot.firstChild; i != null; i=i.nextSibling) {
bn = attachMovie (bn add ".n", "bn" + count, depth ++, {} );
somehow...load images!?!
How should i be expressing the load in this case?
bn[n].loadMovie.image[i];
or
"bn" + count.loadMovie(image[i]);
or even
loadMovie("images/image"+n+".jpg", bn add ".blank" );
or similar?!?
this is bending my brain!
Dynamic Pic Loader From Scrolling Pics Doesn't Load - Please Help
Could someone please help me at getting this scrolling picture gallery to load the pictures dynamically from the button pics I've placed inside of it, so that the higher resolution pictures intended for the loader will load in dynamically. I can't figure out where it's not working correctly.
thanks.
File link is here:
http://www.johnmichaelpendley.com/fl...picloader2.fla
Dynamic Loading Pics And Variables?how To Change Pics Depending On Buttons Or Text
i want to load jpegs into a swf dynamically. I saw a post confirming u can do it w/load movie script. Heres my question:
first off: in the folder w/my movie, i have jpegs labeled
1-9
in the movie, when someone presses a button, var x is changed to the corresponding number, 1-9
what i want is to place this variable inside the loadmovie somehow so depending on the button pressed a new img loads
i dont wanna type out long if then statements seeing as how this will quickly extend to about 1-400.
im kinda brain dead rite now, whats a dynamic way of gettings imgs with relatively short, versatile code
Load External Swf Into Dynamic MovieClip...
The pain of using AS3 is driving me to despair.
I have loaded an external swf into my main.fla.
I can display the loaded swf onto the stage by using addchild(evt.target.content);
However what I can’t do is add the loaded swf to a dynamically created movieclip and then position this on stage.
When I try:
newMovieClip = evt.target.content;
I get no script errors however I get the following compile error:
Error # 1034: Type Coercion failed: cannot convert flash.display::AVI1Movie@1de3a641 to flash.display.MovieClip
OOOOOOOOOOOOOooooooooo, someone please help!
Load Dynamic Image Into Movieclip
I have a movieclip that I would like to load an image into. I can't even get it to load just a normal image...with, for example: test_mc.loadMovie("http://www.trpsearchit.com/images/hw3image/hourly_KROC_rochester_ny_us_010066_ffffff_50035447 20.png");
That was just for test purposes, what I really want it to do is process this: "http://www.trpsearchit.com/cgi-bin/weather/trpweather.cgi?forecast=hourly&pands=14626&config= png&alt=hwicc&hwvttf=&daysonly=1&hwvbg=010066&hwvt c=ffffff&hwvusettf=0"
I was thinking it would have to be in an IF statement, that when (loaded) then take the URL that it returns and have the movieclip load it. The test link (the first one) is the what the server processes when you type in the second link in your browser.....
I was messing around with it for a few hours with no luck, can anyone help?
Thanks!!
-TJ
[F5] Loading Only The Pics I Want To Load
i have some thumbnails of pics and i want to load the big pic of that thumbnail.
i have the thumbs on let's say frame 3.
thumb 2 directs to frame 9.
on frame 6 is also a big pic.
if i use framelabels, can i show the pic i want (on frame 9) without forcing the user to load the pic on frame 6?
thanx
Efficient Way To Load Pics
what is considered the most efficient way to load pictures?...meaning do i just make them a symbol and such or is there another way to load them as to cut down on file sizes..
Load Pics Into Photoscroller 1.0
How should I do this. I was thinking of doing it with xml and then when I have them with for to create the photos_mc. But now this is the problem. I can't think of way to load the pics and then to place them in the movie dynamically.
Please help me
Attatch Or Load Pics?
Hi -
So sorry; it's sort of a preloader-related question! [arrgh]
Newbie pic gallery with fading-out of larger images from btn. t-nails...
When I tried attatch and used the big pics as m. clips, got the
Useless Preloader syndrome since it takes so long for all to load in fr. #1.
Now I'm loading external .jpg's instead - which is great for the files sz., and
thus I no longer need the movie preloader - but I don't have the same
control that attatch offers with init object. [Where I can set specific _x,
_y values for the pic.]
1. Is there a way to control where a loaded movie is placed into its container? [Aside from the reg. pnt.]
2. If I ever decide to use lovely, fat images over 100kb, how could a preloader be used with them? [In _root, on the mc they're loading into, or place them into sep. .swf's or wha??]
Any guidance would be super,
El
Load Pics Problem
Hi
Is it possible to load pictures from xml into two different container.mcs, in order to have a picture in normal size and scaled version as thumb at the same time?
I tried like this, but it does not work, i get the error "nan".
PHP Code:
spacing = 10;
containerMC1._alpha = 0;
containerMC2._alpha = 0;
var pArray = new Array();
var tArray = new Array();
var kArray = new Array();
var mArray = new Array();
MovieClip.prototype.loadPic = function(pic,pics) {
containerMC1._alpha = 0;
containerMC2._alpha = 0;
cur = pic;
curr = pics;
this.loadMovie(pArray[pic]);
this.loadMovie(kArray[pics]);
this._parent.onEnterFrame = function() {
var t = containerMC1.getBytesTotal(), l = containerMC1.getBytesLoaded();
var m = containerMC2.getBytesTotal(), l = containerMC2.getBytesLoaded();
bar._visible = 1;
bar2._visible = 1;
per = Math.round((l/t)*100);
if (t != 0 && Math.round(l/t) == 1 && containerMC1._width != 0 , m != 0 && Math.round(l/m) == 1 && containerMC2._width != 0) {
var w = containerMC1._width+spacing, h = containerMC1._height+spacing;
var w = containerMC2._width+spacing, h = containerMC2._height+spacing;
border.resizeMe(w, h, pic);
bar._visible = 0;
bar2._visible = 0;
loadText.text = "";
loadText2.text = "";
delete this._parent.onEnterFrame;
} else {
bar._width = per;
bar2._width = per;
// gives the bar a max width 100. För att få 250 px t.ex: bar._width = per*2.5;
loadText.text = per+" % ";
loadText2.text = per+" % ";
}
};
};
MovieClip.prototype.resizeMe = function(w, h, pic) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
nav._x = Math.round(this._x-this._width/2);
nav._y = Math.round(this._y+this._height/2+spacing/2);
prevb._x = nav._x-5;
nextb._x = nav._x+this._width+5;
nextb._y = prevb._y=this._y-this._height/2;
picinfo._y = nextb._y-5;
picinfo.info.text = tArray[pic];
picinfo._x = border._x-picinfo._width/2;
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
containerMC1._x = this._x-this._width/2+spacing/2;
containerMC2._x = this._x-this._width/2+spacing/2;
containerMC1._y = this._y-this._height/2+spacing/2;
containerMC2._y = this._y-this._height/2+spacing/2;
containerMC1._alpha += 7;
containerMC2._alpha += 7;
if (containerMC1._alpha>90,containerMC2._alpha>90) {
containerMC1._alpha = 100;
containerMC2._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild;
for (var i = 0; i<gallery.childNodes.length; i++) {
tArray.push(gallery.childNodes[i].attributes.title);
pArray.push(gallery.childNodes[i].attributes.source);
kArray.push(gallery.childNodes[i].attributes.title);
mArray.push(gallery.childNodes[i].attributes.source);
}
//loading first picture
containerMC1.loadPic(0);
containerMC2.loadPic(0);
} else {
title_txt.text = "Error!";
}
};
gallery_xml.load("gallery.xml");
prevb.onRelease = function() {
if (cur == 0) {
containerMC1.loadPic(pArray.length-1);
} else {
containerMC1.loadPic(cur-1);
}
};
prevb.onRollOver = function() {
if (curr == 0) {
containerMC2.loadPic(kArray.length-1);
} else {
containerMC2.loadPic(curr-1);
}
};
nextb.onRelease = function() {
if (cur == pArray.length-1) {
containerMC1.loadPic(0);
} else {
containerMC1.loadPic(cur+1);
}
};
nextb.onRollOver = function() {
if (curr== kArray.length-1) {
containerMC2.loadPic(0);
} else {
containerMC2.loadPic(curr+1);
}
};
Thanks for helping.
michey
ScrollPane Load Dynamic Movieclip Problem
I get stuck on this problem for long time and would like to ask all of you about this.
What I'm using is Flash MX 2004. I have a scrollpane (instance name: sp) and want to load a movieclip (instance name :mc, linkage name : mc_clip) which load different jpg file in runtime. The movieclip has been created in library. However, I fail to do this while I try the following code:
loadMovie("abc.jpg", "mc");
_root.sp.contentPath = "mc_clip";
_root.sp.refreshPane();
I wonder why the scroll bar appear but nothing appeared inside the scrollpane. I've included my .fla file here. Can anyone takes a look and helps me?
Dynamic Text Won't Load When Made Into Movieclip
I'm creating a music player that loads info from an external XML file. I'm using Flash8. I did this tutorial:
http://www.kirupa.com/developer/mx2004/maskfonts.htm because I need to scroll a prompt message that is masked.
And my problem isn't the mask (fonts are embeded it's fine) but the dynamic text is not loading from the XML file anymore. I think this is because in the tutorial the first thing you do is make the dynamic text field a movie clip. As soon as I do that the text data doesn't load from the external XML file. The code that previously worked was:
_root.prompt = this.firstChild.childNodes[1].firstChild.nodeValue;
prompt_txt.text = _root.prompt;
But now I made the dynamic text field prompt_txt a movie clip named prompt_mc and it doesn't load. So I realize now that prompt_txt lives inside prompt_mc but how do I get the text data from the XML file there???
How I Can Load Pics In Photoscroller Dynamically
I wonder how can I do this. I was thinking of getting them throught php and then to have them in flash and here appears the problem. How should I create the same movement that is in photoscroller when I load the images or how should i load them.
Gallery Not Wanting To Load More Than 17 Pics
hey guys, i have just posted an online photo gallery and its the kind that resizes to fit whatever photo you tell it to load. you can see it at :
www.creativejuggernauts.com/daniel
in anycase, my problem, is that for some reason when you try to load pics 018 - 030 they refuse to load, and i can't figure out why? any ideas? my .fla can be downloaded at www.creativejuggernauts.com/daniel/pics.fla
any help is appreciated!
How To Load Photos And Pics With Vars..
Hey all, I want to be able to load a pic in with the text useing Variables with html text but it doesn' t allow it at all. Is there a way to load a pic as a link next to text useing vars or no?
Gallery Not Wanting To Load More Than 17 Pics
hey guys, i have just posted an online photo gallery and its the kind that resizes to fit whatever photo you tell it to load. you can see it at :
www.creativejuggernauts.com/daniel
in anycase, my problem, is that for some reason when you try to load pics 018 - 030 they refuse to load, and i can't figure out why? any ideas? my .fla can be downloaded at www.creativejuggernauts.com/daniel/pics.fla
any help is appreciated!
Must Reaccess Page To Load External Pics
1. I must thank everyone's help in the forum for my success in loading the Total photonumber variable using LoadVars and captions from an XML file.
2. When tested locally on different computers to ensure that paths are correct, the mini pics load correctly.
3. However, once the files were posted to my website, you must access the page TWICE by first going to it, exiting, and when you RETURN to the same page, the mini pics are visible.
For example, you click on the topics button which brings you to another movieclip that contains the actionscript below:
All of the _global variables are defined in the maintime.
These 4 mini pics are loaded from an external directory. When you click on one, the big picture shows up.
Examples:
http://www.4themax.com/photogallery1.html -> WFUV (photos)
http://www.4themax.com/photogallery1.html -> Topics
http://www.4themax.com/photogallery1.html -> Topics -> clicking the big pic will take you to a portfolio page like one of the above.
======================================= THE CODE ====================================
//initialize variables and properties
big._alpha = 0;
//_global.WhichMainPic = 1;
//initiate change to new image when buttons are clicked
next.onPress = function() {
if (_global.WhichMainPic< _global.TP[foldnum] && !fadeIn && !fadeOut) {
fadeOut = true;
_global.WhichMainPic++;
input = _global.WhichMainPic;
}
};
back.onPress = function() {
if (_global.WhichMainPic>1 && !fadeIn && !fadeOut) {
fadeOut = true;
_global.WhichMainPic--;
input = _global.WhichMainPic;
}
};
_root.onEnterFrame = function() {
// when a new Photo is selected, fade out, load new image, and fade in
if (big._alpha>10 && fadeOut) {
big._alpha -= 10;
}
if (big._alpha<10) {
loadMovie(_global.PhotoFolder+"0/"+_global.WhichMainPic+".jpg", "big");
fadeOut = false;
fadeIn = true;
}
if (big._alpha<100 && fadeIn && !fadeOut) {
big._alpha += 10;
} else {
fadeIn = false;
}
// limit input field
if (input>_global.TP[foldnum]) {
input =_global.TP[foldnum] ;
}
// initiate change to new image when Enter key is pressed
if (Key.isDown(Key.ENTER)) {
fadeOut = true;
_global.WhichMainPic = input;
}
};
// if a number is entered in the input field but Enter is not pressed, change
// back to current Photo number when clicking anywhere else
//inputField.onKillFocus = function() {
input = _global.WhichMainPic;
//};
Xml-gallery Doesn´t Load Pics Online
HI!
Have got a strange problem. The xml-gallery from this tutorial site doesn´t load pictures online but functions locally. What can it be. I have everything in the same directory.
You can look at the problem at www.musikkapelle-ellboegen.at
It´s the button Cäcilienfeier2005 in the photo section.
Thanks a lot.
Evia
Flash 8: Dynamic Text Load To Movieclip, AS On Main Timeline
Looking to load dynamic text into a movieclip once my flv hits a particular cuepoint. onCuePoint code working fine, can load text dynamically if I keep it on the main timeline, but I need it to load into a specific movieclip.
Alternatively, I could load into the main timeline if I could then unload the text...
Attaching code--thanks for your help!
Attach Code
ns.onCuePoint = function(infoObject:Object) {
mytitle.text = infoObject.name;
if(infoObject.parameters.second_movie) {
modoneMC.gotoAndStop(2); //movieclip i'd like the text to load into
loadVariables("links.txt", TARGET);
fadeMC.gotoAndPlay(2);
Dynamic Pics
trying to load pics dynamicly, i know its a code thing i am missing.
Code:
loadMovie("images/nImage"+pcmn1+".jpg", "_root.frame.homec.hmpics.hpic"+picnum);
it works on the local machine, but when i post it live on the web, it doesnt work?
any clues what i am missing?
thanks in advance.
jeff
Dynamic Loading Pics
hi I need some help
I need to load some pics from a text file that in generated dynamic, so I don't know the number of the pics, but I know their size and how many will enter one page -9 - so next ones will be on the next page..
I attached a pic of the interface. at the botton is a button that will take u to the next page
can u give me some directions ?
thanx
Dynamic Text With Pics
I am making a scroll bar. This needs a Dynamic Text Box. My question is:
How can I have pics, have both bold and not bold text and have align: center/left/right in a Dynamic Text Box?
Random Dynamic Pics In A MC......
1. Is it possible.
2. Can any of you experts possibly help guide me to the right direction?
This is my site.
Now I'm VERY new at flash (one week hands on) so this site is still in the works.
I want to take that main picture of the band and randomize it dynamically to load a different picture everytime it loads. All while the picture is in a mc.
Any ideas?
This is not close to correct syntax, I'm just rambling.
I assume I would need to make Math.random() number 1 through n number of pics.
var picNum = Math.random(10) * 1;
then loadMovie(picNum, "target");
sound right? Any way easier?
________________________________
Also Any ideas/comments in General on the website would be great.
THx.
Regards
Yubin
Dynamic News With Pics Using PHP And Flash
Hello fellow Flashers,
ive been busting my brain trying to figure out this problem and i hope someone out there can help me. if all goes well, i will submit this in the tutorials section.
I want to show information from my mysql database into a Flash MX movie using PHP. ok, i got that down somewhat. The problem is loading the picture. in my database, i have the path to the picture. whenever flash tries to load the info for the pictures , something happens with the first picture....either that or all the pictures are "pushed back".
The text loads fine. In my example i have 7 entries in my news database: 7x headlines, 7x news text, and 6x pictures (the first one to be shown is not supposed to have a picture but all the others do). each entry is shown one at a time and you have to press on the up and down buttons to scroll between each entry.
here is my example that i have on the server...
the first picture, ok...there is no picture for that first entry. next...
the second picture...its supposed to be a picture of a blue swirl (but nothing comes up)
the third picture...its supposed to be of someone sitting infront of a computer (but the blue swirl comes up).
the fourth picture...its supposed to be of an atlas (but the persong sitting infront of the comp comes up).
the fifth picture...supposed to be a room full of people walking around (but its the atlas picture).
the sixth picture..supposed to be a hand holding a euro coin (but its the room full of people pic).
and the seventh picture..supposed to be of 4 or 5 people sitting in a small conference(view from above) (but its the hand holding the euro).
the pic of the people in the conference comes up when you press on the up button (going back towards the beginning of the list). see what i mean about all the pictures being pushed back? and i cant figure out WHY thats happening.
here is the fla file
if you need more info, just ask.
please help!
kat
Checking To See If Dynamic Pics Are Loaded
Hi gang,
Essentially what I'm hoping for is a little advice on the following problem:
Let's say I have a dynamic photo gallery. Okay, when a thumb is clicked, there is an animation of the current full iszed pic fading out, flying off, whatever. Then, there is the reverse animation of the new fullsized pic coming in. However, I want to be sure the new pic is loaded first. What is the best method? I've done some reading about attaching a listener, but I'm not really sure how that works, or even if it's any good.
Thanks a bunch.
Dynamic Loading Pics - Then Tween
hi all ya,
I am working on a project where I dynamically load a jpg into a movieClip and then motion tween it. Then I want to use the same tween, to load another jpg, so that it slides in front of the first and so on. My problem is that I can't load another jpg unless I have at least one keyframe at the end that does not contain the movieClip with the jpg. Is there a way to swap depths or levels of the first one, then copy it to another clip (without the picture flashing or having to reload) so that I can use the same tween for multiple jpgs??
I hope this doesn't sound to complicated. I messed around with
ActionScript Code:
MovieClip.duplicateMovieClip()
and
ActionScript Code:
MovieClip.swapDepths()
but I couldn't get any good results. Maybe this combination of tweening and scripting isn't such a good idea but I think it should work somehow...
Can anyone help? Thanx. S.
P.S.: the code I use to load the jpgs is generally something like this..:
ActionScript Code:
this.createEmptyMovieClip("myImage", myDepth);
this.myImage.loadMovie("PictureName"+myCounter+".jpg");
Loading Dynamic Pics With Links?/
Hello, this is a huge question so I don't expect any code snippets (but if you can, thanks), but maybe someone can point me in the right direction.
Lets say I have 20 pics that I want to load in 20 different text boxes dynamically... how do I do this? do I have to create the text boxes on the page first then utilize code to fill them... Is there a way to set it up so that if I change the total number of pics the code automatically creates the appropriate number of text boxes & places them where I want them?
Additionally, what if I want these text boxes to have an action on them so that when they are filled with the pics, if a user clicks on the text box - another bigger text box with a bigger image is filled with the appropriate item.. I hope this makes sense - can someone point me in the right direction?
-= Tricky Dynamic Question Pics + Text : =-
Hey, im in the midst of making my site, and i needed a scroll bar, so i came here.
i used "Small size scroll bar by Marco A. S. Souza" but totally revamped it, so really u couldn't tell.. (graphically)
anyways, the question i have is..
inside the dynamic text box where my text is scrolled, can i put pictures and links/buttons in there? if so.. HOW?
is there a way to do this? that isn't supa hard?
thnx in advance!
Setting Size To Dynamic Loaded Pics
Ok so I am loading jpegs dynamicly into a movie clip which is in my main timline but I need the jpegs to fit a certain size no matter how big they actually are..
So right now I have these actions applied to a button
on (release) {
loadMovie("21.jpg",_root.pic)
_root.pic._x=100;
_root.pic._y=150;
_root.pic.width = 20.2;
_root.pic.height= 500;
}
But for some reason my width and height are not correct.......
I don't know if the actions to set the size need to be on the movie clip or what
[F8] Problems Viewing Dynamic Pics On The Webpage
Hello!
I am in the middle of making an online portfolio in Flash 8 and have loaded the pics in dynamically from the xml file... this works fine when you do a test movie, but not when i have uploaded it to the net via the FTP. Does anyone have any suggestions as to why this might be?
All the files are in the same folder, all are jpegs saved for web, all are linked correctly as far as i can tell in the xml, and also i have uploaded all the files to the FTP, all the other pages can be viewed online but not the images. Anyone got any suggestions cos i am stuck on this one!
Thanks in advance to any responses. :-)
Dynamic Loading Of Pics In Various Sizes With Thumbnails
Hi!
I'll try to explain the problem, but it's kinda complicated.
OK, I have this external XML with url to jpgs and url to thumbnails respectively. I load them into temporary containers, as you would in a slideshow, and then I link the thumbnails to the pictures. The problem is, I create the links to the position/instance in the array where the picture is put. And, since a jpg at 500 kb is five times as large as one at 100 kb, and therefore will place itself later in the array, the array is totally f***ed up. Hence, the thumbnails will link to the wrong picture.
Basically, I want a way to load the pictures into the array once the actual data is loaded, not when the temp holder is created or when flash has FOUND the picture.
Once again, I want the order in the array to be 0,1,2,3,4,5 and not 4,3,6,1,2,3, but a simple sorting function doesn't work. Probably because I load all the pictures on the same time.
My guess is that I would have to create a stop or something to prevent the second image to start loading before the first is done, and so on. BTW, I use a MovieClipLoader...
How Do I Replace Pics In My Flash Template With My Own Pics?
Hi there! Ok, I've got this flash menu bar set up. The problem I've got is the fact that it's a template, and I'm not sure how to change those 4 little pictures of those male models at the bottom of the flash area. The ones that are spinning around every few seconds.
How do I set it so that it uses the pics I want, instead of those pics? I've figured out how to add the pics to the library, but it only adds them as bitmaps, and I don't know how to make them "graphics" and how to replace the current pics with them...
Can someone give me some advice on how to do this? I'm probably ging to need some pretty detailed help too... SOrry. I'm just really new to flash. I've read some tut's, but theyre not too helpful for what I want to do...
Thanks guys. My AIM is NoahPsych is anyone cares enough to help me by IMing me. That'd probably be best!
Thanks again!
Unknown Amt Of Dynamic Pics To Be Loaded And Shown In A Swf File
Hi,
ok, i would like to know first if this is at all possible:
i want to build at "news" section in a flash website for a customer of mine. i would build the template for it (where the text and pictures should go, etc) but my customer wants to be able to type up his own text and upload his own pictures. ok, i have the dynamic text going on (i know how to do that part) but how do i do the dynamic pictures part?
i want it so that i dont have to update the .swf that is supposed to load and show all these new pictures and all my customer has to do is upload whatever and who knows how many pictures he wants on to the server and it will be automatically called up into the .swf file when it is shown.
please let me know if this is at all possible and if it is, can you please help me in finding some kind of tutorial for that? ive been looking in the tutorial sections, but what i found on dynamic pictures is that they all knew how many pictures would be used, in my case i dont know how many pictures my customer wants to have on his news page.
thanks in advance!
kat
Loading Dynamic Thumbs/pics (attn: Scotty)
How would I get the first "pic" to show automatically? Since when the code runs, it only shows the thumbs first, until you click on one and then it loads the corresponding pic.
ActionScript Code:
/*The below works if the pictures and thumbs are in a folder "pics"the thumbs are named "thumb1.jpg" etc and the pictures "pic1.jpg" etcif you use other names, change it in the code as well;-))scotty(-: */var k = 0;//nr is amount of thumbsvar nr = 2;//gap is the gap between the thumbsvar gap = 10;//c is the amount of columnsvar c = 3;//set the original thumb invisiblethumb._visible = 0;//function to create the thumbsfunction createThumbs() { for (var i = 0; i<nr; i++) { //duplicate the original thumb duplicateMovieClip("thumb", "pic"+i, i); //give the copy a (more easy) name p = this["pic"+i]; //give the copy it's own identifier p.i = i; //set the x position of each thumb p._x = 300+((i%c)*(p._width+gap)); //set the y position of each thumb p._y = 350+((Math.floor(i/c))*(p._height+gap)); //set the actions for the thumb you can add rollover etc p.onRelease = function() { //load the pic in container , here you need the identifier;-)) container.loadMovie("pics/pic"+(this.i+1)+".jpg"); }; } //call the loadthumb function loadThumb(0);}function loadThumb(k) { //give the "container" inside the thumb a name mc = this["pic"+k].th_pic; //load the thumb mc.loadMovie("pics/thumb"+(k+1)+".jpg"); //set the thumb picture invisible mc._visible = 0; //create an emptymovieclip ab = this.createEmptyMovieClip("temp", 100); ab.onEnterFrame = function() { //if the thumb picture is fully loaded if (mc.getBytesLoaded() == mc.getBytesTotal() && mc.getBytesTotal() != 0) { //set the thumb picture visible mc._visible = 1; delete this.onEnterFrame; //if not all thumb pictures are loaded if (k<nr) { //call the nextthumb function //I've used a setinterval here cause the thumbs are very small //so the effect of consecutive loading is small as well //change the 300 to the value you like (300 is in msecs) delay = setInterval(nextThumb, 300); } } };}function nextThumb() { //increase the value k k++; //call the function loadthumb loadThumb(k); //clear the interval clearInterval(delay);}//call function createthumbs (to start it all;-))createThumbs();
Also, what would I have to change in order to load swf's as opposed to just the "pics"? I know it would involve changing this line of code....
ActionScript Code:
container.loadMovie("pics/pic"+(this.i+1)+".jpg");
Loading Dynamic Thumbs/pics (attn: Scotty)
How would I get the first "pic" to show automatically? Since when the code runs, it only shows the thumbs first, until you click on one and then it loads the corresponding pic.
ActionScript Code:
/*The below works if the pictures and thumbs are in a folder "pics"the thumbs are named "thumb1.jpg" etc and the pictures "pic1.jpg" etcif you use other names, change it in the code as well;-))scotty(-: */var k = 0;//nr is amount of thumbsvar nr = 2;//gap is the gap between the thumbsvar gap = 10;//c is the amount of columnsvar c = 3;//set the original thumb invisiblethumb._visible = 0;//function to create the thumbsfunction createThumbs() { for (var i = 0; i<nr; i++) { //duplicate the original thumb duplicateMovieClip("thumb", "pic"+i, i); //give the copy a (more easy) name p = this["pic"+i]; //give the copy it's own identifier p.i = i; //set the x position of each thumb p._x = 300+((i%c)*(p._width+gap)); //set the y position of each thumb p._y = 350+((Math.floor(i/c))*(p._height+gap)); //set the actions for the thumb you can add rollover etc p.onRelease = function() { //load the pic in container , here you need the identifier;-)) container.loadMovie("pics/pic"+(this.i+1)+".jpg"); }; } //call the loadthumb function loadThumb(0);}function loadThumb(k) { //give the "container" inside the thumb a name mc = this["pic"+k].th_pic; //load the thumb mc.loadMovie("pics/thumb"+(k+1)+".jpg"); //set the thumb picture invisible mc._visible = 0; //create an emptymovieclip ab = this.createEmptyMovieClip("temp", 100); ab.onEnterFrame = function() { //if the thumb picture is fully loaded if (mc.getBytesLoaded() == mc.getBytesTotal() && mc.getBytesTotal() != 0) { //set the thumb picture visible mc._visible = 1; delete this.onEnterFrame; //if not all thumb pictures are loaded if (k<nr) { //call the nextthumb function //I've used a setinterval here cause the thumbs are very small //so the effect of consecutive loading is small as well //change the 300 to the value you like (300 is in msecs) delay = setInterval(nextThumb, 300); } } };}function nextThumb() { //increase the value k k++; //call the function loadthumb loadThumb(k); //clear the interval clearInterval(delay);}//call function createthumbs (to start it all;-))createThumbs();
Also, what would I have to change in order to load swf's as opposed to just the "pics"? I know it would involve changing this line of code....
ActionScript Code:
container.loadMovie("pics/pic"+(this.i+1)+".jpg");
Dynamic Loaded Pics And Sounds Dont Work Properly After Upload
everything works fine when i test it in flash, but when i upload the files to the web, things get screwy. most of the sounds dont play at all and sometimes pictures wont display and sometimes the animation is choppy.
why do some sounds play while others do not?
is there a way to make sure a picture is loaded before letting it start its animation?
can you use duplicatemovieclip on an mc with a dynamic pic? it didnt work for me so i had to reload the picture into the copy which might be causing part of the problem.
any help much appreciated
Multiple Choice Componant Quiz Template With Pics And Dynamic Question Replacement.
Hi all,
I'm a programming-in-Flash-other-than-basic-stuff-newbie and would appreciate any help on a project I need done this week. I've been using the multiple choice quiz template. It's for an online pop trivia game using covers. Here's the basics:
You see three pictures and pick one of them. You are taken to a question about the cover. You answer it and your right or wrong choice tally starts. You are then taken to the "choose a cover from the 3 pics" screen again. Only this time the picture you have chosen is replaced by another picture so that there are the two pics that were up already that you didn't choose and 1 new one. You choose one of the 3 and answer it. The process continues for around 10 questions.
I'm thinking of a data pool of about 20 pics with each pic attached to one question which I can use the multiple choice componant for.
Any suggestions?
http://www.sircuss.com/test/otcquiztest.swf
thanks
sircuss
sircuss
[MX04] Duplicate Dynamic Movieclip Into Another Dynamic Movieclip...doesn't Work?
I've got a problem when I try to copy some movieclips into other movie clips.
With some code I loop trough a XML file and create a dynamic movieclip mcItemI.
Within the loop to create this mcItemI is another loop that duplicates mcSubItemK into mcItemI.
The problem is, that this isn't working right.
Duplicating mcItemI works fine, but when I duplicate mcSubItemK, I see that they are duplicated, because the appear somewhere on the screen.
I want to set the properties of this mcSubItemK but it doesnt work...
this is the code i use:
Code:
for (I=0; I<varTotalItems; I++) {
mcItemX.duplicateMovieClip("mcItem"+I, ItemDepth+100);
_root["mcItem"+I]._y = ItemPosY;
//Hoog de volgende positie en depth op
ItemPosY += 21;
ItemDepth += 1;
if (varSubItemAantal > 0){
SubItemY = ItemPosY + 9;
SubItemX = 3;
varSubItemParent = _root["mcItem"+I]._name;
for (K=0; K < varSubItemAantal; K++){
mcSubItemX.duplicateMovieClip(_root["mcItem"+I]["mcSubItem"+I+"_"+K], ItemDepth);
_root["mcSubItem"+I+"_"+K]._y = SubItemY;
_root["mcSubItem"+I+"_"+K]._x = SubItemX;
ItemDepth += 1;
SubItemY += 20;
varSubItemParent = _root["mcSubItem"+I+"_"+K]._name;
}
}
}
}
}
How To Load An External Text.txt Into A Movieclip Containing A Dynamic Text Box?
Hi Guys,
I can load text into a dynamic text box when it is on the main timeline.
But when I place the dynamic text box inside a movieclip, I can't get the text too load into the dynamic text box which is inside a movieclip.
Can anyone explain how to get "loadVariablesNum ("text.txt", 0);"
to load the text into a dynamic text box which is inside a movieclip.
How To Load Image Into Movieclip Inside Movieclip That Is Dynamically Created?
Hello Kirupa Cats!
I am building a menu from an XML file, and I'm cool with cyclying thru the xml data to create menu items.
For every menu item in my XML file, I'm using attachMovie to insert a movie clip called menuitem from my library into a movieclip called menuholder. This works no problem, my menuholder movieclip is poplulated with as many menuitem movieclips from the library as designated by the xml data.
However, inside the library movieclip called menuitem, I have another movieclip on its stage, called mc_menuImage. I want to load an image into that movieclip, and I'm taking the URL for the image from the XML data.
My problem is I can't seem to figure out how to fully identify the movieclip mc_menuImage to load the image. It may have something to do with the fact that the library movieclip is being loaded dynamically, but the movieclip inside the library movieclip exisits pysically on the stage. I don't know...here's the code I'm working with:
THE CODE:
var xmlMenu:String = "menu.xml";
menuholder = createEmptyMovieClip("menuholder", -1);
var xmlMenuData:XML = new XML();
xmlMenuData.ignoreWhite = true;
xmlMenuData.load( xmlMenu );
xmlMenuData.onLoad = function(loaded) {
if (loaded) {
var mImage:Array = new Array();
var mRootNode = this.firstChild.childNodes;
totalMenuItems = mRootNode.length;
// fill array
for (var i = 0; i<totalMenuItems; i++) {
mImage.push(mRootNode[i].attributes.menuImage);
}
}
//make the menu
for (var i = 0; i<totalMenuItems; i++) {
var menuitem = menuholder.attachMovie("menuitem", "menu"+i, i);
menuitem.id = i;
/* now here I thought I could just do this: */
menuitem.mc_menuImage.loadMovie(mImage[i]);
/* but that doesn't work... */
};
When I trace menuitem I get this: _level0.menuholder.menu0, _level0.menuholder.menu1, etc, so I figured the syntax menuitem.mc_menuImage would identify the movieclip inside menuitem, but to no avail. Maybe it has something to do with levels, I'm not sure...
So I don't know, any suggestions? Thanks so much!!!
|