dimanche 21 février 2016

alphabetic glossary xml by actionscript3

Glossary will navigate to Glossary page that will show alphabetic letters according to the English language , when click in each letter will show words that start with this letter , when click in each word will show the definition of the word . so i made alphabetic letters as buttons in fla . when i click on word the definition didn't show anything but trace is right

import flash.events.MouseEvent;
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.display.Sprite;
import flash.display.MovieClip;
var n:int = 50;
var myLoader:URLLoader= new URLLoader();
myLoader.load(new URLRequest("rr55.xml"));
var myxml:XML = new XML(myLoader.data);
function loadXML(e:Event)
    var myxml:XML = new XML(myLoader.data);
    for (var m:int=0; m<1; m++)
        var btn:MovieClip = qwe(String(myxml.a));
        btn.x = 165;
        btn.y = 165 + n;
        n +=  50;
function qwe(label:String):MovieClip
    var txt:TextField = new TextField();
    txt.defaultTextFormat = new TextFormat('Cooper Black',20,0x8b3a3a);
    txt.text = label;
    txt.autoSize = TextFieldAutoSize.LEFT;
    txt.background = txt.border = false;
    txt.selectable = false;
    var btn:MovieClip = new MovieClip();
    btn.mouseChildren = false;
    btn.buttonMode = true;
    btn.label = label;
    return btn;
function ghj(Event:MouseEvent)
    var btn2:MovieClip = qwe(String(myxml.a));
    btn2.buttonMode = false;
    btn2.x = 300;
    btn2.y = 165 + n;
    n +=  50;

and my xml is

<?xml version="1.0" encoding="UTF-8"?>

    worda start with a
    worda2 start with a
    worda3 start with a

    wordb start with b
    wordb2 start with b
    wordb3 start with b

    the definition

    the defenition

    the defenition

Aucun commentaire:

Enregistrer un commentaire