Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
stageListener problem?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Flash
View previous topic :: View next topic  
Author Message
astolitu



Joined: 26 Jun 2004
Posts: 547
Location: Zagreb

PostPosted: 30.11.2005 19:58    Post subject: stageListener problem? Add user to your forum ignore list Reply with quote

imam ovo:

stageListener = new Object();
stageListener.onResize = function() {
razvuci();
}
Stage.addListener(stageListener);
razvuci = function() {
botun_1._x = Stage.width - Stage.width;
botun_2._x = Stage.width - botun_2._width;
botun_3._x = Stage.width - botun_3._width;
botun_3._y = Stage.height - botun_3._height;
botun_4._x = Stage.width - Stage.width;
botun_4._y = Stage.height - botun_4._height;
}

i sve se razvlaci kako treba, ali problem je u tome da kad se ucita, botuni nisu na svoj poziciji, tek ako se razvuce browser ili sta vec. neznam di radim gresku ali trebalo bi bit da su botuni na svojim polozajima cim se ucita flash

ako netko moze pomoc Smile

_________________
http://www.markobjedov.com/
Back to top
View user's profile Send private message Visit poster's website Twitter profile
astolitu



Joined: 26 Jun 2004
Posts: 547
Location: Zagreb

PostPosted: 01.12.2005 01:50    Post subject: Add user to your forum ignore list Reply with quote

evo rijesija sam ako ko zapadne u slican problem

znaci imam cetiri MC u cetiri kuta stage-a

onEnterFrame = function(){
naPocetnuPoziciju();
}
naPocetnuPoziciju = function(){
botun_1._x = Stage.width - Stage.width;
botun_2._x = Stage.width - botun_2._width;
botun_3._x = Stage.width - botun_3._width;
botun_3._y = Stage.height - botun_3._height;
botun_4._x = Stage.width - Stage.width;
botun_4._y = Stage.height - botun_4._height;
}
stageListener = new Object();
stageListener.onResize = function() {
razvuci();
}
Stage.addListener(stageListener);
razvuci = function() {
botun_1._x = Stage.width - Stage.width;
botun_2._x = Stage.width - botun_2._width;
botun_3._x = Stage.width - botun_3._width;
botun_3._y = Stage.height - botun_3._height;
botun_4._x = Stage.width - Stage.width;
botun_4._y = Stage.height - botun_4._height;
}

_________________
http://www.markobjedov.com/
Back to top
View user's profile Send private message Visit poster's website Twitter profile
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 01.12.2005 10:11    Post subject: Add user to your forum ignore list Reply with quote

hm..ne znam kako ti je promaklo...ali naPocetnuPoziciju() i razvuci() funkcije su ti identicne. Zasto ne zoves obadva puta istu?

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
Ivan Podrug - e1



Joined: 15 Apr 2005
Posts: 316
Location: Solin

PostPosted: 01.12.2005 12:13    Post subject: Add user to your forum ignore list Reply with quote

onEnterFrame je repetitivna funkcija i zauzima ti resource bezveze kad naPocetnuPoziciju() nije animirano.

možeš to izbacit i samo dodat na kraju svega
_root.onLoad = razvuci;

postavi funkciju prije deklariranja listenera. Te stvari znaju flashu bit problem kad ih ima malo više.

razvuci = function() {
botun_1._x = Stage.width - Stage.width;
botun_2._x = Stage.width - botun_2._width;
botun_3._x = Stage.width - botun_3._width;
botun_3._y = Stage.height - botun_3._height;
botun_4._x = Stage.width - Stage.width;
botun_4._y = Stage.height - botun_4._height;
}

stageListener = new Object();
stageListener.onResize = function() {
razvuci();
}
Stage.addListener(stageListener);
_root.onLoad = razvuci;
Back to top
View user's profile Send private message
astolitu



Joined: 26 Jun 2004
Posts: 547
Location: Zagreb

PostPosted: 01.12.2005 15:06    Post subject: Add user to your forum ignore list Reply with quote

Ivan Podrug - e1 wrote:
onEnterFrame je repetitivna funkcija i zauzima ti resource bezveze kad naPocetnuPoziciju() nije animirano.

možeš to izbacit i samo dodat na kraju svega
_root.onLoad = razvuci;

postavi funkciju prije deklariranja listenera. Te stvari znaju flashu bit problem kad ih ima malo više.

razvuci = function() {
botun_1._x = Stage.width - Stage.width;
botun_2._x = Stage.width - botun_2._width;
botun_3._x = Stage.width - botun_3._width;
botun_3._y = Stage.height - botun_3._height;
botun_4._x = Stage.width - Stage.width;
botun_4._y = Stage.height - botun_4._height;
}

stageListener = new Object();
stageListener.onResize = function() {
razvuci();
}
Stage.addListener(stageListener);
_root.onLoad = razvuci;


po svoj logici ovo bi trebalo radit ali ne radi

radi mi samo ako mu stavim :
_root.onEnterFrame = razvuci;

_________________
http://www.markobjedov.com/
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Ivan Podrug - e1



Joined: 15 Apr 2005
Posts: 316
Location: Solin

PostPosted: 01.12.2005 15:17    Post subject: Add user to your forum ignore list Reply with quote

ja radim u Flash8. Napravio sam prazan stage i stavio 4 MCa sa tvojim nazivima. Meni je radilo iz prve.
Back to top
View user's profile Send private message
astolitu



Joined: 26 Jun 2004
Posts: 547
Location: Zagreb

PostPosted: 01.12.2005 15:51    Post subject: Add user to your forum ignore list Reply with quote

ma radim i ja u flash8. Pokusaj .swf dignut preko cijelog monitora i onda ctrl+enter da se ponovo ucita kad je preko cijelog ekrana ili stavi taj .swf u browser na 100% pa onda vidi jeli ti radi?

_________________
http://www.markobjedov.com/
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Ivan Podrug - e1



Joined: 15 Apr 2005
Posts: 316
Location: Solin

PostPosted: 01.12.2005 16:23    Post subject: Add user to your forum ignore list Reply with quote

stageListener.onResize = razvuci();
(izbriši staro)

_root.onLoad = razvuci();

probaj sad
Back to top
View user's profile Send private message
astolitu



Joined: 26 Jun 2004
Posts: 547
Location: Zagreb

PostPosted: 01.12.2005 16:51    Post subject: Add user to your forum ignore list Reply with quote

Stage.align = "TL";
Stage.scaleMode = "noscale";
razvuci = function() {
//pozadina._width = Stage.width;
//pozadina._height = Stage.height;
botun_1._x = Stage.width - Stage.width;
botun_2._x = Stage.width - botun_2._width;
botun_3._x = Stage.width - botun_3._width;
botun_3._y = Stage.height - botun_3._height;
botun_4._x = Stage.width - Stage.width;
botun_4._y = Stage.height - botun_4._height;
}
stageListener = new Object();
stageListener.onResize = razvuci();
Stage.addListener(stageListener);
_root.onLoad = razvuci();

ako si ovo mislio, opet ne radi ovako

_________________
http://www.markobjedov.com/
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Ivan Podrug - e1



Joined: 15 Apr 2005
Posts: 316
Location: Solin

PostPosted: 01.12.2005 17:15    Post subject: Add user to your forum ignore list Reply with quote

sorry misstype.

stageListener.onResize = razvuci; //bez zagrada

kada pridjeljuješ funkcije, ako staviš zagrade funkcija se izvrši, a ako staviš bez zagrada, onda funkciju dodjeljuješ.

to je isto kao i stageListener.onResize = function() {
...pa je ovdje ispišeš...
}

ja probao, meni radi.
Back to top
View user's profile Send private message
astolitu



Joined: 26 Jun 2004
Posts: 547
Location: Zagreb

PostPosted: 01.12.2005 17:24    Post subject: Add user to your forum ignore list Reply with quote

ako mozes pejstaj ovdi cili kod jer meni ne radi, sa _root.onLoad = razvuci;

_________________
http://www.markobjedov.com/
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Ivan Podrug - e1



Joined: 15 Apr 2005
Posts: 316
Location: Solin

PostPosted: 01.12.2005 19:58    Post subject: Add user to your forum ignore list Reply with quote

Stage.align = "TL";
Stage.scaleMode = "noscale";
razvuci = function() {
//pozadina._width = Stage.width;
//pozadina._height = Stage.height;
botun_1._x = Stage.width - Stage.width;
botun_2._x = Stage.width - botun_2._width;
botun_3._x = Stage.width - botun_3._width;
botun_3._y = Stage.height - botun_3._height;
botun_4._x = Stage.width - Stage.width;
botun_4._y = Stage.height - botun_4._height;
}
stageListener = new Object();
stageListener.onResize = razvuci;
Stage.addListener(stageListener);
_root.onLoad = razvuci();
Back to top
View user's profile Send private message
astolitu



Joined: 26 Jun 2004
Posts: 547
Location: Zagreb

PostPosted: 01.12.2005 20:46    Post subject: Add user to your forum ignore list Reply with quote

ma jesi ti proba ovo u browseru, stavi tablicu i celiju na 100% ili sta vec na 100% i stavi .swf na 100% pa ce vidit da ne radi, radi samo sa _root.onEnterFrame....
ali hvala sve jedno-jer sam zahvaljujuci tebi smanjia kod Very Happy

_________________
http://www.markobjedov.com/
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Ivan Podrug - e1



Joined: 15 Apr 2005
Posts: 316
Location: Solin

PostPosted: 01.12.2005 21:15    Post subject: Add user to your forum ignore list Reply with quote

nema na čemu. prije odustajanja probaj ovo:

napravi novi film
napravi 4 MC i nazovi ih botuni (kako si ih nazva)
sredi publish settings da ti HTML generira u percentage i noScale
stisni F12

meni se sve skalira kako treba i kako je i u flashu.

razlozi radi kojih ti vjerojatno ne radi je to da se film nije učitao cijeli prije nego okineš onLoad resize. Ili to opali na kraju učitavanja ili čekiraj dok cijeli film nije učitan (a'la preloader)
Vjerojatno imaš toga nakrcanog pa on jednostavno "preleti" preko naredbe bez da je odradi (uvijet da je root učitan je FALSE).
onEnterFrame ti radi jer se okida svako 1/25 sec pa na kraju ipak film bude učitan. Ako već radiš tako, onda po reskaliranju izbriši taj event da ti ne zauzima više resource.

drugo mi ništa ne pada na pamet.
Back to top
View user's profile Send private message
astolitu



Joined: 26 Jun 2004
Posts: 547
Location: Zagreb

PostPosted: 05.12.2005 00:01    Post subject: Add user to your forum ignore list Reply with quote

ma evo radi sad onLoad trebalo je samo stavit u isti frejm Wink preletia sam ja prebrzo preko ovoga sta si napisa, flash bi onLoad okinija prije nego sto dodje do botuna...

tnx e1

_________________
http://www.markobjedov.com/
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Flash All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group