View Full Version : Sapa terer action script Flash??
Salam
Aku mungkin buat projek pakai Flash, kena guna OOP pasal ada kelas, objek etc. Sapa biasa pakai action script 2.0 ? sila angkat tangan, bantuan diperlukan.
castagnet
10-01-04, 01:06 PM
aku baru beli satu buku pasal oop utk action script....baru mula baca ..ok gak...tapi kono paham betul2 la....bm lagi..
C-Fumofufu
10-01-04, 03:01 PM
ape yang ko nak tau sangat?
Salam
cayo la ado c-fu nok tulung ajor. Mcm ni la lebih kurang. Aku nak buat animation on chemical process yg mana melibatkan byk molekul2 etc. Setiap molekul aku akan assign sbg objek, so sekang ni tgh mencarik-carik mcm mana nak animate selected object base on user input. Ke kena assign as symbol dulu??
Aku tgh study sampel dari site ni:
http://www.actionscript.org/tutorials/beginner/Animation_Via_Actionscript/index.shtml
C-Fumofufu
12-01-04, 11:26 AM
elok assingn ke symbol dulu. ako tak dapat bukak link yang ko kasi tu so ako taktau ape ko nak buat sebenonye, tapi ako rase ko just nak gerak2 molekul dari kiri ke kanan and vice versa kan?
ako dah agak lame tak sentuh AS2 tapi ako pasti yang dalam as2 dengan gunekan konsep objectoriented programming OOP ni ko leh boh attributes kat jenis2 molekul la. so senang la cam kalo molekul X ngan Y gabung nanti jadi Z, kalo ko hardcode cam ko buat animasi X ngan Y senang, tapi nanti kene la buat animasi untuk X dengan Y, X + Z, X + A dll. kalo ko set je dalam attributes die nanti orang mix2 terus dapat jawapan nye, tapi agak susah la nak buat coding. cite jap ape ko nak buat, ako pon nak asah balik acrionscrip nih :gelaks:
aku dah try buat. Aku kena pakai component utk guna action script sebab projek aku kena guna OOD atau UML senang cite. TP Tp nak jugak tahu camne nak guna actionscript how to animate symbol using actionscript. Aku nak animate byk symbol with basically with the same pattern of animation. Let say just to highlight or scale or change the color etc.
Utk permulaan, ni problem aku. aku kasik senario..
1. user enter input e.g : glucose
2. Action script will detect any symbol on the stage that match with the user-input let say there are 100 all of them and 3 items are matched.
3. All of them (mathed symbols) should be animate for user to recognise them.
C-Fumofufu
15-01-04, 01:38 AM
hmmm ikut pemahaman ako
0. memule kene carik cara nak dapat semua jenis symbol kat atas stage la. either ko generate semua symbol dalam scripting, and each time ko generate u save the symbol's name in a txt or XML file ke for checking. ako rase takleh stack kan kat RAM kot, tak tau la.
1. create a text field, name it txtfield
2. kat txt tu buat script something like onkeypress <Enter>
for i=0, i < last entry xml, i++ {
if txtfield.txt = i.txt then animate = yes }
if animate = yes {
loop i { symbol.txt.scale(200%) }}
as you can see ako tak sentuh AS so command memang akan abit different la hehe :p
i got wat u mean. Am thinking to put all the info in a plain text file and assign a unique ID together for each element as the name for some molecul is quite long and hard to store in a plain text. The symbol or component in the library will be based on that ID.
Now am still trying to create a template or object (but still unsuccessful), so all of the elements that i will put on the stage need only to be defined as an instance of the object. The problem is now how to do it in AS command. In Flash MX 2004, there are basic UI components provided but now I am thinking how to create my own self-defined component. Let say a molecul named glucose has it own properties which defined by me in the code.
---------------------------
Class : Molecul
---------------------------
ID : XXYYY10
Type : glucose
Process : p1, p2, p3 (assume more than 1 process)
---------------------------
method:
getID();
getType();
getProcess();
getAnimation();
--------------------------
Tp pasal XML tu aku kureng expert. Tapi kalau guna XML ni aku rasa kena guna web service kan??? tp project ni kalau expend utk multi-device orait gak guna XML. hehehe. Ko reti ke c-fu guna XML??? Kalau reti tu, habaq2 la mai.
Ermmm..setakat ni sahaja progress report utk projek aku nih. Nak kena menaip hantar kat supervisor lak. Terima kasih byk c-fu ats pertolongan dan sokongan.
C-Fumofufu
19-01-04, 08:39 AM
tak reti gak, cume ako dengar ni dah jadi cam standard dah so elok gune yang standard :p
ako pon dengar kene ugne webservice... tapi dalam buku2 site2 yang ako bace takde lak kate kene gune, at least yang flash implementation nye takde.
pasal properties molecule tu, i think you can just create class to store those things, including the assigned symbol for molecule. camni kot? tak ingat dah...
class mol() {
var ID:Number
var Type:String
function Process(int a) {
case (a) {
p1: blabla
p2: blalbla
p3: blalbla
}
function getID() {return ID ) //leh kot
}
btw i think for classes theres something about classpath yang ko kene set mula2... tapi ako dah lupa hahaha.
pasal movieclip tu ko leh gune duplicatemovieclip ako rase, boh satu kat luar stage so orang tak nampak, then just duplicate je la. maybe you can put this inside class kat atas tadik tu, tapi ako baru bangun so pikir snirik ah :gelaks:
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.