Logo GenDocs.ru

Поиск по сайту:  

Загрузка...

Курс лекции по дисциплине Современные программные средства - файл 05. ЯЗЫК ACTION SCRIPT.doc


Загрузка...
Курс лекции по дисциплине Современные программные средства
скачать (21152.1 kb.)

Доступные файлы (590):

Задание.doc21kb.05.02.2002 00:56скачать
Лекция_1.doc49kb.04.02.2004 09:27скачать
ЗАДАНИЕ.DOC37kb.13.02.2007 12:28скачать
Программирование с DAO и ADO.doc426kb.13.02.2007 17:20скачать
CRE_INFO.GID
CRE_INFO.HLP
Helpscr.doc213kb.11.09.1998 08:50скачать
README.TXT1kb.27.09.1998 08:05скачать
задание СПС лаб4.doc24kb.16.03.2005 12:15скачать
Задание.doc23kb.17.03.2006 16:06скачать
cube.swf
snegovic.swf
bubbles.fla
bubbles_Scene 1.swf
bubbles.swf
Animate-Shape Tween.fla
cube.fla
Dirt Gear.fla
Globe.fla
Sun Town.fla
Theater.fla
Writing Pen.fla
3d_animat.asp
3d_animat.swf
ani_but.asp
ani_but.swf
faq.asp
fla.asp
fonts.asp
f_viewer.swf
mail-list.asp
optimization.asp
player.swf
practic.swf
protect.asp
ruhelp.asp
rut.gif1kb.21.05.2000 22:16скачать
shortcuts.asp
sounds.asp
ssavers.asp
textfield.asp
trigger.asp
trigger.swf
2 Рисование.fla
5 Работа с текстом.fla
flash4_1_D.doc160kb.01.09.2001 06:27скачать
2 Слои.fla
flash4_2_layers.doc143kb.01.09.2001 06:27скачать
Имитация увеличительного стекла.doc32kb.05.04.2001 07:31скачать
3 Символы и Копии.fla
flash4_3_simbol.doc99kb.01.09.2001 06:29скачать
Skywriting.fla
Skywriting.swf
4 Кнопки.fla
5 Звуки.fla
flash4_5_sound.doc106kb.01.09.2001 06:30скачать
8 Анимация.fla
8 Анимация.swf
flash4_6_animation.doc98kb.01.09.2001 06:31скачать
Основы анимации.aviскачать
Macromedia Flash 5 (Лекция 1).doc217kb.19.11.2002 18:47скачать
test.swf
Вставка Flash.doc30kb.28.04.2004 15:17скачать
Вставка Flash-роликов в HTML.doc73kb.28.04.2004 11:10скачать
Использование SWiSH в HTML.doc80kb.28.04.2004 15:28скачать
Как вставить Flash в HTML.doc28kb.28.04.2004 15:40скачать
Код вставки SWF файла Flash MX.doc24kb.28.04.2004 15:54скачать
Am179.gif31kb.05.04.1998 14:42скачать
ANATOMY3.GIF12kb.20.02.1998 18:25скачать
ANATOMY5.GIF7kb.20.02.1998 18:23скачать
ANATOMY7.GIF10kb.20.02.1998 18:26скачать
anieyes.gif50kb.11.10.1998 03:43скачать
Aniheart.gif5kb.05.04.1998 14:46скачать
BAT.GIF13kb.20.02.1998 08:37скачать
BIRD2.GIF4kb.20.02.1998 08:23скачать
BULL1.GIF44kb.20.02.1998 08:25скачать
BULL.GIF15kb.20.02.1998 08:23скачать
BUTTE~56.GIF34kb.20.02.1998 08:18скачать
BUTTE~58.GIF51kb.22.02.1998 02:44скачать
CAT10.GIF25kb.20.02.1998 08:06скачать
CAT13.GIF20kb.20.02.1998 17:02скачать
CAT14.GIF9kb.20.02.1998 07:56скачать
CAT2.GIF28kb.20.02.1998 08:11скачать
CAT8.GIF12kb.20.02.1998 17:03скачать
CAT9.GIF3kb.20.02.1998 17:01скачать
DOG13.GIF5kb.22.02.1998 02:36скачать
DOG1.GIF12kb.20.02.1998 07:53скачать
DOLPHIN.GIF18kb.20.02.1998 16:53скачать
DOLPHINS.GIF18kb.20.02.1998 07:34скачать
DOVE.GIF102kb.20.02.1998 16:59скачать
EAGLES.GIF85kb.22.02.1998 02:45скачать
FISH.GIF31kb.20.02.1998 07:30скачать
FLAM~172.GIF10kb.20.02.1998 07:11скачать
FLYI~176.GIF17kb.20.02.1998 07:12скачать
FROG.GIF8kb.20.02.1998 07:09скачать
LEOPARD.GIF8kb.20.02.1998 06:56скачать
MONKEY2.GIF34kb.20.02.1998 06:59скачать
MOOSE.GIF19kb.20.02.1998 06:55скачать
MOUSE1.GIF27kb.20.02.1998 07:02скачать
MOUSE2.GIF11kb.20.02.1998 06:53скачать
MOUSE3.GIF39kb.20.02.1998 06:55скачать
MOUSE.GIF72kb.20.02.1998 16:53скачать
ORCA.GIF10kb.20.02.1998 06:52скачать
OWL.GIF34kb.20.02.1998 16:42скачать
POLA~232.GIF16kb.20.02.1998 06:52скачать
PTER~234.GIF14kb.20.02.1998 19:19скачать
PUMA.GIF10kb.20.02.1998 06:50скачать
REDWORMS.GIF4kb.20.02.1998 06:51скачать
SEAGULL.GIF5kb.20.02.1998 06:48скачать
SPIDER1.GIF7kb.20.02.1998 06:46скачать
SWAN.GIF31kb.20.02.1998 06:45скачать
TIGER1.GIF10kb.20.02.1998 06:42скачать
TIGER2.GIF39kb.20.02.1998 06:54скачать
TIGER3.GIF12kb.20.02.1998 06:40скачать
TIGER4.GIF6kb.20.02.1998 06:40скачать
TIGER5.GIF9kb.20.02.1998 06:40скачать
TIGER6.GIF22kb.20.02.1998 05:44скачать
TRACKS.GIF3kb.20.02.1998 05:35скачать
T-REX.GIF50kb.20.02.1998 16:42скачать
TURTLE2.GIF12kb.20.02.1998 05:31скачать
WORM.GIF4kb.20.02.1998 05:30скачать
ani-tri.gif2kb.03.11.1998 15:51скачать
A-ANI5.GIF38kb.20.02.1998 06:40скачать
ASTERO~8.GIF49kb.20.02.1998 16:40скачать
EARTH10.GIF24kb.20.02.1998 16:36скачать
EARTH12.GIF8kb.20.02.1998 16:33скачать
EARTH13.GIF36kb.20.02.1998 16:33скачать
EARTH14.GIF52kb.20.02.1998 16:34скачать
EARTH16.GIF15kb.20.02.1998 16:30скачать
EARTH18.GIF87kb.20.02.1998 16:35скачать
EARTH1.GIF10kb.20.02.1998 16:37скачать
EARTH2.GIF113kb.23.02.1998 14:01скачать
EARTH4.GIF21kb.20.02.1998 06:32скачать
EARTH6.GIF55kb.20.02.1998 16:47скачать
EARTH8.GIF18kb.20.02.1998 16:35скачать
EARTH9.GIF7kb.20.02.1998 06:23скачать
EARTHBUT.GIF8kb.20.02.1998 06:07скачать
EARTH.GIF28kb.20.02.1998 06:34скачать
GLDGLOBE.GIF87kb.20.02.1998 16:29скачать
GLOBE.GIF19kb.20.02.1998 06:07скачать
GP_GLO~6.GIF37kb.20.02.1998 06:07скачать
MOON1.GIF40kb.20.02.1998 06:04скачать
MOON2.GIF26kb.20.02.1998 16:25скачать
MOON3.GIF47kb.20.02.1998 06:04скачать
MOON.GIF14kb.20.02.1998 06:05скачать
PLANET1.GIF168kb.22.02.1998 23:17скачать
PLANET3.GIF146kb.20.02.1998 16:26скачать
PLANET.GIF20kb.20.02.1998 16:29скачать
PULSAR.GIF3kb.20.02.1998 05:48скачать
REDGLOBE.GIF68kb.20.02.1998 16:24скачать
SATURN.GIF30kb.20.02.1998 05:52скачать
SHINING.GIF7kb.20.02.1998 05:47скачать
SPIKE.GIF4kb.20.02.1998 05:48скачать
STAR1.GIF53kb.22.02.1998 22:22скачать
STAR2.GIF3kb.20.02.1998 05:48скачать
STAR3.GIF17kb.20.02.1998 05:45скачать
STAR4.GIF3kb.20.02.1998 05:40скачать
STAR5.GIF1kb.20.02.1998 05:39скачать
STAR6.GIF7kb.20.02.1998 05:41скачать
STAR7.GIF3kb.20.02.1998 05:41скачать
STAR8.GIF5kb.20.02.1998 05:39скачать
STAR.GIF2kb.20.02.1998 05:47скачать
STARRY.GIF9kb.20.02.1998 05:39скачать
STARS.GIF11kb.20.02.1998 05:52скачать
TWSTAR.GIF3kb.20.02.1998 05:37скачать
ABALL1AB.GIF9kb.20.02.1998 09:59скачать
ABALL1A.GIF7kb.20.02.1998 09:58скачать
ABALL2A.GIF9kb.20.02.1998 09:57скачать
ABALL3A.GIF9kb.20.02.1998 09:57скачать
ABALL4A.GIF9kb.20.02.1998 10:07скачать
ABALL6A.GIF9kb.20.02.1998 09:56скачать
AG_BALL3.GIF4kb.20.02.1998 09:58скачать
AN_ICONA.GIF6kb.20.02.1998 18:22скачать
BALL1.GIF4kb.20.02.1998 09:54скачать
BALL2.GIF2kb.20.02.1998 09:54скачать
BALL3.GIF4kb.20.02.1998 09:54скачать
BALL.GIF6kb.20.02.1998 09:57скачать
BLINE.GIF3kb.20.02.1998 09:53скачать
BLINK~42.GIF3kb.20.02.1998 09:53скачать
BLINKIE.GIF3kb.20.02.1998 09:53скачать
BLUBOU.GIF1kb.20.02.1998 09:52скачать
BLUEBALL.GIF9kb.20.02.1998 09:53скачать
BLUER~50.GIF11kb.20.02.1998 09:53скачать
BLUERED.GIF2kb.20.02.1998 09:52скачать
BLUES~52.GIF3kb.20.02.1998 09:52скачать
BLUEY~54.GIF10kb.20.02.1998 09:51скачать
BLUPULSE.GIF2kb.20.02.1998 09:51скачать
BNC_ANM.GIF5kb.20.02.1998 09:53скачать
BUBBLER.GIF6kb.20.02.1998 09:48скачать
CONENB.GIF50kb.20.02.1998 09:52скачать
GLOBE.GIF40kb.20.02.1998 18:25скачать
GOLD1.GIF2kb.20.02.1998 09:41скачать
GP_BUT27.GIF10kb.22.02.1998 23:59скачать
GP_BUT29.GIF18kb.20.02.1998 09:44скачать
GP_BUT37.GIF2kb.20.02.1998 09:37скачать
GP_BUT38.GIF1kb.20.02.1998 09:36скачать
GP_BUT39.GIF2kb.20.02.1998 09:39скачать
GP_BUT40.GIF7kb.20.02.1998 09:44скачать
GP_GLO~7.GIF77kb.24.02.1998 00:22скачать
GP_GLO~8.GIF6kb.20.02.1998 09:39скачать
GP_GLO~9.GIF5kb.20.02.1998 09:32скачать
GP_GRN~2.GIF13kb.20.02.1998 09:36скачать
GP_MOON.GIF8kb.20.02.1998 09:31скачать
GP_PIC3.GIF72kb.20.02.1998 09:36скачать
GP_PIC4.GIF119kb.24.02.1998 00:21скачать
G_SPIRAL.GIF9kb.23.02.1998 00:02скачать
PALLA.GIF8kb.20.02.1998 09:30скачать
PERLREDB.GIF2kb.20.02.1998 09:29скачать
PURPIN.GIF2kb.20.02.1998 09:29скачать
ROLLBALL.GIF5kb.20.02.1998 09:29скачать
ROTDONE.GIF25kb.20.02.1998 09:31скачать
SBUTTON.GIF15kb.20.02.1998 09:26скачать
SOC_ANM.GIF14kb.22.02.1998 23:59скачать
SPIK~126.GIF8kb.20.02.1998 09:22скачать
SQUI~128.GIF9kb.20.02.1998 09:29скачать
TCWD_106.GIF7kb.20.02.1998 05:29скачать
TCWD_118.GIF4kb.20.02.1998 05:29скачать
banner_3.gif14kb.22.12.1998 20:36скачать
1P_BAR1.GIF135kb.23.02.1998 20:41скачать
AG_BAR2.GIF3kb.20.02.1998 09:22скачать
ANIMA~22.GIF9kb.20.02.1998 09:21скачать
ANIM-BAR.GIF7kb.20.02.1998 09:20скачать
ANI-TUBE.GIF8kb.20.02.1998 09:19скачать
BAR_ANM.GIF7kb.20.02.1998 09:18скачать
BAR_EL.GIF11kb.20.02.1998 09:18скачать
BARMOVE.GIF28kb.20.02.1998 09:19скачать
BARSTAR.GIF5kb.20.02.1998 09:17скачать
BBOMB.GIF14kb.20.02.1998 09:17скачать
BEEP2.GIF4kb.20.02.1998 09:16скачать
BLOODBAR.GIF5kb.20.02.1998 09:17скачать
BLUEONE.GIF4kb.20.02.1998 09:16скачать
BLUERULE.GIF4kb.20.02.1998 09:16скачать
BLUETWO.GIF2kb.20.02.1998 09:15скачать
BOLT_ANI.GIF18kb.20.02.1998 09:15скачать
BOMBBAR.GIF11kb.20.02.1998 09:14скачать
BR_BAR.GIF12kb.20.02.1998 09:18скачать
BULBOUT.GIF2kb.20.02.1998 09:13скачать
BURST~70.GIF10kb.20.02.1998 09:14скачать
CANON.GIF15kb.20.02.1998 09:14скачать
CAT.GIF10kb.20.02.1998 09:16скачать
COLOR~82.GIF16kb.20.02.1998 09:17скачать
COLORBAR.GIF5kb.20.02.1998 09:13скачать
COLORLIN.GIF8kb.20.02.1998 09:13скачать
CON-BAR3.GIF7kb.20.02.1998 09:10скачать
COP.GIF13kb.20.02.1998 17:16скачать
DANCEBAR.GIF1kb.20.02.1998 09:09скачать
DOG_H~94.GIF64kb.20.02.1998 09:12скачать
DRIP1.GIF4kb.20.02.1998 09:09скачать
DRIP.GIF7kb.20.02.1998 09:09скачать
ELECTRIC.GIF6kb.20.02.1998 09:08скачать
FIREBAR2.GIF12kb.20.02.1998 09:09скачать
FIREBAR.GIF42kb.20.02.1998 09:12скачать
FLOW~110.GIF1kb.20.02.1998 09:07скачать
FUSS.GIF5kb.20.02.1998 09:07скачать
G_BAR_N3.GIF11kb.20.02.1998 09:08скачать
GEOBAR.GIF12kb.20.02.1998 09:09скачать
GP_BAR10.GIF12kb.20.02.1998 08:54скачать
GP_BAR11.GIF10kb.20.02.1998 17:12скачать
GP_BAR12.GIF18kb.20.02.1998 08:52скачать
GP_BAR1.GIF27kb.20.02.1998 09:05скачать
GP_BAR2.GIF45kb.20.02.1998 09:05скачать
GP_BAR3.GIF9kb.20.02.1998 17:16скачать
GP_BAR4.GIF13kb.20.02.1998 09:00скачать
GP_BAR5.GIF20kb.20.02.1998 09:00скачать
GP_BAR6.GIF17kb.20.02.1998 08:59скачать
GP_BAR7.GIF34kb.20.02.1998 17:13скачать
GP_BAR8.GIF62kb.23.02.1998 20:38скачать
GP_BAR9.GIF32kb.20.02.1998 08:59скачать
GP_GLO~5.GIF31kb.20.02.1998 08:55скачать
GREY~150.GIF14kb.20.02.1998 08:53скачать
HR1.GIF8kb.20.02.1998 08:49скачать
HR_S~156.GIF9kb.20.02.1998 08:50скачать
INDI~158.GIF10kb.20.02.1998 08:50скачать
JETRIGHT.GIF14kb.22.02.1998 02:46скачать
KILROY.GIF5kb.20.02.1998 08:48скачать
LASER.GIF6kb.20.02.1998 08:47скачать
LIBUNT.GIF1kb.20.02.1998 08:47скачать
LILRED.GIF3kb.20.02.1998 08:46скачать
LINE04C.GIF29kb.20.02.1998 17:15скачать
LINEDOT.GIF18kb.20.02.1998 08:47скачать
LOLLIPOP.GIF7kb.20.02.1998 17:11скачать
MATC~178.GIF9kb.20.02.1998 08:44скачать
NASCAR.GIF26kb.20.02.1998 17:12скачать
NEWS~182.GIF11kb.20.02.1998 08:41скачать
PROGRESS.GIF5kb.20.02.1998 08:38скачать
RULE02.GIF6kb.20.02.1998 08:38скачать
SABE~190.GIF30kb.20.02.1998 08:40скачать
SLIDBAR.GIF9kb.20.02.1998 08:36скачать
SPARK.GIF5kb.20.02.1998 08:33скачать
STAR~196.GIF14kb.20.02.1998 17:10скачать
WELLMESS.GIF12kb.20.02.1998 05:36скачать
WLCME.GIF8kb.20.02.1998 05:30скачать
YELLCAR.GIF28kb.20.02.1998 05:38скачать
BOOK2.GIF10kb.20.02.1998 18:57скачать
BOOK3.GIF20kb.20.02.1998 18:56скачать
ANIMASCT.GIF12kb.20.02.1998 11:32скачать
ANIRATZ.GIF4kb.20.02.1998 16:05скачать
ANMCALLE.GIF4kb.20.02.1998 11:32скачать
BUGSD~14.GIF68kb.20.02.1998 11:42скачать
CALVIN.GIF6kb.20.02.1998 11:28скачать
DEVIL~28.GIF8kb.20.02.1998 11:23скачать
DEVIL.GIF62kb.20.02.1998 11:30скачать
DRINK~30.GIF33kb.20.02.1998 11:22скачать
FOX.GIF18kb.20.02.1998 11:22скачать
FREAK~38.GIF3kb.20.02.1998 11:17скачать
GENIE.GIF67kb.20.02.1998 11:27скачать
GOLDHERO.GIF11kb.20.02.1998 11:15скачать
HERORUN.GIF57kb.20.02.1998 11:16скачать
OSCAR.GIF12kb.20.02.1998 10:59скачать
PNKPAN.GIF6kb.20.02.1998 10:58скачать
SHARPS.GIF99kb.20.02.1998 10:55скачать
SONIC.GIF5kb.20.02.1998 10:50скачать
SPIDE~54.GIF4kb.20.02.1998 10:50скачать
ST.GIF68kb.20.02.1998 10:56скачать
SUPER~58.GIF14kb.20.02.1998 10:49скачать
SYLVEST.GIF22kb.20.02.1998 10:49скачать
TWEETY.GIF9kb.20.02.1998 10:46скачать
VIKING.GIF38kb.20.02.1998 10:48скачать
WB.GIF16kb.20.02.1998 10:45скачать
WIZARD.GIF8kb.20.02.1998 10:43скачать
WOLF.GIF10kb.20.02.1998 10:43скачать
clownanim48.gif28kb.03.04.1998 17:05скачать
counting_fingers.gif4kb.11.10.1998 03:43скачать
3D.GIF20kb.20.02.1998 11:48скачать
COMETANI.GIF23kb.20.02.1998 11:49скачать
ORBIT.GIF57kb.20.02.1998 11:48скачать
WRING.GIF32kb.20.02.1998 11:37скачать
dancers.gif3kb.18.06.1998 21:05скачать
dansman.gif4kb.19.11.1998 02:53скачать
dtr10x.jpg35kb.18.03.1999 11:04скачать
dtr7.jpg25kb.07.11.1998 17:18скачать
ANI_EYE.GIF4kb.20.02.1998 12:00скачать
ANIMAL94.GIF22kb.20.02.1998 12:00скачать
EYE1.GIF17kb.20.02.1998 11:58скачать
EYE2.GIF41kb.20.02.1998 11:58скачать
EYE3.GIF19kb.20.02.1998 11:58скачать
EYE5.GIF17kb.20.02.1998 11:56скачать
EYE-LOOK.GIF3kb.20.02.1998 11:56скачать
EYE-MOV.GIF71kb.20.02.1998 12:00скачать
EYES2ANI.GIF30kb.20.02.1998 11:53скачать
EYES.GIF3kb.20.02.1998 11:54скачать
GP_PIC5.GIF134kb.20.02.1998 12:04скачать
GRN_E~40.GIF3kb.20.02.1998 11:50скачать
GRNEYES.GIF7kb.20.02.1998 11:49скачать
PEEP.GIF21kb.20.02.1998 13:12скачать
ANGEL.GIF54kb.20.02.1998 12:19скачать
ANKH.GIF8kb.20.02.1998 12:13скачать
DFLYGB.GIF28kb.25.02.1998 05:15скачать
DFLYGS.GIF28kb.25.02.1998 05:15скачать
DFLYSB.GIF19kb.25.02.1998 05:16скачать
DFLYS.GIF43kb.25.02.1998 05:16скачать
DRAGON~1.GIF12kb.20.02.1998 12:12скачать
DRAGON1.GIF41kb.20.02.1998 12:14скачать
DRAGON2.GIF18kb.20.02.1998 12:11скачать
HPS.GIF10kb.20.02.1998 12:10скачать
MONSTER.GIF11kb.20.02.1998 12:07скачать
PEGASUS2.GIF12kb.20.02.1998 12:05скачать
PEGASUS.GIF143kb.23.02.1998 20:26скачать
SORCE~44.GIF14kb.20.02.1998 12:05скачать
SPIRIT.GIF6kb.20.02.1998 12:05скачать
SWORD1.GIF51kb.20.02.1998 12:06скачать
SWORD.GIF23kb.20.02.1998 13:10скачать
SWORDS1.GIF23kb.20.02.1998 12:02скачать
UNUS_~58.GIF102kb.22.02.1998 02:34скачать
WIZARD1.GIF20kb.20.02.1998 13:08скачать
WRAITH.GIF24kb.20.02.1998 12:01скачать
ANI020.GIF22kb.20.02.1998 12:42скачать
BLUFIRE.GIF4kb.20.02.1998 12:42скачать
CANDLE1.GIF8kb.20.02.1998 12:41скачать
CANDLE2.GIF2kb.20.02.1998 12:41скачать
CANDLE3.GIF4kb.20.02.1998 12:40скачать
CANDLE6.GIF22kb.20.02.1998 12:48скачать
CANDLE7.GIF8kb.20.02.1998 12:45скачать
CANDLE.GIF10kb.20.02.1998 12:42скачать
DOOMFIRE.GIF13kb.20.02.1998 12:38скачать
DRKTORCH.GIF15kb.20.02.1998 13:10скачать
EXPLO~34.GIF19kb.20.02.1998 12:37скачать
FIRE001.GIF17kb.20.02.1998 12:35скачать
FIRE1.GIF7kb.20.02.1998 12:34скачать
FIRE2.GIF46kb.20.02.1998 12:36скачать
FIRE3.GIF6kb.20.02.1998 12:34скачать
FIREANM.GIF6kb.20.02.1998 12:33скачать
FIRELINK.GIF100kb.20.02.1998 12:41скачать
FIREW~54.GIF65kb.20.02.1998 13:09скачать
FIREW~56.GIF65kb.20.02.1998 12:33скачать
FIREW~58.GIF69kb.20.02.1998 12:33скачать
FIREWRKS.GIF37kb.20.02.1998 12:32скачать
FLAME1.GIF12kb.20.02.1998 13:07скачать
FLAME2.GIF4kb.20.02.1998 13:06скачать
FLAME3.GIF22kb.20.02.1998 13:07скачать
FLAME.GIF21kb.20.02.1998 12:30скачать
FLAMM~72.GIF7kb.20.02.1998 12:23скачать
FLIKER.GIF40kb.20.02.1998 13:07скачать
NUCLEAR.GIF34kb.20.02.1998 12:22скачать
RTORCH.GIF9kb.20.02.1998 12:19скачать
TORCH1.GIF16kb.20.02.1998 13:07скачать
TORCH.GIF12kb.20.02.1998 12:21скачать
TORCHSM.GIF16kb.20.02.1998 12:20скачать
ANIMDIAB.GIF26kb.20.02.1998 13:06скачать
BCROSS.GIF21kb.20.02.1998 13:06скачать
BLACK~10.GIF15kb.20.02.1998 13:05скачать
BONED~12.GIF23kb.20.02.1998 13:05скачать
BUTCHER.GIF15kb.20.02.1998 13:04скачать
CHESS.GIF23kb.20.02.1998 13:04скачать
DEDDI~20.GIF83kb.20.02.1998 12:49скачать
DIABL~24.GIF67kb.20.02.1998 13:03скачать
DIABL~26.GIF65kb.20.02.1998 13:12скачать
DIABL~28.GIF25kb.20.02.1998 13:02скачать
DIABL~30.GIF69kb.20.02.1998 13:06скачать
DNTIGER1.GIF16kb.20.02.1998 13:00скачать
DOOM2.GIF5kb.20.02.1998 13:00скачать
DRUIDD.GIF67kb.20.02.1998 13:03скачать
EXPLO~42.GIF26kb.20.02.1998 12:59скачать
FIGHTER.GIF8kb.20.02.1998 12:58скачать
GANGS.GIF47kb.25.02.1999 17:37скачать
INCIN~48.GIF21kb.20.02.1998 16:07скачать
INVIS~50.GIF12kb.20.02.1998 12:58скачать
KNIGHT.GIF35kb.20.02.1998 13:05скачать
LAZARUS.GIF21kb.20.02.1998 13:00скачать
LORDS~56.GIF25kb.20.02.1998 12:58скачать
MAGEAT.GIF19kb.20.02.1998 12:53скачать
MAGE.GIF30kb.20.02.1998 12:53скачать
MAGICIAN.GIF50kb.20.02.1998 13:02скачать
PEN.GIF27kb.20.02.1998 12:52скачать
PENTA~68.GIF3kb.20.02.1998 12:51скачать
PENTA~70.GIF11kb.20.02.1998 12:51скачать
QUAKE.GIF13kb.20.02.1998 12:51скачать
RAD.GIF10kb.20.02.1998 12:51скачать
ROGUEBOW.GIF12kb.20.02.1998 12:51скачать
SCORPIO.GIF14kb.20.02.1998 12:51скачать
SKULL~84.GIF5kb.20.02.1998 12:50скачать
SKULL~86.GIF9kb.20.02.1998 12:50скачать
SORCERF.GIF19kb.20.02.1998 12:50скачать
SUB-ZERO.GIF13kb.20.02.1998 12:52скачать
SUCCUBUS.GIF14kb.20.02.1998 12:50скачать
UNRAV~96.GIF9kb.20.02.1998 12:50скачать
UO.GIF13kb.20.02.1998 12:50скачать
WARRIORA.GIF17kb.20.02.1998 12:50скачать
WARRIORB.GIF19kb.20.02.1998 12:49скачать
WARRIOR.GIF19kb.20.02.1998 12:49скачать
HAND1.GIF37kb.20.02.1998 12:46скачать
HAND3.GIF55kb.20.02.1998 12:47скачать
HAND.GIF23kb.20.02.1998 12:46скачать
HANDS.GIF24kb.20.02.1998 12:45скачать
HANDWAVE.GIF17kb.20.02.1998 12:45скачать
HEART2.GIF10kb.20.02.1998 18:55скачать
ABELLL~6.GIF25kb.23.02.1998 04:29скачать
ABELLR~8.GIF24kb.23.02.1998 04:39скачать
XMASLT2.GIF21kb.23.02.1998 02:42скачать
hoparlor.gif10kb.02.04.1998 15:11скачать
hot_mix.gif20kb.09.06.1998 14:04скачать
line13.gif15kb.18.04.1998 02:16скачать
mailmove.gif7kb.18.05.1998 02:36скачать
1P_LVER1.GIF61kb.24.02.1998 19:22скачать
ALARMCL.GIF8kb.24.02.1998 19:20скачать
ANADIM.GIF29kb.24.02.1998 19:21скачать
ART.GIF33kb.24.02.1998 19:19скачать
ASTER.GIF13kb.24.02.1998 19:19скачать
BLOB.GIF5kb.24.02.1998 19:04скачать
BRUSH.GIF30kb.24.02.1998 19:04скачать
C_FAN.GIF13kb.24.02.1998 19:03скачать
CLAP.GIF49kb.24.02.1998 19:03скачать
$.GIF30kb.24.02.1998 19:22скачать
GUNANIM.GIF9kb.24.02.1998 18:51скачать
LLRINGS.GIF31kb.25.02.1998 05:16скачать
LOOKER1.GIF2kb.25.02.1998 05:16скачать
M14.GIF9kb.25.02.1998 05:16скачать
PLAYBOY.GIF9kb.24.02.1998 00:38скачать
RCHAIR.GIF30kb.24.02.1998 00:37скачать
REDRINGS.GIF37kb.24.02.1998 00:36скачать
RFHEA~40.GIF19kb.24.02.1998 00:37скачать
RING_ANM.GIF9kb.24.02.1998 00:36скачать
ROSE01.GIF22kb.24.02.1998 00:35скачать
STARR.GIF138kb.24.02.1998 00:32скачать
MOV11.GIF5kb.03.04.1998 17:10скачать
mp3cd.gif30kb.20.11.1998 05:07скачать
newSmCLR.gif2kb.18.06.1998 21:07скачать
PERL.GIF32kb.02.04.1998 15:20скачать
pulsar1.gif12kb.17.01.1998 21:25скачать
ATOM1.GIF7kb.24.02.1998 21:00скачать
ATOM2.GIF37kb.24.02.1998 21:00скачать
ATOM3.GIF25kb.24.02.1998 21:00скачать
NUC_AN3.GIF12kb.24.02.1998 20:59скачать
SPIKES.GIF15kb.24.02.1998 20:59скачать
DANCIN~8.GIF34kb.24.02.1998 20:54скачать
SKELE~14.GIF7kb.24.02.1998 20:52скачать
SKELE~16.GIF66kb.24.02.1998 20:52скачать
SKELEDAN.GIF22kb.24.02.1998 20:53скачать
SKELETON.GIF70kb.24.02.1998 20:54скачать
SKULL1.GIF40kb.24.02.1998 20:52скачать
SKULL2.GIF31kb.24.02.1998 20:52скачать
SKULL33.GIF4kb.24.02.1998 20:49скачать
SKULL3.GIF13kb.24.02.1998 20:50скачать
SKULL.GIF46kb.24.02.1998 20:51скачать
Smile.gif2kb.03.04.1998 17:10скачать
SMILELY.GIF1kb.03.04.1998 17:10скачать
ABDUCT~6.GIF33kb.24.02.1998 20:50скачать
ALIEN1.GIF14kb.24.02.1998 20:49скачать
ALIEN2.GIF17kb.24.02.1998 20:49скачать
ALIENBAL.GIF33kb.24.02.1998 20:49скачать
AL_IEN.GIF6kb.24.02.1998 20:49скачать
ALIEN.GIF15kb.24.02.1998 20:49скачать
ALION.GIF5kb.24.02.1998 20:47скачать
BORGSHIP.GIF121kb.24.02.1998 20:48скачать
COOL_D1.GIF15kb.24.02.1998 20:47скачать
FLASH.GIF5kb.24.02.1998 20:46скачать
FLYIN~30.GIF6kb.24.02.1998 20:46скачать
GBOWL.GIF22kb.24.02.1998 20:46скачать
KLINGON.GIF33kb.24.02.1998 20:45скачать
LIGHTMAN.GIF126kb.24.02.1998 20:47скачать
MECH10.GIF35kb.24.02.1998 20:40скачать
MECH1.GIF7kb.24.02.1998 20:43скачать
MECH2.GIF54kb.24.02.1998 20:45скачать
MECH3.GIF56kb.24.02.1998 20:43скачать
MECH4.GIF55kb.24.02.1998 20:43скачать
MECH5.GIF37kb.24.02.1998 20:41скачать
MECH6.GIF53kb.24.02.1998 20:42скачать
MECH7.GIF62kb.24.02.1998 20:41скачать
MECH8.GIF60kb.24.02.1998 20:41скачать
MECH9.GIF15kb.24.02.1998 20:39скачать
NXTGEN.GIF53kb.24.02.1998 20:38скачать
R2D2.GIF146kb.24.02.1998 20:39скачать
REDSHIP.GIF95kb.24.02.1998 20:37скачать
SHIPANI.GIF39kb.24.02.1998 20:34скачать
SHIP.GIF96kb.24.02.1998 20:36скачать
SPACE~84.GIF27kb.24.02.1998 20:29скачать
SPACE~90.GIF76kb.24.02.1998 20:31скачать
SPACE~92.GIF46kb.24.02.1998 20:27скачать
SPACE.GIF111kb.24.02.1998 20:34скачать
SPSHIP10.GIF10kb.24.02.1998 20:16скачать
SPSHIP12.GIF44kb.24.02.1998 19:44скачать
SPSHIP1.GIF28kb.24.02.1998 20:24скачать
SPSHIP2.GIF104kb.24.02.1998 20:24скачать
SPSHIP3.GIF18kb.24.02.1998 20:22скачать
SPSHIP4.GIF67kb.24.02.1998 20:22скачать
SPSHIP6.GIF36kb.24.02.1998 20:21скачать
SPSHIP7.GIF36kb.24.02.1998 20:20скачать
SPSHIP8.GIF114kb.24.02.1998 20:21скачать
SPSHIP9.GIF42kb.24.02.1998 20:18скачать
SPSHIP.GIF84kb.24.02.1998 20:26скачать
STARBADG.GIF14kb.24.02.1998 19:43скачать
STARWARS.GIF102kb.24.02.1998 19:42скачать
TIEF~130.GIF74kb.24.02.1998 19:42скачать
TREK.GIF21kb.24.02.1998 19:39скачать
VOYBAR2.GIF17kb.24.02.1998 19:38скачать
WINK~142.GIF19kb.24.02.1998 19:38скачать
XWINGS.GIF25kb.24.02.1998 19:38скачать
Spicker.gif6kb.03.11.1998 16:03скачать
thatsall200.gif21kb.13.12.1998 12:43скачать
CAMERA1.GIF108kb.25.02.1998 05:13скачать
XFILES.GIF25kb.25.02.1998 05:09скачать
under5.gif6kb.13.04.1998 00:28скачать
LIGHT~14.GIF37kb.25.02.1998 05:13скачать
LIGHT~18.GIF42kb.25.02.1998 05:13скачать
TWISTER2.GIF13kb.25.02.1998 05:09скачать
задание СПС лаб6.doc27kb.20.04.2005 11:14скачать
1. РАЗРАБОТКА СПРАВОЧНЫХ HTML-СИСТЕМ.DOC103kb.24.02.2001 09:44скачать
2. ОБЗОР СИСТЕМЫ HTML HELP.DOC95kb.24.02.2001 07:47скачать
3. Работа с HTML Work Shop.doc225kb.28.03.2005 11:56скачать
4. ИНФОРМАЦИОННЫЕ МАТЕРИАЛЫ HTML И ФАЙЛ ПРОЕКТА.DOC54kb.23.02.2001 11:07скачать
5. MICROSOFT HTML HELP.DOC263kb.24.02.2001 10:04скачать
Как организовать вызов дополнительного окна на гиперссылку.doc30kb.23.03.2005 22:33скачать
Добавление закладки ПОИСК в HTML-HELP.doc56kb.23.03.2005 23:01скачать
Создание Pop-Up окна в HTML-HELP файлах.doc53kb.21.03.2005 23:51скачать
Встраивание сценариев в HTML.doc27kb.28.03.2005 20:46скачать
Прочие элементы.doc26kb.27.03.2005 20:23скачать
Словарь по HTML для начинающих.doc43kb.28.03.2005 15:06скачать
Таблица цветов RGB и HTML.doc232kb.28.03.2005 15:15скачать
1. Добавление Flash к Html-Help.doc43kb.27.03.2005 18:59скачать
2. Подключение Flash к html.doc41kb.26.03.2005 10:27скачать
3. Атрибуты тэгов OBJECT и EMBED.doc76kb.26.03.2005 01:00скачать
Hh_C++.pdf77kb.12.02.2001 06:56скачать
Hh_VB.pdf60kb.12.02.2001 06:56скачать
1. ИСПОЛЬЗОВАНИЕ HTML HELP В ПРИЛОЖЕНИЯХ НА VISUAL BASIC.DOC123kb.24.05.2005 19:31скачать
2. Добавление HTML Help в приложение VB 6.0.doc28kb.02.04.2010 11:57скачать
3. Как вызывать help из приложения С++.doc48kb.06.03.2005 10:05скачать
4. Использование HTML Help в проекте MFC.doc29kb.17.03.2005 14:52скачать
Теги HTML.doc1691kb.31.03.2006 14:36скачать
01. Все, что нужно знать о программировании в Macromedia Flash.doc178kb.04.05.2005 14:38скачать
02. СПРАВОЧНИК по программированию во FLASH.doc407kb.04.05.2005 14:37скачать
03. ОБЪЕКТНО ОРИЕНТИРОВАННОЕ ПРОГРАММИРОВАНИЕ в ACTION SCRIPT.doc605kb.03.05.2005 17:24скачать
04. Программирование клиентских приложений с использованием Macromedia Flash.doc133kb.28.03.2005 19:09скачать
05. ЯЗЫК ACTION SCRIPT.doc2998kb.20.04.2005 10:27скачать
06. ActionScript - во Flash.doc104kb.30.03.2005 11:08скачать
07. Отладка во Flash 5.doc124kb.01.03.2004 11:23скачать
08. Обнаружение ошибок в именах переменных Actionscript.doc26kb.26.11.2003 10:45скачать
09. Создание элементов сайтов с использованием Flash.doc133kb.28.03.2005 19:20скачать
10. Программное создание часов во Flash.doc76kb.28.03.2005 19:24скачать
11. Программирование во Flash.doc54kb.01.03.2004 10:54скачать
12. Стандарты Actionscript.doc218kb.26.03.2005 01:07скачать

05. ЯЗЫК ACTION SCRIPT.doc

1   ...   74   75   76   77   78   79   80   81   82
Реклама MarketGid:
Загрузка...

Availability


Flash 5

Synopsis


theNode.firstChild

Access


Read-only

Description


The firstChild property is synonymous with childNodes[0]. It returns a reference to the first node object that descends from theNode. If theNode has no children, firstChild returns null.

In this XML source fragment, the firstChild of the MESSAGE node is the text node with the nodeValue "hey":

<!-- Fragment 1 -->

<MESSAGE>hey</MESSAGE>

Here, the firstChild of the HOTEL node is the ROOM node:

<!-- Fragment 2 -->

<HOTEL><ROOM><SIZE>Double</SIZE></ROOM></HOTEL>

When theNode is the top of the object hierarchy (i.e., refers to the XML document object), firstChild may not always be a reference to the first useful element in the document. If a document includes an XML delcaration (<?xml version="1.0"?>) and perhaps a DOCTYPE tag, there are normally whitespace nodes before the actual root element of the XML hierarchy. However, if an XML fragment has no XML declaration and no DOCTYPE, we can start processing it with the document's firstChild node, as in:

// Create a new XML fragment

myDoc = new XML('<MESSAGE><USER>gray</USER><CONTENT>hi</CONTENT></MESSAGE>');


// Store the XML fragment's first node in the variable msg

msg = myDoc.firstChild;


// Assign the text contained by the USER tag

// to a text field called userNameOutput

userNameOutput = msg.firstChild.firstChild.nodeValue;

It's good form, but not actually necessary, to use nodeValue to access the text contained by the USER tag. When we use a text-node object in a string context, the toString( ) method is automatically invoked on that node, and the text in the node is returned.

See Also


XML.childNodes, XML.lastChild, XML.nextSibling, XML.previousSibling

XML.hasChildNodes( ) Method

check if a node has any descendants








Availability


Flash 5

Synopsis


theNode.hasChildNodes()

Returns


A Boolean: true if theNode has any children; false if it does not.

Description


The hasChildNodes( ) method indicates whether any node hierarchy extends from a given node. It is synonymous with the comparison expression:

theNode.childNodes.length > 0

If theNode contains no subnodes, hasChildNodes( ) returns false.

Example


We can use hasChildNodes( ) to determine whether to operate on a node during node processing. For example, here we remove the nodes below the first child of a document until the first child has no more children:

while (myDoc.firstChild.hasChildNodes( )) {

myDoc.firstChild.firstChild.removeNode( );

}

See Also


XML.childNodes

XML.ignoreWhite Property

Determines whether to ignore whitespace nodes during XML parsing








Availability


Flash 5 Build 41 or later

Synopsis


XMLdoc.ignoreWhite

Access


Read/write

Description


The ignoreWhite property stores a Boolean that dictates whether to discard text nodes containing only whitespace during the parsing process. The default value is false (don't throw away whitespace nodes). This is a global setting that applies to an entire XML document, not just a specific node. That is, instances of the XMLnode class do not support ignoreWhite.

Example


To cause a single XML document to discard whitespace nodes during parsing, use:

myXML.ignoreWhite = true;

To cause all XML documents to discard whitespace nodes, use:

XML.prototype.ignoreWhite = true;

The ignoreWhite property should be set before any attempt at parsing XML occurs (typically due to a load( ) or sendAndLoad( ) operation).

See Also


See the examples under the XML Class entry for manual whitespace-stripping code

XML.insertBefore( ) Method

give a node a new previous sibling








Availability


Flash 5

Synopsis


theNode.insertBefore(newChild, beforeChild)

Arguments


newChild

An existing XML node object.

beforeChild

The child of theNode before which newChild should be inserted.

Description


The insertBefore( ) method adds newChild to theNode's child list, before beforeChild . The insertBefore( ) method is similar to appendChild( ) but lets us precisely position a new node in an existing XML object hierarchy.

Example


// Create a document

myDoc = new XML('<P>paragraph 2</P>');


// Create a P node and a text node

newP = myDoc.createElement("P");

newText = myDoc.createTextNode("paragraph 1");


// Append the text node to the P node

newP.appendChild(newText);


// Insert the new P node (including its text child) before the existing P

myDoc.insertBefore(newP, myDoc.firstChild);


trace(myDoc); // Displays: "<P>paragraph 1</P><P>paragraph 2</P>"

See Also


XML.appendChild( )

XML.lastChild Property

a reference to the last descendant of a node








Availability


Flash 5

Synopsis


theNode.lastChild

Access


Read-only

Description


The lastChild property is synonymous with childNodes[childNodes.length-1]. It returns a reference to the last node object that descends from theNode. If theNode has no children, lastChild returns null.

In the following XML source fragment, the lastChild of the MESSAGE node is the CONTENT node:

<MESSAGE><USER>gray</USER><CONTENT>hi</CONTENT></MESSAGE>

Example


// Create a new XML document

myDoc = new XML('<MESSAGE><USER>gray</USER><CONTENT>hi</CONTENT></MESSAGE>');


// Sets msg to "hi" because myDoc's firstChild

// is MESSAGE, MESSAGE's lastChild is CONTENT, and CONTENT's firstChild

// is the text node with the value "hi"

msg = myDoc.firstChild.lastChild.firstChild.nodeValue

See Also


XML.childNodes, XML.firstChild, XML.nextSibling, XML.previousSibling

XML.load( ) Method

import XML source code from an external document








Availability


Flash 5

Synopsis


XMLdoc.load(URL)

Arguments


URL

A string specifying the location of the XML document to load.

Description


The load( ) method imports an external XML document, parses it, converts it into an XML object hierarchy, and places that hierarchy into XMLdoc. Any previous contents of XMLdoc are replaced by the newly loaded XML content.

XMLdoc must be an instance of the XML class, not the XMLnode class.

Usage


Before accessing content imported with load( ), we must be sure the load and parsing operations are complete. To do so, either check the value of the XML document's loaded property, or assign the document an onLoad( ) callback handler to respond to the load completion. See the XML.loaded and XML.onLoad( ) entries for details. To determine whether the loaded data was successfully parsed, check the document's status property.

XML.load( ) is subject to the domain-based security restrictions described in Table 20-8 under the global loadVariables( ) function.

Example


myDoc = new XML( );

myDoc.load("myData.xml");

See Also


XML.loaded, XML.onLoad( ), XML.sendAndLoad( ), XML.status

XML.loaded Property

status of a load( ) or sendAndLoad( ) operation








Availability


Flash 5

Synopsis


XMLdoc.loaded

Access


Read-only

Description


The loaded property returns a Boolean value indicating whether a previously invoked load( ) or sendAndLoad( ) operation on XMLdoc has completed. It is immediately set to false when an XML load( ) or sendAndLoad( ) operation is initiated. If the load is successful, loaded is later set to true. If no such operation has ever been executed on XMLdoc, loaded is undefined.

When loaded is false, the download and parsing of XML data is still in progress, and attempts to access the object hierarchy in XMLdoc will fail. When loaded is true, XML data has finished being downloaded, parsed, and stored in XMLdoc as an object hierarchy. Note, however, that the loaded XML data may not have been parsed successfully (use XMLdoc.status to determine whether it was).

XMLdoc must be an instance of the XML class, not the XMLnode class.

Example


The following example shows a basic XML preloader that waits for the XML data to be loaded before displaying it (XML preloaders may also be built using an XML.onLoad( ) handler):


// CODE ON FRAME 1

// Create a new XML document

myDoc = new XML( );

// Load an external XML file into the document

myDoc.load("userProfile.xml");


// CODE ON FRAME 5

// Check if the data has loaded. If so, go to the display frame.

// If not, loop back to frame 4 and then play.

// Loop until the data is done loading...

if (myDoc.loaded) {

if (myDoc.status == 0) {

gotoAndStop("displayData");

} else {

gotoAndStop("loadingError");

}

} else {

gotoAndPlay(4);

}

See Also


XML.load( ), XML.onLoad( ), XML.sendAndLoad( )

XML.nextSibling Property

a reference to the node after this node








Availability


Flash 5

Synopsis


theNode.nextSibling

Access


Read-only

Description


The nextSibling property returns the node object after theNode in the current level of the XML object hierarchy. If there is no node after theNode, nextSibling returns null. In the following XML source fragment, the CONTENT node is the nextSibling of the USER node:

<MESSAGE><USER>gray</USER><CONTENT>hi</CONTENT></MESSAGE>

Example


The nextSibling property is typically used to traverse (move through) an XML object hierarchy. For example, to view all the children of theNode in the order they appear, we may use:

for (var child = theNode.firstChild; child != null; child = child.nextSibling) {

trace("found node: " + child.nodeName);

}

By extending our loop into a function, we can recursively traverse every node in an XML object hierarchy, as follows:

function showNodes (node) {

trace(node.nodeName + ": " + node.nodeValue);

for (var child = node.firstChild; child != null; child = child.nextSibling) {

showNodes(child);

}

}


// Invoke the function on our node or document

showNodes(myDoc);

Note that in both traversal examples shown, text nodes show up without a name as described under the nodeName entry.

See Also


XML.childNodes, XML.firstChild, XML.lastChild, XML.nodeName, XML.nodeValue, XML.previousSibling

XML.nodeName Property

the name of the current node








Availability


Flash 5

Synopsis


theNode.nodeName

Access


Read/write

Description


The nodeName string property reflects the name of theNode. Since only two node types are supported by ActionScript (element nodes and text nodes), nodeName has only two possible values:

  • If theNode is an element node, nodeName is a string matching the tag name of that element. For example, if theNode represents the element <BOOK>, then theNode.nodeName is "BOOK".

  • If theNode is a text node, nodeName is null. Note that this diverges from the DOM specification, which stipulates that nodeName for a text node should be the string "#text". If you prefer, you can use the DOM-compliant nodeType property instead.

Example


We can use nodeName to check whether the current node is the type of element we're seeking. For example, here we extract all the content of H1 tags on the first level of an XML document (this example checks only for tags named H1, not for tags named h1 with a lowercase h):

myDoc = new XML('<H1>first heading</H1><P>content</P>' +

'<H1>second heading</H1><P>content</P>');

for (i = 0; i < myDoc.childNodes.length; i++) {

if (myDoc.childNodes[i].nodeName == "H1") {

trace(myDoc.childNodes[i].firstChild.nodeValue);

}

}

See Also


XML.nodeType, XML.nodeValue

XML.nodeType Property

the type of the current node








Availability


Flash 5

Synopsis


theNode.nodeType

Access


Read-only

Description


The nodeType is an integer property that returns theNode's type. Since only two node types are supported by ActionScript -- element nodes and text nodes -- nodeName has only two possible values: 1, if the node is an element node; and 3, if the node is a text node. These values may seem arbitrary, but they are actually the appropriate values as stipulated by the DOM. For reference, the other node types in the DOM are listed in Table 20-13.

Table 20-13. DOM Node Types


^ Node Description

Node Type Code

ELEMENT_NODE*

1

ATTRIBUTE_NODE

2

TEXT_NODE*

3

CDATA_SECTION_NODE

4

ENTITY_REFERENCE_NODE

5

ENTITY_NODE

6

PROCESSING_INSTRUCTION_NODE

7

COMMENT_NODE

8

DOCUMENT_NODE

9

DOCUMENT_TYPE_NODE

10

DOCUMENT_FRAGMENT_NODE

11

NOTATION_NODE

12

*Supported by Flash. Technically, ActionScript implements so-called attribute, document, and document_type nodes in addition to element and text nodes, but we don't have direct access to them as objects. For example, we may manipulate the attributes of a node through the attributes property, but we do not have direct access to attribute nodes themselves. Similarly, we have access to the DOCTYPE tag of a document through the docTypeDecl property, but we do not have direct access to document_type itself.

Element nodes correspond to XML or HTML tags. For example, in the XML fragment <P>what is your favorite color?</P>, the P tag would be represented in an XML object hierarchy as an element node (nodeType 1). The text contained by a tag in XML source code -- for example, the text "what is your favorite color?" -- would be represented as a text node (nodeType 3).

Example


We can conditionally operate on a node based on its nodeType. For example, here we remove all the empty text nodes that are children of theNode :

// Loop through all children of theNode

for (i = 0; i < theNode.childNodes.length; i++) {

// If the current node is a text node...

if (theNode.childNodes[i].nodeType == 3) {

// Check for any useful characters in the node

var j = 0;

var emptyNode = true;

for (j = 0; j < theNode.childNodes[i].nodeValue.length; j++) {

// Useful character codes start above ASCII 32

if (theNode.childNodes[i].nodeValue.charCodeAt(j) > 32) {

emptyNode = false;

break;

}

}

// No useful charaters were found, so delete the node

theNode.childNodes[i].removeNode( );

}

}

See Also


The XML Class, XML.nodeName, XML.nodeValue

XML.nodeValue Property

the value of the current node








Availability


Flash 5

Synopsis


theNode.nodeValue

Access


Read/write

Description


The nodeValue property reflects the string value of theNode. Since only two node types (element nodes and text nodes) are supported by ActionScript, nodeValue has only two possible values:

  • If theNode is an element node, nodeValue is null.

  • If theNode is a text node, nodeValue is the text contained by the node.

In practice, nodeValue is normally used only with text nodes. To assign new text to an existing text node, we use nodeValue as follows:

// Create a new XML document

myDoc = new XML('<H1>first heading</H1><P>content</P>');


// Change the text contained by the H1 tag

myDoc.firstChild.firstChild.nodeValue = "My Life Story";

Although we may explicitly retrieve the value of a text node using nodeValue, the toString( ) method implicitly returns a node's value when it is used in a string context. Therefore, this code displays the text node's text in the Output window:

trace(myDoc.firstChild.firstChild);

See Also


XML.nodeName, XML.nodeType

XML.onData( ) Event Handler

executed when external XML source code finishes loading, but has not yet been parsed








Availability


Flash 5 (undocumented)

Synopsis


XMLdoc.onData(src);

Arguments


src

A string containing the loaded XML source code.

Description


The onData( ) handler executes automatically whenever raw XML source has finished loading into XMLdoc due to an earlier load( ) or sendAndLoad( ) invocation. By default, onData( ) has the following behavior:

  • If the raw source received is undefined, it calls XMLdoc.onLoad( ) with the success parameter set to false.

  • Otherwise, it parses the source into XMLdoc, sets XMLdoc.loaded to true, and calls XMLdoc.onLoad( ) with the success parameter set to true.

The onData( ) handler may be assigned a custom callback function to intercept raw XML source code before ActionScript has a chance to parse it. Under certain circumstances, manipulating raw XML source manually may offer improved performance over ActionScript's built-in parsing.

Example


The following example shows how to display raw loaded XML source while preventing it from being parsed by ActionScript:

myDoc = new XML();

myDoc.onData = function (src) {

trace("Here's the source: \n" + src);

};

myDoc.load("book.xml");

See Also


XML.onLoad( )

XML.onLoad( ) Event Handler

executed when external XML data has been loaded and parsed








Availability


Flash 5

Synopsis


XMLdoc.onLoad(success)

Arguments


success

A Boolean value indicating whether loading was successful (true) or failed (false).

Description


The onLoad( ) handler of XMLdoc is automatically executed whenever an external XML file is loaded into XMLdoc via the load( ) or sendAndLoad( ) methods. By default, the onLoad( ) handler of an XML document object is an empty function. To use onLoad( ), we assign it a callback handler (i.e., a custom-made function). For example:

myDoc = new XML( );

myDoc.onLoad = handleLoad;

function handleLoad (success) {

// Process XML as desired here...

}

We rely on onLoad( ) events to tell us when it's safe to process XMLdoc. If onLoad( ) is triggered, we know that the loading and parsing of external XML data have completed, so we may safely access that loaded content. The onLoad( ) handler, hence, alleviates the need to write preloading code to wait for data to arrive after the invocation of an XML load( ) function. For example, in the following code we load an XML document, and then we wait for our custom handleLoad( ) function to be automatically executed when loading completes. If loading was successful, we process our XML content with the display( ) function. Otherwise, we show an error message by executing the display( ) function. (The displayProduct( ) and displayError( ) functions are custom functions that you've presumably written to display information to the user, but they are not shown.)Here is the code:

myDoc = new XML( );

myDoc.onLoad = handleLoad;

myDoc.load("productInfo.xml");


function handleLoad(success) {

if (success) {

output = "Product information received";

displayProduct( ); // Call custom display function

} else {

output = "Attempt to load XML data failed";

displayError( ); // Call custom display function

}

}

Notice that the value of the success argument of handleLoad( ) is automatically set by the interpreter to either true or false, indicating whether or not loading completed properly. However, the success argument may appear more useful in theory than it turns out to be in practice. Most web server error messages (e.g., "404 File Not Found") come in the form of HTML documents. Since HTML can quite happily be parsed as XML data, the reception of a server error page results in the parsing of that page into the target XML document object. Because the page parses properly, the load attempt is considered "successful," and success is true, even though the actual XML file may not have been found or some other server error may have been encountered. To be positive that you have the real data you requested, test its structure or content explicitly for some identifying characteristic, such as the nodeName of a particular child. See also the XML.onData( ) event handler, which can be used to perform custom parsing.

See Also


XML.load( ), XML.onData( ), XML.sendAndLoad( )

XML.parentNode Property

a reference to the immediate ancestor of a node








Availability


Flash 5

Synopsis


theNode.parentNode

Access


Read-only

Description


The parentNode property returns a reference to the node object from which theNode descends in the XML object hierarchy. If theNode is the top of the current hierarchy, parentNode returns null.

In this XML source fragment, the MESSAGE node is the parentNode of text node "hey":

<MESSAGE>hey</MESSAGE>

Here the parentNode of the ROOM node is the HOTEL node:

<HOTEL><ROOM><SIZE>Double</SIZE></ROOM></HOTEL>

See Also


XML.childNodes, XML.firstChild, XML.lastChild, XML.previousSibling

XML.parseXML( ) Method

parse a string of XML source code








Availability


Flash 5

Synopsis


XMLdoc.parseXML(string)

Arguments


string

A string of XML source code.

Description


The parseXML( ) method is akin to an internal load( ) function; it reads and parses the XML source contained by string, converts that XML into an object hierarchy, and then places the resulting hierarchy into XMLdoc. Any previous contents of XMLdoc are replaced by the new hierarchy. XMLdoc must be an instance of the XML class, not the XMLnode class.

To include raw HTML or XML source code in a text node without parsing it, use a CDATA section as follows:

<![CDATA[ source ]]>

For example, the following code creates a MESSAGE element with a single child text node containing the text "<B>Welcome</B> to my site" (the <B> tag is not interpreted as an XML tag and does not become part of the XML object hierarchy):

myDoc = new XML( );

myDoc.parseXML("<MESSAGE><![CDATA[<B>Welcome</B> to my site]]></MESSAGE>");

trace(myDoc); // Displays: "<MESSAGE><B>Welcome</B> to my site</MESSAGE>"

Example


We can use parseXML( ) as a means of replacing the current object hierarchy in an XML object with a new hierarchy based on internally composed XML source code (for example, some user input). In the following example, we create a simple XML message by combining markup with input from text fields named username and content:

myDoc = new XML( );

myXMLsource = "<MESSAGE><USER>" + username + "</USER><CONTENT>"

+ content + "</CONTENT></MESSAGE>";

myDoc.parseXML(myXMLsource);

See Also


XML.load( ), XML.status

XML.previousSibling Property

a reference to the node before this node








Availability


Flash 5

Synopsis


theNode.previousSibling

Access


Read-only

Description


The previousSibling property returns a reference to the node object preceding theNode in the current level of the XML object hierarchy. If there is no node before theNode in the current level of the hierarchy, it returns null.

In the following XML source fragment, the previousSibling of the CONTENT node is the USER node:

<MESSAGE><USER>gray</USER><CONTENT>hi</CONTENT></MESSAGE>

Example


The previousSibling property can be used to traverse an XML object hierarchy, although nextSibling is more commonly used for this purpose. To view all the children of theNode in reverse order, we may use:

for (var i = theNode.lastChild; i != null; i = i.previousSibling) {

trace("found node: " + i.nodeName);

}

See Also


XML.childNodes, XML.firstChild, XML.lastChild, XML.nextSibling, XML.nodeName, XML.nodeValue, XML.parentNode

XML.removeNode( ) Method

delete a node from an XML object hierarchy








Availability


Flash 5

Synopsis


theNode.removeNode()

Description


The removeNode( ) method deletes theNode from an XML document. All descendants (children, grandchildren, and so on) of theNode are also deleted. The childNodes property of theNode's parent is automatically updated to reflect the new structure of the remaining object hierarchy.

Example


Here we delete the second child node; the third child node takes its place:

myDoc = new XML("<P>one</P><P>two</P><P>three</P>");

myDoc.childNodes[1].removeNode( );

trace(myDoc); // Displays: "<P>one</P><P>three</P>"

See Also


XML.appendChild( )

XML.send( ) Method

send XML source code to a script








Availability


Flash 5

Synopsis


XMLdoc.send(URL, window)

Arguments


URL

A string specifying the location of a script or application to which XMLdoc should be sent.

window

A required string, specifying the name of the browser window or frame into which to load the script's response. May be a custom name or one of the four presets: "_blank", "_ parent", "_self", or "_top". For details, see the description of the window settings under the global getURL( ) function.

Description


The send( ) method converts XMLdoc into a string of XML source code and sends that code in an HTTP request to the script or application residing at URL. The script or application is expected to process the XML in some way and optionally return a response -- normally a web page -- to the browser, which displays it in window. Note that the response is not caught by Flash but by the browser; use sendAndLoad( ) to catch the response within Flash.

When XML.send( ) is invoked from the Flash Player running in a browser, XMLdoc is sent via the POST method. When XML.send( ) is invoked from the Flash Player running as a standalone application, XMLdoc is sent via the GET method. The server application receiving the posted XML string must be able to access the raw POST data of the HTTP request directly and should not attempt to parse it as normal name/value pairs. In Perl, the data in a POST request is available from STDIN, and may be extracted and stored in, say, $buffer as follows:

read(STDIN,$buffer,$ENV{'CONTENT_LENGTH'});

In ASP, raw POST data may be accessed via the Request.BinaryRead method. Some applications (e.g., Cold Fusion) may not have a direct means of accessing the data in a POST request. For these situations, it may be necessary to first convert the XML object to a string using XML.toString( ) and then pass that string to the server as a variable using loadVariables( ).

The default MIME content type of the XML text sent to the server is application/x-www-urlform-encoded. This type, however, is only cosmetic -- the text itself is not URL-encoded. In Build 41 and later of the Flash 5 Player, the MIME content type can be modified using the XML.contentType property. For example, to set the MIME type to application/xml, we use:

myXML = new XML( );

myXML.contentType = "application/xml";

Nevertheless, setting the contentType property explicitly to application/x-www-urlform-encoded still does not cause the text sent to be URL-encoded.

Note that as of Build 41 of the Flash 5 Player, when XML source is parsed and the characters &, ', ", <, and > appear in a text node, they are converted to the following entities: &amp;, &apos;, &quot;, &gt;, &lt;. This conversion is transparent in Flash because the entities are converted back to their original characters when an XML object is converted to a string; however, the entities will show up in XML source sent to the server.

Example


myDoc = new XML("<SEARCH_TERM>tutorials</SEARCH_TERM>");

myDoc.send("http://www.domain.com/cgi-bin/lookup.cgi", "remoteWin");

See Also


XML.sendAndLoad( ), XML.load( ), XML.loaded, XML.onLoad( ), XML.status

XML.sendAndLoad( ) Method

send XML source code to a script, and receive XML source in return








Availability


Flash 5

Synopsis


XMLdoc.sendAndLoad(URL, resultXML)

Arguments


URL

A string specifying the location of a script or application to which XMLdoc should be sent.

resultXML

A reference to an XML document object that will receive the returned XML source code.

Description


The sendAndLoad( ) method serializes XMLdoc into a string of XML source code and sends that code to a script or application that resides at URL. The script or application is expected to process the XML in some way and send an XML document back as a response. The response document is caught by Flash, parsed, converted into an XML object hierarchy, and placed in resultXML. Any previous contents of resultXML are replaced by the newly loaded XML content. See XML.send( ) for important information about sending XML to a server.

Usage


Before accessing content imported with sendAndLoad( ), we must be sure that the load and parsing operations are complete. To do so, we either check the value of the resultXML's loaded property or we assign resultXML an onLoad( ) event handler to respond to the load completion. See the XML.loaded and XML.onLoad( ) entries for details. To determine the result of parsing the loaded data, we check the document's status property.

XML.sendAndLoad( ) is subject to the domain-based security restrictions described in Table 20-8 under the global loadVariables( ) function.

Example


// Create an XML document

myDoc = new XML("<P>hello server!</P>");


// Create an empty XML document to receive the server's response

serverResponse = new XML( );


// Send myDoc to the server, and place the response in serverResponse

myDoc.sendAndLoad("http://www.domain.com/cgi-bin/readData.cgi", serverResponse);


// Add an onLoad handler to serverResponse that displays the response

// from the server in the text field output.

serverResponse.onLoad = function ( ) {

output = serverResponse.toString( );

}

For a good primer on sending XML to and from a server, see Macromedia's article "Integrating XML and Flash in a Web Application," at:

http://www.macromedia.com/support/flash/interactivity/xml

See Also


XML.load( ), XML.loaded, XML.onLoad( ), XML.send( ), XML.status

XML.status Property

indicates whether parsing XML source into an object hierarchy was successful








Availability


Flash 5

Synopsis


XMLdoc.status

Access


Read-only

Description


The status property returns a numeric status code indicating whether any errors were encountered when parsing XML source code. Parsing occurs when source XML is:

  • Provided as an argument to the XML( ) constructor

  • Explicitly parsed via the parseXML( ) method

  • Loaded into a new XML object via the load( ) or sendAndLoad( ) methods

The status codes are shown in Table 20-14. If no errors were encountered in parsing, success is indicated by a status of 0. Errors are indicated by negative numbers. Parsing terminates once the first error is encountered, so other errors may surface even after you address previously reported errors.

Table 20-14. XML Parsing Status Codes


Status

Description

0

The document parsed without errors (i.e., success).

-2

A CDATA section was not properly terminated.

-3

The XML declaration was not properly terminated.

-4

The DOCTYPE declaration was not properly terminated.

-5

A comment was not properly terminated.

-6

An XML element was malformed.

-7

Not enough memory to parse the XML source.

-8

An attribute value was not properly terminated.

-9

A start tag had no corresponding end tag.

-10

An end tag had no corresponding start tag.

We normally use status to determine whether it's safe to proceed with processing an externally loaded XML file. Check the loaded property to ensure that a load( ) or sendAndLoad( ) command has completed before checking the status. Note that ActionScript's XML parser does not validate documents against DTDs, it only verifies well-formedness.

Example


myDoc = new XML("<BOOK>Colin Moock</AUTHOR></BOOK>");

trace(myDoc.status); // Displays: "-10" (missing start tag)

See Also


XML.load( ), XML.loaded, XML.onLoad( ), XML.parseXML( ), XML.sendAndLoad( )

XML.toString( ) Method

the source code of the XML node, as a string








Availability


Flash 5

Synopsis


theNode.toString()

Returns


A string representing the source code of the XML object hierarchy starting at theNode.

Description


The toString( ) method converts an XML node object or an XML document object to its analogous XML source code. If theNode is a top-level XML document object, any DOCTYPE and XML declaration tags are included in the string. If the document's ignoreWhite property is false, whitespace is preserved and the document source code appears as it did when it was parsed.

It's not normally necessary to invoke toString( ) explicitly; toString( ) is automatically invoked any time theNode is used in a string context.

Example


var myDoc = new XML('<?xml version="1.0"?><!DOCTYPE foo SYSTEM "bar.dtd"><BOOK>

<TITLE>ActionScript: The Definitive Guide</TITLE>'

+ '<AUTHOR SALUTATION="Mr">Colin Moock </AUTHOR> '

+ '<PUBLISHER>O\'reilly & Associates, Inc</PUBLISHER> </BOOK>');


trace(myDoc.toString( ));

// Displays:

<?xml version="1.0"?><!DOCTYPE foo SYSTEM "bar.dtd">

<BOOK> <TITLE>ActionScript:

The Definitive Guide</TITLE><AUTHOR SALUTATION="Mr">Colin

Moock </AUTHOR> <PUBLISHER>O'reilly & Associates, Inc

</PUBLISHER> </BOOK>

See Also


Object.toString( ), XML.nodeValue

XML.xmlDecl Property

the document's XML declaration tag








Availability


Flash 5

Synopsis


XMLdoc.xmlDecl

Access


Read/write

Description


The xmlDecl string property represents the XML declaration tag of XMLdoc, if any exists. Otherwise, xmlDecl is undefined . XMLdoc must be the top-level node in an XML object hierarchy (that is, an instance of the XML class, not the XMLnode class.)

The XML declaration tag of an XML document is used to identify the version of XML being used in the document. We use the XML declaration tag to build well-formed XML documents that may be validated externally.

Example


// A well-formed document (but not validated against a DTD)

myXML = new XML('<?xml version="1.0"?><P>this is a short document</P>');

trace(myXML.xmlDecl); // Displays: "<?xml version="1.0"?>"

// Set a new XML declaration

myXML.xmlDecl = '<?xml version="1.0" standalone="no"?>';

See Also


XML.docTypeDecl

XMLnode Class

Internal superclass of the XML class








Availability


Flash 5

Description


The XMLnode class defines the core properties and methods of nodes in an XML object hierarchy. Though XMLnode is an internal device, it may be used by programmers to extend the default functionality of XML objects.

Every XML object hierarchy technically includes two kinds of object nodes:

  • One XML node, that serves as the main container for the hierarchy

  • An arbitrary number of XMLnode nodes, which are the children of the main container node

The main container node is an instance of the XML class. For example, if we create myDoc as follows:

myDoc = new XML();

then myDoc is an instance of the XML class. The XML class inherits from the XMLnode class, so main container nodes have all the properties and methods defined by XMLnode plus those defined by XML. By contrast, the children of myDoc would actually be instances of the XMLnode class, not the XML class.

So, if we create myParagraph as follows:

myParagraph = myDoc.createElement("P");

then myParagraph is an instance of the XMLnode class. Most of the time the internal distinction between node classes does not affect our use of XML objects. However, if we wish to add an inherited property or method to all XML objects, then we must use the XMLnode class's prototype, not the XML class's prototype (see the example that follows). Any methods or properties attached to XMLnode.prototype are inherited by all XML nodes in a movie.

For reference, the properties, methods, and event handlers defined by XMLnode and XML are listed in Table 20-15. Note that while all listed items are accessible through instances of the XML class, items defined by XML are not available through instances of XMLnode. For example, the load( ) method may be invoked on an instance of the XML class, but not on an instance of the XMLnode class. For a full discussion of each item, see the appropriate XML class entry.

Table 20-15. XMLnode and XML Properties, Methods, and Event Handlers


^ XMLnode and XML

XML only

appendChild( )

contentType

attributes

createElement( )

childNodes

createTextNode( )

cloneNode( )

docTypeDecl

firstChild

ignoreWhite

hasChildNodes( )

load( )

insertBefore( )

loaded

lastChild

onData( )

nextSibling

onLoad( )

nodeName

parseXML( )

nodeType

send( )

nodeValue

sendAndLoad( )

parentNode

status

previousSibling

xmlDecl

removeNode( )




toString( )



Example


The following code adds a custom secondChild( ) method to XMLnode.prototype (the secondChild( ) method is subsequently available from any XML node in our movie):

XMLnode.prototype.secondChild = function () {

return this.childNodes[1];

};


myDoc = new XML("<PRODUCT>Cell Phone</PRODUCT><PRODUCT>Game Console </PRODUCT>");


trace(myDoc.secondChild()); // Displays: "<PRODUCT>Game Console</PRODUCT>"

It's also perfectly legitimate to extend the XML class via XML.prototype, but such extensions apply only to main container nodes (direct instances of the XML class).

See Also


The XML Class; Section 12.5.4, "Superclasses and Subclasses" in Chapter 12, "Objects and Classes".

XMLSocket Class

support for a continuous server/client TCP/IP connection








Availability


Flash 5

Constructor


new XMLSocket()

Methods


close( )

Terminate an open connection to a server application.

connect( )

Attempt to establish a new connection to a server application.

send( )

Send an XML object hierarchy to a server application as a string.

Event handlers


onClose( )

Executes when the server terminates the connection.

onConnect( )

Executes when a connection attempt completes.

onData( )

Executes when data is received but has not yet been parsed as XML.

onXML( )

Executes when data has been received and parsed into an XML object hierarchy.

Description


The majority of connections between Flash and a server have a very short life span. When Flash requests external data via the loadMovie( ), loadVariables( ), or XML.load( ) functions, a temporary communication channel is established. Data is sent over that channel and then the channel is terminated. This kind of short-term communication has many useful applications, but it is also limited in two important ways:

  • Once the connection closes, the server has no way of contacting Flash. Flash must always initiate communication with the server.

  • Each time Flash obtains information from the server, a new connection must be opened. The time and processor load involved in opening repeated connections prevents Flash from engaging in anything near real-time transactions with a server.

As of Flash 5, we can overcome these limitations with the XMLSocket class, which allows us to open a persistent communication link between a server application and Flash. We use XMLSocket to develop systems that require frequent server updates, such as a chat room or a networked multiplayer game.

In order to connect to a remote application using XMLSocket, we must first create and store an XMLSocket object, like this:

mySocket = new XMLSocket( );

Then, we invoke the connect( ) method, which asks Flash to establish a communication link with the remote application. For example:

mySocket.connect("http://www.myserver.com", 8000);

Once a connection is established, the XMLsocket object acts as a transmitter/receiver. We send XML-formatted data to the remote application by invoking the socket's send( ) method, and we know that we've received XML-formatted data when the socket's onXML( ) event is triggered.

A server application used with an XMLSocket object must:

  • Serve TCP/IP socket connections on a specific port greater than or equal to 1024

  • Transmit XML-formatted data in segments delimited by a zero byte (i.e., the ASCII null character)

Server applications are typically created by server-side programmers, not Flash programmers. For an example of a simple server application that broadcasts all messages it receives to all connected clients, see the Java XMLSocket server available at the online Code Depot.

An XMLSocket connection stays open until one of the following occurs:

  • The close( ) method of the XMLSocket object is called.

  • No more references to the XMLSocket object exist.

  • The server terminates the connection (this triggers an onClose( ) event).

  • The movie is closed or the Flash Player exits.

Thankfully, the XMLSocket class also provides a way for us to monitor the status of our connection. It includes three properties -- onClose, onConnect, and onXML -- that allow us to define event handlers that will be triggered when the corresponding event occurs. Such handlers are typically known as callback handlers because they are triggered automatically by Flash in response to some event beyond the programmer's direct control. (In this sense they are very similar to ActionScript's built-in clip and button event handlers, except that the handler functions are programmer-defined.) For example, when a connection is closed by the server, the handler defined by the onClose property will be triggered.

TIP


If you fail to define callback handlers for the onClose and onConnect properties, you won't be able to perform any error checking or provide any feedback. If you fail to define a callback handler for your onXML property, you won't be notified when the socket receives data from a server-side application, nor will you be able to retrieve such data.

Example


The following example shows the bare-bones code needed to implement a simple chat client. The client may be seen in action running at:

http://www.moock.org/chat

Both the server and the client are available at the online Code Depot:

// A Simple Chat Client

// *** General init

var incomingUpdated = false; // Track whether or not we need to scroll

// to the end of incoming (the main

// chat text field)

var incoming = ""; // Assign the main chat text field a starting value


// Attach the scroll manager movie. It forces the chat text field to

// show the next (most recent) line each time a message is added.

// Note that we only need the scroll manager because of a

// text field scroll bug in Build r30 of the Flash 5 Player.

attachMovie("processScroll", "processScroll", 0);


// Attach sound to play when we receive a message

var click = new Sound( );

click.attachSound("click");


// Attach sound to play when user joins or leaves

var welcomeSound = new Sound( );

welcomeSound.attachSound("welcome");


// Turn off ugly yellow highlight on buttons

_focusrect = 0;


// *** Creates a new socket and attempts to connect to the server

function connect ( ) {

// Create a new XMLSocket object

mySocket = new XMLSocket( );


// Assign callback functions to mySocket's handlers.

mySocket.onConnect = handleConnect;

mySocket.onClose = handleClose;

mySocket.onXML = handleIncoming;


// Attempt to connect, and assign the return of mySocket.connect()

// to connectSuccess (connect() returns true if the initial stage

// of connection succeeds)

var connectSuccess = mySocket.connect("www.myserver.com", 1025);

if (connectSuccess) {

trace("initial connection succeeded");

} else {

// connectSuccess was false, so we didn't establish a connection.

gotoAndStop("connectionFailed");

trace("initial connection failed");

}

}


// *** Event handler to respond to the completion of a connection attempt

function handleConnect (succeeded) {

// If handleConnect()'s succeeded argument is true, the connection has been

// established and we can proceed with the chat.

// Otherwise, show a failure message.

if (succeeded) {

// Set a property noting that we have an open connection available.

mySocket.connected = true;

gotoAndStop("chat");

// Put the cursor in the "send message" text field

Selection.setFocus("_level0.outgoing");

} else {

// Connection didn't succeed so show an error message

gotoAndStop("connectionFailed");

trace("connection failed");

}

}


// *** Event handler called when server kills the connection

function handleClose ( ) {

// Tell the user that the connection was lost

incoming += ("The server has terminated the connection.\n");

// We updated the chat text field, so let the scroll manager know

incomingUpdated = true;

// Set a property noting that the connection was lost

mySocket.connected = false;

numClients = 0;

}


// *** Event handler to receive and display incoming messages

function handleIncoming (messageObj) {

// Display the received XML data in the Output window

trace("--------new data received-----------");

trace(">>" + messageObj.toString( ) + "<<");

trace("-------- end of new data -----------");


// We're updating the chat text field, so let the scroll manager know

incomingUpdated = true;

lastScrollPos = incoming.scroll;


// Check the time

var now = new Date( );

var hours = now.getHours( );

var minutes = now.getMinutes( );

var seconds = now.getSeconds( );

// Format time for output

hours = (hours < 10 ? "0" : "") + hours;

minutes = (minutes < 10 ? "0" : "") + minutes;

seconds = (seconds < 10 ? "0" : "") + seconds;


// The server sends NUMCLIENTS any time a client connects or disconnects

// If we find NUMCLIENTS in the XML object...

if (messageObj.firstChild.nodeName == "NUMCLIENTS") {

// ...then check if the incoming messages window is empty. If it is...

if (incoming == "") {

// ...then the user has just joined, so add a welcome message to the chat.

incoming += ("welcome to moock comm 1.0.0, "

+ userID + "\n"

+ " connection time: " + hours + ":" + minutes + ":" + seconds + "\n"

+ " server: clayton\'s javaComm generic flash xmlsocket server\n\n");

} else {

// Otherwise, someone has arrived or departed, so tell the user

if (parseInt(messageObj.firstChild.firstChild.nodeValue) > numClients) {

// Report the client arrival in the chat window

incoming += (hours + ":" + minutes + ":"

+ seconds + " a new user has connected.\n");

} else {

// Report the client departure in the chat window

incoming += (hours + ":" + minutes + ":"

+ seconds + " a user disconnected.\n");

}

}

// Finally, keep track of the new number of clients

// and play a welcome/departure sound

numClients = parseInt(messageObj.firstChild.firstChild.nodeValue;)

welcomeSound.setVolume(100);

welcomeSound.start( );

} else {

// No NUMCLIENTS node was found, so this is just a regular message.

// Grab the user name and message from our XML object.

var user = messageObj.firstChild.firstChild.nodeValue;

var message = messageObj.childNodes[1].firstChild.nodeValue;


// Add the message to the chat window, with a time stamp

incoming += (hours + ":" + minutes

+ ":" + seconds + user + ">> " + message + "\n");


// Now do the new message click.

// If it's been more than 30 secs since the last message,

// sound a loud click. Otherwise sound a quiet click.

trace("time since last message: " + (now - lastIncomingMessageTime));

if (lastIncomingMessageTime && (now - lastIncomingMessageTime) > 30000) {

click.setVolume(200);

} else {

click.setVolume(30);

}

click.start( );

}


// Truncate the contents of the main chat text

// field if it's longer than 5000 characters

if (incoming.length > 5000) {

var nearestNewline = incoming.indexOf("\n", incoming.length - 5000);

incoming = incoming.substring(nearestNewline, incoming.length);

}


// Remember when this message arrived for next time

lastIncomingMessageTime = now;

}


// *** Sends a new XML object to the server

function sendMessage( ) {

// Create the message to send as an XML source fragment.

// Note that the spaces before the <USER> and </MESSSAGE> tags

// are required so MESSAGE and USER always have a text child node.

var message = '<USER> ' + userID + '</USER><MESSAGE>'

+ outgoing + ' </MESSAGE>';


// Convert the message into an XML object hierarchy

messageObj = new XML( );

messageObj.parseXML(message);


// Check what we're sending

trace("Sending: " + messageObj);


// If a socket object has been created and is connected, send the XML message.

// Otherwise warn the user that he needs to connect first.

if (mySocket && mySocket.connected) {

mySocket.send(messageObj);

// Clear the "send message" text field

outgoing = "";

} else {

// The server must have kicked us off...

incoming += "You are no longer connected. Please reconnect.\n"

incomingUpdated = true;

}

}


// *** Closes the connection to the server

function quit( ) {

if (mySocket.connected) {

mySocket.close( );

mySocket.connected = false;

numClients = 0;

incoming = "";

gotoAndStop("login");

}

}

See Also


oadVariables( ), The XML Class

XMLSocket.close( ) Method

terminate an open connection to a server application








Availability


Flash 5

Synopsis


socket.close()

Description


The close( ) method severs the communication link between socket and a server application. Once close( ) has been executed on socket, subsequent attempts to invoke send( ) on socket fail. Likewise, the server application will no longer be able to send data to Flash through socket.

Note that close( ) has no effect if the socket is already closed or was never connected. Furthermore, close( ) does not trigger the onClose( ) handler of the socket object -- onClose( ) is triggered only by a server-side connection closure.

See Also


XMLSocket.connect( ), XMLSocket.onClose( )

XMLSocket.connect( ) Method

open a connection to a server application








Availability


Flash 5

Synopsis


socket.connect(host, port)

Arguments


host

A string specifying a hostname such as "www.myserver.com" or a standard IP address (four, dot-separated, 8-bit, decimal integers such as 111.222.3.123). If null or an empty string is specified, it defaults to the server address from which the movie was served.

port

An integer specifying a TCP port number greater than or equal to 1024.

Returns


A Boolean indicating the initial success (true) or failure (false) of the connection attempt.

Description


The connect( ) method attempts to establish a connection from Flash to a server application running on host at port.

If connect( ) returns true, the initial phase of the connection completed successfully and the socket's onConnect( ) handler will be invoked at a later time. From the onConnect( ) handler, we can evaluate whether the connection was fully established. Note that connection attempts can take varying amounts of time, particularly when a connection attempt fails. You should indicate to the user that a connection attempt is in progress when invoking connect( ).

If connect( ) returns false, the initial connection phase did not complete successfully. In such a case, socket's onConnect( ) handler will not be invoked.

It is important to check both the return value of the connect( ) method and, if connect( ) returns true, the value of the success parameter of the onConnect( ) handler.

Usage


For security reasons, connect( ) is not permitted to connect to arbitrary Internet hosts. It may connect only to hosts in the domain that the movie was downloaded from. The rules for connect( ) are the same ones applied to the loadVariables( ) function. See Table 20-8 under the global loadVariables( ) function for a list of the domain matching requirements imposed by the connect( ) method. The connect( ) method returns false for connection attempts that violate security restrictions. Note that security restrictions do not apply to the standalone Player.

Example


// Create a new socket object

mySocket = new XMLSocket( );

// Assign a callback handler function to onConnect

mySocket.onConnect = handleConnect;

// Attempt to connect to an application running on myserver.com at port 10000

if (mySocket.connect("myserver.com", 10000) == false) {

// Jump to a frame showing some sort of error message

gotoAndStop("failureDialog");

} else {

// Jump to a frame where we'll wait until onConnect is triggered

gotoAndPlay("connecting");

}

See Also


XMLSocket.close( ), XMLSocket.onConnect( )

XMLSocket.onClose( ) Event Handler

specifies the callback handler invoked when the server closes the connection








Availability


Flash 5

Synopsis


socket.onClose = closeHandler

socket.closeHandler()

Description


The onClose property allows you to specify a callback handler to be executed automatically whenever an open connection to socket is closed by the server. Server-instigated closures usually result from a server application shutting down or deliberately "kicking off" the client.

Example


To respond to an onClose event, we must assign our own function (i.e., our callback handler) to the onClose property of an XMLSocket object. In practice, we use this callback handler to detect an external socket disconnection. The following code assigns the function handleClose( ) to mySocket's onClose property. The handleClose( ) function simply alerts the user that a closure has occurred by updating the value of the text field status:

mySocket = new XMLSocket( );

mySocket.onClose = handleClose;


function handleClose ( ) {

status += ("\nThe server has terminated the connection.\n");

}

See Also


XMLSocket.close( ); Section 10.6.2, "Attaching Event Handlers to Other Objects" in Chapter 10, "Events and Event Handlers"

XMLSocket.onConnect( ) Event Handler

defines the event handler invoked when a connection attempt is completed, successfully or otherwise








Availability


Flash 5

Synopsis


socket.onConnect = connectHandler

socket.connectHandler(success )

Arguments


success

A Boolean indicating whether the connection attempt succeeded (true) or failed (false).

Description


The onConnect property allows you to specify a callback handler to be executed automatically when a previously invoked connect( ) operation finishes. The execution of the callback handler specified by onConnect does not necessarily mean a connection has been successfully established -- the callback handler is executed whenever the connection attempt is finished, whether or not the attempt was successful. The callback handler specified by onConnect is passed a success argument that indicates if the attempt succeeded (i.e., a connection has been established). If so, success is set to true. If the attempt failed (i.e., a connection timed out, was refused, or otherwise could not be established), the success argument is set to false. Note that ActionScript does not distinguish among network timeout, unknown host, refusal, or other common connection errors. The callback handler, therefore, may not be executed for up to a minute after the connect( ) command is issued depending on the settings of the server involved in a connection attempt, the connection speed, network traffic, and so on.

Example


We use the callback handler specified by onConnect to detect the success or failure of a connection attempt. In practice, we might use the callback handler to set a flag indicating that transmissions should begin if the connection was successful. We may also use the callback handler to execute fallback code when the connection fails, such as alerting the user to the problem's nature.

To respond to an onConnect event, we must assign our own function (i.e., our callback handler) to the onConnect property of an XMLSocket object. The following code assigns the function handleConnect( ) to mySocket's onConnect property. By updating the value of the text field status, handleConnect( ) alerts the user that a connection has either succeeded or failed:

mySocket = new XMLSocket( );

mySocket.onConnect = handleConnect;


function handleConnect (succeeded) {

if (succeeded) {

status += ("Successfully connected.\n");

} else {

status += ("Connection attempt failed.\n");

}

}

For code showing the onConnect( ) handler used in a more complete system, see the example under the XMLSocket class.

See Also


XMLSocket.connect( ); Section 10.6.2, "Attaching Event Handlers to Other Objects" in Chapter 10, "Events and Event Handlers"

XMLSocket.onData( ) Event Handler

executed when external data is received,but has not yet been parsed as XML








Availability


Flash 5 (undocumented)

Synopsis


socket.onData(src)

Arguments


src

A string containing loaded data, which is usually XML source code.

Description


The onData( ) handler executes automatically whenever a zero byte (ASCII null character) is transmitted to Flash over socket. By default, onData( ) simply constructs a new XML object hierarchy from src, and passes that hierarchy to socket.onXML( ). However, the onData( ) handler may be assigned a custom callback function to intercept src before ActionScript has a chance to parse it as XML. Under certain circumstances (such as real-time video games), manipulating the raw data in src manually may offer improved performance over ActionScript's built-in XML parsing.

Example


The following code shows how to assign a custom callback function to onData( ). The callback function simply displays any data received by mySocket and prevents ActionScript from parsing the data as XML:

mySocket = new XMLSocket();


mySocket.onData = function (src) {

trace("Received data: \n" + src);

};

See Also


XMLSocket.onXML( )

XMLSocket.onXML( ) Event Handler

defines the callback handler invoked when data is received by an XMLSocket object and has been parsed as XML








Availability


Flash 5

Synopsis


socket.onXML = xmlHandler

socket.xmlHandler(XMLobject )

Arguments


XMLobject

The XML object that will house the incoming XML-formatted data.

Description


The onXML property allows you to specify a callback handler to be executed when Flash receives an incoming transmission. Whenever socket receives a complete block of data (i.e., a string followed by an ASCII null character) from the server, the callback handler specified by socket.onXML is automatically invoked. A server may send data as often as it pleases, but the callback handler is executed only when the trailing null character (i.e., a zero byte) is received by socket. In Java, a zero byte is specified as '\0'. When the zero byte is received, it causes ActionScript to parse any data that has been received by socket since the last zero byte was sent (or since the initial connection if this is the first zero byte). The parsed data is converted to an XML object hierarchy which is passed as the XMLobject argument to the callback handler.

If you are a Flash programmer who is responsible for the client side of a client/server application only, simply note that the callback handler specified by onXML receives any new XML data when it arrives. The new XML data is accessible through XMLobject.

To access the raw data sent over a socket, override the default behavior of the socket's onData( ) handler. See XMLSocket.onData( ).

Example


To respond to an onXML event, we must assign our own function (i.e., our callback handler) to the onXML property of an XMLSocket object. The following code assigns the function handleIncoming( ) to mySocket's onXML property. The handleIncoming( ) function accesses one of the nodes of the XML object hierarchy stored in messageObj and adds its value to the text field messages:

mySocket = new XMLSocket( );

mySocket.onXML = handleIncoming;


function handleIncoming (messageObj) {

trace("Got some new data!");

// messageObj will contain the fragment: <MESSAGE>text</MESSAGE>

var message = messageObj.firstChild.firstChild;

messages += (message.nodeValue + "\n");

}

For code showing the onXML handler used in a more complete system, see the example under the XMLSocket class.

See Also


XMLSocket.send, XMLSocket.onData( ); Section 10.6.2, "Attaching Event Handlers to Other Objects" in Chapter 10, "Events and Event Handlers"

XMLSocket.send( ) Method

transmit XML-formatted data to a server application








Availability


Flash 5

Synopsis


socket.send(XMLobject)

Arguments


XMLobject

An XML object to be converted into a string and sent to the server application or any string containing XML-formatted text.

Description


The send( ) method transmits a message from Flash to a server application via socket. The message to send should be an object of the XML class but may also be a string. When send( ) is invoked, XMLobject is converted to a string and sent to the remote application, followed by a zero byte (the first ASCII character, null). The remote application is not obliged to respond; however, any response sent will trigger socket's onXML( ) event handler.

Example


The following code sends a very simple XML-formatted message to a remote application over the socket mySocket, which is a valid XMLSocket object for which a connection has already been established (note that message is an XML object, not an XMLSocket object; see the example under the XMLSocket class entry for a full-fledged XMLSocket sample application):

var message = new XML('<MESSAGE>testing...testing...</MESSAGE>');

mySocket.send(message);

It is also legal to send a string containing XML-formatted text without wrapping it in an XML object. For simple XML messages, this is often sufficient:

mySocket.send('<MESSAGE>testing...testing...</MESSAGE>');

See Also


XMLSocket.onXML; the XMLSocket Class, XML.send( )




1   ...   74   75   76   77   78   79   80   81   82



Скачать файл (21152.1 kb.)

Поиск по сайту:  

© gendocs.ru
При копировании укажите ссылку.
обратиться к администрации
Рейтинг@Mail.ru