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
Random MovieClip properties

 
Post new topic   Reply to topic    mi3dot.org Forum Index -> Flash
View previous topic :: View next topic  
Author Message
ITS



Joined: 06 Feb 2008
Posts: 377

PostPosted: 05.05.2008 10:19    Post subject: Random MovieClip properties Add user to your forum ignore list Reply with quote

Molim pomoć , malo mi je hitno . Ako se nekom da, da mi malo objasni ili još bolje napiše skriptu za sljedeće:

treba mi skripta koja će na klik miša ispucati nekakav movie clip,ali s tim da su sljedeća njegova svojstva random- boja, širina ,brzina kretanja, smjer kretanja i transparencija!

molim vas da mi malo pomognete!

hvala svima unaprijed
Back to top
View user's profile Send private message Send e-mail
segen



Joined: 19 Dec 2006
Posts: 672
Location: ZG <-> ST

PostPosted: 05.05.2008 11:55    Post subject: Add user to your forum ignore list Reply with quote

Booom! Ima tu matematike.
Pa za klik na neki objekt i pokretanje nekog MC-a nije problem, ali ta svojstva tog MC-a bi trebala biti kodirana na njemu samome.
E sada, pogledaj:

Code:
nekibutton.onPress=functio(){
    loadMovie(nekiMC,0);
}


a taj MC bi trebao imati sličan kod samo prilagođen tvojim nazivima:
Code:
onClipEvent (enterFrame) {
_x = random(551);
_y = random(412);
_alpha = random(101);
myColor = Math.round( Math.random()*0xFFFFFF );
myColoredObject = new Color (_root.imetogMCa);
myColoredObject.setRGB(myColor);
}


ovo je sve onako ugrubo, neznam dali bi ovo samo funkcioniralo, treba vidit.
Probaj googl-at za ostale propertise.
Svakako bi trebalo napisat neku funkciju i stavit neki EventListener još al to je sad......

_________________
NEW ∞folija∞ Follow me
Ovaj svijet je samo varka!
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger Twitter profile
ITS



Joined: 06 Feb 2008
Posts: 377

PostPosted: 05.05.2008 16:26    Post subject: Add user to your forum ignore list Reply with quote

Hvala ti puno i ovo mi je pomoglo , javim ti kako stojim s tim i zašto mi to treba . Luda spika do jaja!
Back to top
View user's profile Send private message Send e-mail
ITS



Joined: 06 Feb 2008
Posts: 377

PostPosted: 06.05.2008 01:16    Post subject: Add user to your forum ignore list Reply with quote

e segen , aj pliz pomozi mi još malo....
sve je pet dobio sam šta sam htio.
Napravio sam mc koji se sa klikom duplicira i svaki puta mjenja svojstva: brzinu,debljinu,boju,transparenciju itd... ali on se kreće po x osi.

e sad meni treba isti takav na stageu ali da se kreće po y osi. Međutim nije tu zapelo nego u tome što mi treba da na klik miša random izabere jedan od ta dva mc-a s tim da ne prekida radnju onog prijašnjeg... razumiješ? Smile
Back to top
View user's profile Send private message Send e-mail
segen



Joined: 19 Dec 2006
Posts: 672
Location: ZG <-> ST

PostPosted: 06.05.2008 09:25    Post subject: Add user to your forum ignore list Reply with quote

prvo napravi Array u kojeg ćeš pobacat sve MC-e iz lib-a
Code:
mojArray = new Array("prvi", "drugi", "treći");

onda malo matematike
Code:
mojRandom = Math.floor(Math.random()*3);

onda ćemo trace-at da vidimo jel to to
Code:
trace(mojRandom);

onda na _root-u to sve on pobaca u neki container
Code:
_root.mojContainer.attachMovie(mojArray[mojRandom], moj, 1);

ovo će ti on sam pobacat, a sa klikom miša...

Code:

var _mc1:MC1 = new MC1();
var _mc2:MC2 = new MC2();
var _mc3:MC3 = new MC3();

var allMC:Array = new Array();

allMC = [_mc1, _mc2, _mc3];
function randomMC (event:MouseEvent):void
{
newMovieClip = allMC[Math.floor(Math.random() * allMC.length)]
trace(newMovieClip)
addChild(newMovieClip)
}

button.addEventListener (MouseEvent.CLICK, randomMC)


to bi trebalo radit

_________________
NEW ∞folija∞ Follow me
Ovaj svijet je samo varka!
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger Twitter profile
ITS



Joined: 06 Feb 2008
Posts: 377

PostPosted: 06.05.2008 13:46    Post subject: Add user to your forum ignore list Reply with quote

E legenda si!!! hvala ti care!
Back to top
View user's profile Send private message Send e-mail
segen



Joined: 19 Dec 2006
Posts: 672
Location: ZG <-> ST

PostPosted: 06.05.2008 15:31    Post subject: Add user to your forum ignore list Reply with quote

Ubuduće probaj davat smislena imena topicima, a ne "Molim pomoć, hitno mi je..." nego recimo "Random MovieClip properties" ili tome slično.

_________________
NEW ∞folija∞ Follow me
Ovaj svijet je samo varka!
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger Twitter profile
ITS



Joined: 06 Feb 2008
Posts: 377

PostPosted: 06.05.2008 16:11    Post subject: Add user to your forum ignore list Reply with quote

bez ljutnje molim! sorry!
Back to top
View user's profile Send private message Send e-mail
segen



Joined: 19 Dec 2006
Posts: 672
Location: ZG <-> ST

PostPosted: 06.05.2008 16:35    Post subject: Add user to your forum ignore list Reply with quote

samo savjetujem

_________________
NEW ∞folija∞ Follow me
Ovaj svijet je samo varka!
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger Twitter profile
che.UP
mi3.crew


Joined: 07 Sep 2003
Posts: 2320
Location: zagreb

PostPosted: 06.05.2008 16:55    Post subject: Add user to your forum ignore list Reply with quote

segen wrote:
Ubuduće probaj davat smislena imena topicima, a ne "Molim pomoć, hitno mi je..." nego recimo "Random MovieClip properties" ili tome slično.


bravo, + iz zalaganja :)

_________________
UP | TypeTester | Accommodations App
Meni u Firefox-u ne radi AJAX
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    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