Jump to content
coisox

Actionscript 3: Camne Nak Tau Full Name Bagi Sesuatu Object?

Recommended Posts

Katakan aku create new movieclip bernama MC1 kat stage, so aku tau nama penuh dia kat dalam coding ialah _root.MC1 atau boleh terus guna MC1.

Masalahnya, kalau dalam MC1 ada satu lagi object bernama Obj1. So dalam coding nak panggil apa? Aku dah try MC1.Obj1.visible = false dia kata error.

Boleh tak kita right lick somewhere dan tengok kat property dia full name?

Share this post


Link to post
Share on other sites
package {
    
    import flash.display.*;
    public class documentclass extends MovieClip {
        
        var callobject:classobject;
        
        function documentclass()  {
            
            callobject = new classobject();
            callobject.classobjectcallthat();
        }
        
        function callthis() {
            trace("1.This is being called from the authoring environment " + this + this.parent);
        }
        
        public static function callthat() {
            trace("2. callthat function in main class is being called from the authoring environment");
        }
    }    
}

Share this post


Link to post
Share on other sites

Aduih... camne nak pakai tu? Complex nye...

Anyway, sebenarnya cara yg aku nak pakai (refer to 1st post) tu bukan salah. Cuma aku pakai Button sebba tu tak jadi. So lepas convert to MC dah boleh pakai.

Share this post


Link to post
Share on other sites

Aku pun tak berapa paham soalan tu... kekekeke. :D

ps:// bila nak siap game ko tuh.. tak sabar nak main nie..

Edited by LanoX

Share this post


Link to post
Share on other sites

Dah 90% complete. Aku tengah study cara2 nak save data ke external text file. Aku nak buat highscore system. Kalau highscore system utk save with php aku dah jumpa

Share this post


Link to post
Share on other sites

Xde cara lain melainkan save data menggunakan php. Itu je caranya.

Kebanyakan tutorial hanya tunjuk cara nak save data dengan php atau mysql jer... kalau in-case server tak support, so takleh ler nak pakai save jenis tu. Tak tau plak kalau save dalam text file atau xml... mungkin boleh kot, maybe Coisox boleh terangkan sikit camner nanti.. :D aku pun nak belajar gak saving game record nie... hehehe.

Share this post


Link to post
Share on other sites

aku pasti cara tu wujud cuma masih belum jumpa. Sebab kan banyak flash game boleh save setting, player profile, etc. maybe kat xml kot.

Diorang guna php la tu kalau game jenis online kalau jenis offline ada external file untuk process benda tu. Aku dah bukak semua code diorang, kebanyakan macam tu. Takda cara lain dah.

Mungkin ko ingat guna php direct kot. Tu sebabnya ko xtahu. Macam nih, flash ada fungsi untuk get and post data macam php mail form tu. Jadi ko kena pandai2 modify untuk post dan retrieve data yang disimpan.

Flash xde build in fungsi macam programming biasa sebab kalau diorang buat macam tu, maka bertambahlah satu lagi jenis virus yang boleh menghapuskan semua data apabila ko bukak flash. Fahamkan?

Share this post


Link to post
Share on other sites

tak kisah laa external file or not. janji ada cara nak save kat PC. Tu je tujuan aku. Kalau ada 3rd party plugin or software lagi bagus.

Boleh explain camner ko save data dalam game Kuren Box tuh.... macam mana script ko pakai?

Share this post


Link to post
Share on other sites

Yg aku email kat kau tu. page 668.

Menggunakan SharedObject. Konsep dia macam cookies. Cuma aku masih tak tau katne dia simpan cookies utk exe file tu. kaalu kau lunch from browser, dia akan simpan kat browser punya cookies. Utk yg game aku tu, agaknya kat tempoarry file.

Edited by Coisox

Share this post


Link to post
Share on other sites

Owh yang tu rupenya... aku tak sempat lagi nak bukak file adobe tu... kalau konsep macam cookie, kira boleh terpadam lah kan... maknanya konsep nie tak memerlukan fail luaran lain... just run the game, create high score and store inside the game itself.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...