Selasa, 19 Desember 2006

CSS in Flash MX 2004

A style sheet is simply a collection of rules that specify how HTML (or XML) elements within your Flash movie or web page should be formatted. Styles for Flash can be loaded from an external CSS file or created in Flash itself using ActionScript. So what does this mean for you?

Well, suppose you have created a website, with many different textboxes, on many different frames and/or loaded movies, and then your employer decides that they don't like the font you've used, or that they want it to be a different colour. Previously this would have meant going back through the entire site and manually changing all the text boxes to reflect their wishes. A tedious job indeed. Well, not any more?

For the purpose of this tutorial we can say that Cascading Style Sheets allow you to control the look and layout of elements from within one core file*.

We're going to cover most of what you need to know in order to create an external style sheet and apply it to a Flash movie. If you are unfamiliar with CSS I recommend that you follow some of the great tutorials that are already out there on the web, at places such as http://www.westciv.com/style_master/academy/hands_on_tutorial/However, be aware that only certain style-options are supported in Flash, so if you only plan to use CSS in the context of Flash, then you don't need to delve too deeply into these HTML-based tutorials. You'll also be glad to know that Style sheets are not rocket science, and you'll be able to pick up the gist of what's going on quite easily?

There are three ways to create styles:
  • redefining built-in HTML formatting tags supported by flash (such as

    and

  • )
  • create style "classes" that can be applied to specific HTML elements using the

    or tag's class attribute

  • define new tags

If those bullet points didn't make a whole lot of sense to you, don't worry, we'll be covering how to redefine HTML tags and create style "classes" in just a moment, and as for defining new tags, you'll find that information in the accompanying tutorial I have written: CSS/HTML/XML in Flash.

So let's start by looking at the CSS properties that the flash player does support. You don't need to memorize the information in the following tables, but you can come back to them at a later stage for reference.

The main thing to note, if you later plan to create your CSS file in Flash using ActionScript, is that each ActionScript property name is derived from the corresponding CSS property name, but the hyphen is omitted and the subsequent character is capitalized (often referred to as camel notation), but as we plan to create an external sheet, this is currently of no concern to us.

Let's assume we want to create a style. The style will consist of one or more properties. For instance, we may want our style to have a color property of blue, and a size property of 11 pixels. If so, then our code would look something like this:

font-size: 11px;

color: #0000FF;

Okay, so what we need is a way of telling our textbox to format a portion of our text according to these rules; but how do we tell our textbox what text to select? Well, CSS properties are no good on their own. We need to use them in conjunction with HTML tags, and luckily for us, Flash MX 2004 supports more HTML tags than its predecessor...

Creating Our Own Cascading Style Sheet For Use With Flash

Open up your favourite text editor. Fingers at the ready, but don't start typing just yet. We're going to cover those two ways of defining our styles.

CSS styles can be assigned to every instance of a built-in HTML tag that appears in a text field. So, for example we can define a style for the p (paragraph) tag that will mean all text enclosed within any p tag in your textbox will share the same font, font-size and colour.

Using a color property of blue, and a size property of 11 pixels (as we mentioned above), and an additional "font-family" property, our CSS definition for the p tag would look like this:

p {

font-family: Arial,Helvetica,sans-serif;

font-size: 11px;

color: #0000FF;

}

Notice how the above example looks like a function. In essence that's what it is. Every time a "

" tag is encountered, the code inside the curly brackets would 'run' and be applied to all the text within the opening and closing p tags on the page.

Using our previous example, if I were to write

Hello World

the text inside the p tags would be formatted according to the properties we specified above and the properties native to the p tag itself. Therefore it would appear as a paragraph, but would also be blue, 11px and written using the Arial, Helvetica, sans-serif font-family.

We can also create style "classes" that can be applied to specific HTML elements using the

or tag's class attribute (don't get CSS classes confused with classes in actionscript2 - as they're not the same thing).

CSS classes start with a period, followed by a class name. We can choose our own suitable name like so:

.alert {

font-family: Arial,Helvetica,sans-serif;

font-size: 14px; color:

#FF0000;

}

Before I show you an example of how this can be applied, we should quickly cover the purpose of the tag. Simply put, span is a tag that doesn't do anything in itself (unlike the p tag which, on its own, would apply some formatting to the text inside it), but can be used in conjunction with a CSS class to format text, and this will become apparent in the following examples:

To use a span tag we need to learn about the class attribute?

Infact, both p and span tags can accept an attribute called 'class'. First I'll show you how to use it in conjunction with the span tag:

Goodbye cruel world!

Notice that we didn't write (the period is only needed when we first define the class).

As I said, span in itself does nothing, but now we have given it a class-attribute of 'alert' and so any text inside our opening and closing tags will be 14px, red and use the Arial, Helvetica, sans-serif font-family.

Finally, a demonstration of using class attributes with the p tag is needed:

Two pints of lager and a packet of crisps please

What would happen in this scenario is that the text would be formatted as a paragraph, and according to the attributes specified in the CSS paragraph-definition, but then it would inherit the properties of our alert class. Because these are exactly the same properties as defined for p (but with different values) the alert class's properties would over-ride those defined for the p tag. Therefore our text would be 14px, red, use the Arial, Helvetica, sans-serif font-family, and be formatted as a paragraph.

Okay enough of that. Let's create our style sheet

We're going to create an external Cascading Style Sheet for use in Flash. This involves three main stages as listed below:

  • Create a style sheet object
  • Add styles to the style sheet object
  • Assign the style sheet object to a text field that contains XML- or HTML-formatted text

Note: When you assign a style sheet object to a TextField object, the following changes occur to the text field's normal behaviour: The text field becomes read-only and cannot be edited by the user.The setTextFormat() and replaceSel() methods of the TextField class no longer function with the text field. The only way to change the field is by altering the text field's text or htmlText properties, or by changing the text field's associated variable. Creating the stylesheetMost of what follows is now only a slight variation of the example in the actionscript dictionaryFor those of you who are avoiding the dictionary due to past experiences, I would suggest you to take a look. The example for this was quite clear and concise (so, if it ain't broken? as the saying goes):

Copy and paste the styles below in to your text editor and save it as "example.css":

p {

color: #000000;

font-family: Arial,Helvetica,sans-serif;

font-size: 12px; display: inline;

}

a:link

{ color: #FF00FF;

text-decoration: underline;

}

a:hover{

color: #999999;

text-decoration: none;

}

.headline {

color: #0000FF;

font-family: Arial,Helvetica,sans-serif;

font-size: 18px;

font-weight: bold;

display: block;

}

.byline {

color: #666600;

font-style: italic;

font-weight: bold;

display: inline;

}

"(^_^)"

#include
#include
void main()
{
clrscr();
cout << " Gimana ya,,, hihihi ini sih dalam masa percobaan blognya prenseter";
cout << " aku binun mulai cerita dari mana...... ";
cout << " sebenere aku ni lagi binun pengen marah ";
cout << " tapi gak tau mo marah ke siapa???? ";
cout << " pokok e dino iki nyophy males untuk ketawa,,,, ";
cout << " hehehe tapi untungnya aku punya temen baru, ";
cout << " arek seng jogo parkiran ";
cout << " aq punya tempat tongkrongan baru,,,, ";
cout << " nek misale kompi di pojok net lagi dipake orang :( ";
cout << " aku mesti maen kesini,,,, " ;
cout << " klo g ada cari aja nyophy di warunge Buk Ti utowo Pak No. ";
cout << " Nek mekso durung ketemu tulung golek ono aku ndek kos-kosan, ";
cout << " nek isih belum ketemu hehehe calling ajah di hapenya :D ";
cout << " kalo misalnya HPnya gak bisa dihubungi yaaaa paling kehabisan baterai ";
getch();
} :-p
kalo ada yang binun baca blog diatas, yang tulisan COUT g usah dibaca gitu, bisa di kopi????? harap bisa di paste huuhhh aku dah capek, besok doain bisa ngisi blog lagi yah,,, :

berita dino iki

hari ini aku berangkat ke kampus agak siangan, lha wong kemaren pas hari minggu seharian penuh ndek lab pulangnya sekitar jam 21.30 malem gitu loch,, agak capek gitu. huhhhhh

paginya tetep jah ngerjain pidio tapi laen bukan yg kmaren, nek sing saiki pidione KKN heheheh

 

Senin, 18 Desember 2006

mamahh aku kangennn :(

Hari minggu,,, ku berangkat kekampus sekitar jam 10 puwagi dengan terpaksa karena aku sek ngantuk dan sampek dikampus sekitar jam 12an, cz q kemaren pulang kerumah (biasalah kangen emak tercayank) jadi yaa berangkat kekampus dari kampung halaman gitu loohhh, hehehe aku pulang g sendirian lochh aku mole karo Parah (gak tau tuh anak sukaknya ngikut tokk,,,)

Sesampainya dikampus, aku ketemu ama muklinting huhh jadi tambah pusing mana kerjaan gak kelar-kelar eeee malah dia suka gangguin, emang tuh anak gak bisa diyam.

Barusan ajah dia nggodain si Parah,tapi kasiyan ama Parah dia kagak direken hehehe malah ditinggal keluar (pipis hihihi), pas ditinggal Parah pipis eh dia mulai beraksi lagi godain aq (resiko jadi orang maniss ya kayak gini deh <--- molai sombonge metu :D). Padahal mbah kakung loh dem ajah, BangZad juga sibuk dengan pekerjaannye, trus jaini juga sibuk dunlud lagu, trus si Poji sibuk dengan soal modul1, eh eh si Parah tidur mulu' (muklinting molai beraksi kembali melancarkan jurus Maut Menggoda Parah hahahaha)

Eh tapi kemaren aku seneng banget bisa pulang ketemu emak ku cayank, ketemu papah, ketemu adek2, terlebih ketemu meine bruder begog yang semakin hari semakin nakal semakin hhhmmmmm gemes aku pokok e. malah kemaren sempat tak cokot pipine seng nyemplu hihihi (wes ta pokok e nek ketemu begog mesti smekdon smekdonan). Apa lagi nek pas nyanyi "seng mlenuk ketok mlenuk e, seng mboneng ketok untune, seng seksi ketok ketok udelle, seng cilik ketok cacinge, seng gedhe ketok ****** e" (maaf dipun sensor, mboten pareng dipun ekspos mangke mundak sawanen). Nah gara-gara si Parah dengerin nyanyiane begog ndek hengpon ku makane dia penasaran trus ikut aku pulang,,,, hehehe begitu ceritanya sodara.. si yu neks tem :)

 

wisuda an tuh dikanjuruhan

waduh,,, aku ditanya ma emda "sampeyan kapan mbak wisuda, hah?"
binun jawabnya,,, hehehehe biasa dia ngomong jorokkk. Pokoknya klo ngomongin sekripsi trus wisuda weeeeessss iku mesti ngomong jorok (versi nyophy hwehehe).

Padahal aku sendiri juga pusing g cepet cepet skripsi,,,,huuu huuuuu padahal temenku dah nikah smua tuh (pengennnnn,,,), lha wong mau ngerjain sek diuber uber kerjaan yang laennya jadi g da kesempatan ngerjain gitu lochh,,,,

 

Minggu, 17 Desember 2006

Kangen - Penantian Yang Tertunda

Kumohon kau mengerti cobalah kau tabahkan hati
Mungkin di saat ini cinta kita sedang diuji

Tegarkanlah hatimu oleh siksa orang tuamu
Kuyakin kita mampu bila kita saling menunggu
Saat kita melangkah dandani sayap cinta yang patah
Kuyakin engkau setia untuk selama lamanya

Kuyakin engkau bidadari dalam tidurku
Kuyakin engkau yang pantas aku tunggu
Kuyakin engkau hadir dalam mimpi indahku
Kau yang terbaik bagiku dan nomor satu

Ku kan slalu tetap menunggu walau sebagai simpananmu
Ku kan slalu tegar menanti walau engkau takkan kumiliki
Ku kan slalu tetap menunggu walau hanya kekasih gelapmu
Ku kan slalu tegar menanti hingga saat nafasku terhenti

 

ST12 - Aku Masih Sayang

Kau rinduku jiwaku indah memanggil dirimu
Mataku terbangun untuk menanti
Menantimu...
Jangan pernah kau ragukan cinta yang sesungguhnya
Itu bisa menghancurkan semua bukan begitu

* Aku sungguh masih sayang padamu
Jangan sampai kau meninggalkan aku
Begitu sangat berharga dirimu bagiku
Dan ku pastikan setia dihatimu
Kan ku korbankan semuanya untukmu
Sungguh kuberharap kau pun begitu padaku

Coba engkau rasakan cinta yang begitukan mengesankan
Yakin pasti dapatkan kemesraan yang penuh bintang

back to *

 

Sabtu, 16 Desember 2006

semakin ruwet ajah

enghuuuhhhh lagi lagi dia menggodaku,,,,, huhh (tetep pada pendirian) nanti malam dia mengajakku kluar liat acara himpis,, huhh aku mau jalan sendiri tanpa dia (muklinthing kamsute). hihihihihi aku g mau diajak ma dia ee eee eeee dia malah mau ngajak jaini (lohhh,,,, yak opo se?) katanya aku dah ga bisa mesra lgi kayak dulu (padahal emang dari dulu aku g mau ma dia)

eh ,,,, dia mnggodaku lagi katanya "nyop, u ntar malem ada acara g? ", padahal aku g da acara (ancen arek iku rodo mekso). Dan sekarang dia menggoda si Ari lagi, dan akhirnya Ari ngomong "aku mo kuliyah, jangan ganggu aku?" (kasian yah muklinting)

para pemerhati sekalian, informasi barusan jangan ditelan mentah-mentah yaaa, cz itu cuma intermezzo soale smua pada pusing mikiri adobe premiere yang g karu-karuan. Emang kayak gitu kehidupan kami, penuh canda ceria meskipun sebenere smuanya tewur, hihihi..... salam piss ajah ya prend
 

Jumat, 15 Desember 2006

g pk judul

hHHHHoooaaaaHHHHmmmm,,,, pagi ini tetep aja kayak kemaren,,,, (g bisa bangun pagi kamsute :( ), tapi aku inget kalo stiap jum'at pagi tuh nyophy piket pagi jaga lab nya, jadi y dengan terpaksa bangun tidur langsung mandi tanpa nunggu disuruh mandi (lagian sapa yang peduli), dengan langkah rodo ngantuk habis mandi langsung berangkat kekampus (hiks,,,tanpa sarapan) pas ditengah jalan mnuju lab, hp qu bunyi ternyata dari si qodoq katanya "Pon ndang budalo nang kmps dunk,tlg" padahal aku dah didepane kantor Humas ;)) ancen qodoq ki mbuh kok.



Gak ada lima menit aku dah ada di lab internet hehehe ketemu si Qodoq, katanya "o0oooo,,, si nopi dah dateng, yyaaaa rugi dunk tadi aku kirim sms ke kamu (ancen arek iki tetep ae mbencekno). Udah gitu aku mnuju TKP (biasalah pojoknet kesayanganku hihihihi aplikasi3 Ukanet20 gitu). UUhhhhh,,,, aku langsung masuk dan ternyata udah ada jaini disana (ngapdet anti pirus dia), hehehe aku sih langsung mengurupkan kompi trus apdet juga (Alhamdulilllaaaaaaahhh kompi ku g da pirusna) sambil nunggu jam praktikum ama nunggu hasil seken kompi aku maen game, hihihi malu sih sebenere soale gamenya paling yooo mahyong.



Pas asik asiknya maen game datang berbondong-bondong anak MI semester 1 ama sang dosen (dalam hal ini adalah Bu Eva) hihihi pas mereka kuliyah yooo kasian yoooo agak gimana gitu.... Lha wong masiswane yang sering masuk bisa diitung paling yo 1 orang, lah tadi pagi tuh yg ngerjain tugase cuma 1 orang tok n biasa lah yang laennya kopi paste,,,, hehehe pas ditanya pan g isa jawab wal hail akhirnya ketauan deh klo yang temen yang laennya cuma ngopi, kasian dehhhh,,,, kena marah.



Jam yang ditunggu telah menunjukkan angka 09.30 waaahh waktunya ngajar praktikum neeeehhhhhh,,, tam ramtaraaaaaammmmmm nyophy terus mnuju aplikasi2 tapi ternyata g ono wong,,,huuhhhh nunggu deh sembari nunggu aku maen game lagi hihihihi pas jam setengah sepuluh lebih seprapat mulai datang arek2 seng praktikum dah dulu deh cwapek mo makan dulu daaaaaaaaahhhh



 

Kamis, 14 Desember 2006

"(^_^)"

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();
cout << " Gimana ya,,, hihihi ini sih dalam masa percobaan blognya prenseter " << endl;
cout << " aku binun mulai cerita dari mana...... " << endl;
cout << " sebenere aku ni lagi binun pengen marah " << endl;
cout << " tapi gak tau mo marah ke siapa???? " << endl;
cout << " pokok e dino iki nyophy males untuk ketawa,,,, " << endl;
cout << " hehehe tapi untungnya aku punya temen baru, " << endl;
cout << " arek seng jogo parkiran " << endl;
cout << " aq punya tempat tongkrongan baru,,,, " << endl;
cout << " nek misale kompi di pojok net lagi dipake orang :( " << endl;
cout << " aku mesti maen kesini,,,, " << endl;
cout << " klo g ada cari aja nyophy di warunge Buk Ti utowo Pak No. " << endl;
cout << " Nek mekso durung ketemu tulung golek ono aku ndek kos-kosan, " << endl;
cout << " nek isih belum ketemu hehehe calling ajah di hapenya :D " << endl;
cout << " kalo misalnya HPnya gak bisa dihubungi yaaaa paling kehabisan baterai " << endl;

getch();

}



:-p kalo ada yang binun baca blog diatas, yang COUT ama ENDL g usah dibaca gitu, bisa di kopi?????

harap bisa di paste

huuhhh aku dah capek, besok doain bisa ngisi blog lagi yah,,, :|

 

Layang-layang

Dulu pernah kaubelikan aku sebuah layang-layang pada hari ulang tahun. Aku pun bersorak sebagai kanak-kanak tapi hanya sejenak.