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
flash AS random frame

 
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 -> Client-side
View previous topic :: View next topic  
Author Message
mirk051



Joined: 24 Mar 2006
Posts: 4

PostPosted: 24.03.2006 15:50    Post subject: flash AS random frame Add user to your forum ignore list Reply with quote

evo, zanima me kako da natjeram flash da mi starta svaki put sa drugog frejma...
imam komad skripte šta sam našo na netu, al jednostavno gotoandplay(FRAME) mi ne radi kad to stavim u frame script. Znači, ne želim da se to dogodi na klik na neki gumb, nego na prvom frejmu kad otvorim flash file....

[code]myArray = new Array(1,100,195,290,385,480,575,670,765);
Array.prototype.shuffle = function(){
for (i=0; i < this.length; i++){
this.push(this.splice(Math.floor(Math.random() * this.length), 1));
}
}
myArray.shuffle();
trace(myArray[1]);

gotoandplay(myArray[1]);

[/code]


bio bih i više nego zahvalan kada bi mi neko objasnio ZAŠTO ovo ne radi... :(
pokušao sam i stavit samo gotoandplay(frejm) znači da bude neki meni određeni frejm, ali svejedno ne radi. tako da nije do random broja....
Back to top
View user's profile Send private message
blackduke
mi3.crew


Joined: 08 Sep 2003
Posts: 2681
Location: Zagreb

PostPosted: 24.03.2006 16:27    Post subject: Add user to your forum ignore list Reply with quote

pa ja bi to ovako nekako.. ako sam dobro shvatio.

Code:
myArray = new Array(100, 200, 300, 400);

goto_rand = function() {
   i = random (myArray.length);
   trace (i + '/ ' + myArray [i]);
   gotoAndStop (myArray [i]);
}

goto_rand();

stop();


ima i ljudi koji znaju flash puno bolje od mene, al dok se oni ne java, ovo ti isto funkcionira.
kopiraj kod u prvi frejm, a unutar arraya stavi frejmove koji ti ulaze u to random polje, znaci na koje sve moze on ic.
Back to top
View user's profile Send private message Visit poster's website Twitter profile
mirk051



Joined: 24 Mar 2006
Posts: 4

PostPosted: 24.03.2006 16:40    Post subject: Add user to your forum ignore list Reply with quote

fala na pomoći, ali ima jedan problem. ne radi. isto je. tj. zaboravio sam napomenuti da i u onom mojem slučaju radi na pola. tj. random me šalje na prvi sljedeći u arrayu... neovisno o random... znači, ako mi je sljedeći 100. frejm, tamo ide... i to svaki put. od tamo kreće...

neznam dal sam jasno objasnio... uglavnom, počinjem sumnjat da je i do flasha :D
Back to top
View user's profile Send private message
blackduke
mi3.crew


Joined: 08 Sep 2003
Posts: 2681
Location: Zagreb

PostPosted: 24.03.2006 16:44    Post subject: Add user to your forum ignore list Reply with quote

al. radi. probo sam. stavi to u flash i stici ctrl enter i vidices da ono sto ti on tracea neide po redu. znaci gledaj output polje. radi.
Back to top
View user's profile Send private message Visit poster's website Twitter profile
mirk051



Joined: 24 Mar 2006
Posts: 4

PostPosted: 24.03.2006 16:48    Post subject: Add user to your forum ignore list Reply with quote

gle, ne radi ;)
trace je u redu. to radi. nema problema... samo gotoandstop ne radi..... :(
ne odvede me uopće na taj frejm... nego na 100.

edit.
mogu ti na mejl poslat .fla?
Back to top
View user's profile Send private message
blackduke
mi3.crew


Joined: 08 Sep 2003
Posts: 2681
Location: Zagreb

PostPosted: 24.03.2006 16:59    Post subject: Add user to your forum ignore list Reply with quote

mirk051 wrote:
gle, ne radi ;)
trace je u redu. to radi. nema problema... samo gotoandstop ne radi..... :(
ne odvede me uopće na taj frejm... nego na 100.

edit.
mogu ti na mejl poslat .fla?


gle
ne vodi te na TAJ frejm nego na 100, pa da, moras zamjeniti 100 sa svojim frejmovi
znaci
mroa bit

Code:
myArray = new Array(myfirstfram, mysecondframe, mythirdframe, myfourthframe, myxframe);


al ajde, ako ti neide stvarno sibni na mail.
Back to top
View user's profile Send private message Visit poster's website Twitter profile
mirk051



Joined: 24 Mar 2006
Posts: 4

PostPosted: 24.03.2006 17:01    Post subject: Add user to your forum ignore list Reply with quote

ma ne. 100. frejm je i meni u arrayu, samo na 2. mjestu (1. od nule)
tak da bilokoji random broj izvuče (sve lijepo piše u traceu, i sve je uredno tamo) on svejedno ide na 100. frejm.... :(

aj daj mejl da šaljem. ak ti se da ......
thnx
Back to top
View user's profile Send private message
blackduke
mi3.crew


Joined: 08 Sep 2003
Posts: 2681
Location: Zagreb

PostPosted: 24.03.2006 17:26    Post subject: Add user to your forum ignore list Reply with quote

imas gumb email :) stisni!
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 -> Client-side 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