PDA

View Full Version : mozilla displaying problems


cristi_tulcea
04-19-2005, 12:17 PM
a photo gallery. maybe it's not as2 code but the other code i use in the gallery won't work only in fp7, as2.
the site is http://www.work.ro/cristi/ralImageVue/
everithing is working fine except when i'm attempt to load the big picture. the way i do is:
-load the picture
-see his coordinates and dimensions
-center it: the middle of the picture is the middle of the free area left on the page.
-then center a black square under it.

on mozzila seems not to work every time, if you insist you'll see how showld be working and how it's working.
in explorer it's no problem.

incarca_poza_aici= the movie where is loaded the picture
rama=that black contour.
loader=a movie where it's a dinamic text preloader.
start_anim=a movie that animate the picture after it's loaded.


Code:

var distx = 280;


var disty = 245;


var margini_rama = 40;


loader._visible = false;


rama._visible = false;


this.onEnterFrame = function() {


if (can_get) {


trace("..........CAN GET............");


if (incarca_poza_aici.getBytesLoaded() != incarca_poza_aici.getBytesTotal()) {


trace("..........INCA INCARCA............");


loader.loader = String("Loader: "+Math.round(incarca_poza_aici.getBytesLoaded()/1000)+"Kb - "+


Math.round(incarca_poza_aici.getBytesLoaded()*100/incarca_poza_aici.getBytesTotal())+"%");


} else {


trace("..........SA INCARCAT............");


incarca_poza_aici._x = distx-incarca_poza_aici._width/2;


incarca_poza_aici._y = disty-incarca_poza_aici._height/2;


rama._visible = true;


rama._width = incarca_poza_aici._width+margini_rama;


rama._height = incarca_poza_aici._height+margini_rama;


rama._x = incarca_poza_aici._x-margini_rama/2;


rama._y = incarca_poza_aici._y-margini_rama/2;


start_anim.gotoAndPlay(2);


can_get = false;


loader._visible = false;





}


}


};



thanks in advance. i'll be very thankfull if you know whats the problem with mozilla. if you need can i extract only this part and save as fla to see more clear the code.

cristi_tulcea
04-19-2005, 06:01 PM
anyone?

blue_halo
04-19-2005, 08:15 PM
This seems to be a problem that a few others have run into (including myself), and unfortunately I have been unable to find out anything on the matter. If I find anything, I'll let you know, but it seems like we're both stuck on the same boat with this one.

cristi_tulcea
04-19-2005, 10:12 PM
the problem is that he is not able to find the width and height of the image after is loaded.
to write width and height on xml data it's not a good solution unfortunately.
i'm thinking to make a handler for the loader..., not onEnterFrame loop.

hope you'll find or i find something.

blue_halo
06-02-2005, 12:55 PM
I don't know if it helps, or if you've already found a solution, but this seemed to help me out. in my HTML, my header went something like this....

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

but I changed it all to just an "<html>" tag without the doctype stuff and my file seems to work fine for me now.

303 maddec
06-02-2005, 02:04 PM
Hi there,

if it's a loading problem, I already observed on Mozilla this behaviour with my Flash 6 loading routine and resolved it like that:

Just change this:

if (incarca_poza_aici.getBytesLoaded() != incarca_poza_aici.getBytesTotal() ) {


By that:

if (incarca_poza_aici.getBytesLoaded() != incarca_poza_aici.getBytesTotal()&&incarca_poza_aici.getBytesLoaded()>0 ) {


As far as I observed, it could be linked to the speed of Mozilla compared to the one of Explorer. Sometimes on Mozilla it could happen that:

.getBytesLoaded()=0 and .getBytesTotal()=0

--> if (incarca_poza_aici.getBytesLoaded() != incarca_poza_aici.getBytesTotal() ) is considered as false,
before you're loading really began.

This is the reason why we need to add a further && condition to our conditional statement so as if .getBytesLoaded (or .getBytesTotal) isn't equal to 0--> the loading is in process and you shouldn't anymore have this "random" unloading problem.

I've also observed, that some websites main loader aren't design to handle this bug! You certainly already look at a flashwebsite and have to refresh to watch it loading properly. It seems to be linked to that.

Maybe there's another explanation but this is what I found.

I hope this will help.

blue_halo
06-02-2005, 02:16 PM
Heh, looks like I've completely mis-read the problem. ^_^;;
Sorry about that. Glad you figured it out though.