-
Hi Flash World;
I'm trying to do one simple thing... I'm trying to load a picture and when this it's loaded I want to mask that loaded picture.
When I load the picture... for instance pressing a button and the next sentence is loaded_movie_image.setMask(myMask) it doesn't work... but if I create this button to load and another button to mask ... it works properly. I think the error is that if I write both sentences together the computer goes to the second and the picture isn't loaded yet. So... this is my question.... is it possible to know when a picture is loaded? or is it my error?
Thank you very much!!!
-
yeps,
you can build a preloader wich checks it , it works something like this ..
loadMovie("movie.swf","container",1) // load the movie inside container (a mc on stage)
first get the totalbytes of the movie:
total = container.getBytesTotal()
and then check in a loop( frameloop or onenterframe) how much is loaded and to be loaded :
loaded = container.getBytesLoaded()
if(loaded>=total) gotoFinish()
You could check out the movies section for a preloader
succes Nyls
-
thank you!!!
Hi again,
Thank you very much for your quick answer and the last thing... you said something about preloaders in movies section.... but what's the sub section because I'm not able to see it :-)
-
I've seen it....
I've seen it.... ok.... so thank you
-
Originally posted by nyls
yeps,
you can build a preloader wich checks it , it works something like this ..
loadMovie("movie.swf","container",1) // load the movie inside container (a mc on stage)
first get the totalbytes of the movie:
total = container.getBytesTotal()
and then check in a loop( frameloop or onenterframe) how much is loaded and to be loaded :
loaded = container.getBytesLoaded()
if(loaded>=total) gotoFinish()
You could check out the movies section for a preloader
succes Nyls
Don't forget to also go to finish if getBytesTotal() eq -1
In that case the file isn't there...stolen, wrong name etc.
-
myImageHolder = new MovieClip();
myImageHolder.loadMovie("image.jpg");
myImageHolder.onData = whatever.... //loading has started
myImageHolder.onLoad = whatever.... //loading has finished
-
Originally posted by dave toland.com
myImageHolder = new MovieClip();
myImageHolder.loadMovie("image.jpg");
myImageHolder.onData = whatever.... //loading has started
myImageHolder.onLoad = whatever.... //loading has finished
you're right, what am i doing in the mx forum..?
-
it doesn't work!!!
Hi again... I'm fighting with it... but I'm not able to know when a picture is loaded and when it isn't...
Please.... could someone send me an easy and short example of this working properly?
Please I needed desperately!!!
-
Originally posted by dave toland.com
myImageHolder = new MovieClip();
myImageHolder.loadMovie("image.jpg");
myImageHolder.onData = whatever.... //loading has started
myImageHolder.onLoad = whatever.... //loading has finished
did you try that??
-
I,ve tried getting that to work but nut succeeded .
I,ve been having the problem that when I load a picture inside a movieclip the methods not seem to work .. so I loaded it inside a container and It worked ..
I think I,m doing something wrong .. so any help would be appreciated .. underneath is my code wich works .. but I rather use the new Movieclip() .... but for me it seems that when there is not really a real "movieclip" invalved I can't get it to work for example:
Code:
myImageHolder = new MovieClip();
myImageHolder.onEnterFrame = function() {trace("test")}
does nothing !! but the
following does
Code:
this.createEmptyMovieClip("container",1);
this.container.loadMovie("receptie.jpg");
this.init = false;
this.onEnterFrame = function(){
this.loadedBytes = this.container.getBytesLoaded();
if (this.loadedBytes>0) {
if (!this.init) {
this.totalBytes = this.container.getBytesTotal()
this.init=true
}
this.percentage=Math.floor(this.loadedBytes/this.totalBytes*100);
if(this.percentage==100) {
this.onEnterFrame = null;
this.finished()}
}
else {
this.percentage=0
}
}
this.finished = function(){}
If anyone could shine some light I would be thankfull..
Nyls
-
Yes I tried this way... about onData and so on... but it doesn't work.... post or send me an example, please!!! I'm going mad!!! :-)
-
You have to read and look !! I posted an example !!!
Code:
this.createEmptyMovieClip("container",1);
this.container.loadMovie("receptie.jpg");
this.init = false;
this.onEnterFrame = function(){
this.loadedBytes = this.container.getBytesLoaded();
if (this.loadedBytes>0) {
if (!this.init) {
this.totalBytes = this.container.getBytesTotal()
this.init=true
}
this.percentage=Math.floor(this.loadedBytes/this.totalBytes*100);
if(this.percentage==100) {
this.onEnterFrame = null;
this.finished()
}
}
else {
this.percentage=0
}
}
this.finished = function(){ }
-
have a look here:
its like the webcam viewer for webcam32, sitecam or coolcam works. but you have to remove the unload movie and set up an array inst of loading the same pic!
http://board.flashkit.com/board/show...7&pagenumber=3
cheers
http://www.symbionts.de
-
ok, heres a well easy way.
drag an instance of the UI2 component 'FProgressBar' onto the stage and call it 'myBar', create an empty movie clip called myHolder:
myHolder.loadMovie("http://www.chapter3.net/imgs/hori/wjdg_01.jpg", 1);
myBar.setLoadTarget(myHolder);
[Edited by dave toland.com on 06-12-2002 at 09:51 AM]
-
Originally posted by dave toland.com
ok, heres a well easy way.
drag an instance of the UI2 component 'FProgreeBar' onto the stage and call it 'myBar', create an empty movie clip called myHolder:
myHolder.loadMovie("http://www.chapter3.net/imgs/hori/wjdg_01.jpg", 1);
myBar.setLoadTarget(myHolder);
dear Dave,
You know why this is not working (seeing my post above ??)
myImageHolder = new MovieClip();
myImageHolder.onEnterFrame = function() {trace("test")}
and this is:
myImageHolder = createEmptyMovieClip("container",1);
myImageHolder.onEnterFrame = function() {trace("test")}
thnx in advange ..
Nyls
-
myImageHolder = createEmptyMovieClip("container",1);
myImageHolder.onEnterFrame = function() {trace("test")}
what you are doing here is creating a function called 'onEnterFrame'.
you need to call it.
onEnterFrame();
what exactly are you trying to do anyway? if you want to display a preloader for the image you are loading use the example i have just posted above
-
no problems with anything .. just trying to figure stuff out ..
when I paste this in FlashMX.. it's tracing non stop ..
Code:
myImageHolder = createEmptyMovieClip("container",1);
myImageHolder.onEnterFrame = function() {trace("test")}
what I don't understand is why
Code:
myImageHolder = new MovieClip()
myImageHolder.onEnterFrame = function() {trace("test")}
isn't doing the same thing ??
Because I thought that both createMC and new MC are to instantiate Movieclips ..
Nyls
ps I've done a new post with this Question, no need to bug the other guys who posted here ..
-
Senior Member
I know this works:
Code:
//function to preload one slide
function loadSlide (slide) {
_root.slideHolder.loadMovie(slide);
_root.createEmptyMovieClip("loader", 1);
_root.loader.onEnterFrame = function() {
var loadedBytes = _root.slide.getBytesLoaded();
var totalBytes = _root.slide.getBytesTotal();
if (loadedBytes == totalBytes) {
this.removeMovieClip();
}
}
}
//function to preload a series of slides
function loadAll(firstSlide,lastSlide,slideName,introSlide) {
i = firstSlide;
while (i <= lastSlide) {
_root.loadSlide(slideName + i + ".jpg");
_root.loadSlide(introSlide);
i++;
}
}
You can see it working:
http://geocities.com/cooldood47_2000...lide_show.html
-
THANK YOU!!!!
Thank you to everyone!!! Finally mixing something from your code and knowing what I wanted to do I've been able to do it.... thank you and a million more thankx because I thought I was going by a wrong way but now it's done.
-
Senior Member
thecrow556,
let us know!!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|