入子構造を可能にする
 スクリプトからデーターを読み込んで、オブジェクトに直す。
もっとも基礎となる?。入子構造を作成する。
 知識としては前回までのと参照渡しか引数渡しかについて。
参照渡し? 引数渡し?
 引数渡し 参照渡し、...。
オブジェクト は 参照渡し
他?     は 引数渡し
たとえばArrayは参照渡しです。
(調べていませんが、前回,movieclipの部分はArrayで代用できるかも知れません)
入子のための容器をつくる
 たとえば
<Print>前半中身<Roop>繰り返す</Roop>後半中身</Print>Print<なんとか<Print>
だと
                  __Roop
        ___Print__|
始まり_|	  
       |___Print
のようなオブジェクトの構造を作るようにします。
作成中ですが 以下
こんな感じ
ソース
	var name;
	var vol;
	var parent;
	init = function()
	{
	name = 0;
	};
	
	new = function()
	{
	name++;
	createEmptyMovieClip('container'+name,name);
	this['container'+name].item = new Array();
	this['container'+name].string ='';		
	this['container'+name].add = this.add;	
	this['container'+name].set = this.set;	
	this['container'+name].get = this.get;	
	this['container'+name].end = this.end;	
	this['container'+name].setParent = this.setParent;
	this['container'+name].getParent = this.getParent;
	this['container'+name].getName = this.getName;
	return this['container'+name];
	};
	set = function(vo)
	{
	this.string += vo; 	
	};
	
	setParent = function(val)
		{
		this.parent = val;
		};
	getParent = function()
		{
		return this.parent;
		};
	end = function()
	{
	_root.window.smalltext.setString('ContainerEOF');
	};
	get = function()
	{
	return this.string;
	};
	add = function(mo)
	{
	this.item.push(mo);
	};
	
	getName = function()
	{
		return 'Container';
	};
		var sentence;
		var dictionary;
		var wait;
		var key;
		var sent;
		var box;
		var obj;
		init = function()
		{
		wait = 0;
		key  = 0;
		sent = '';
		box  = new Array();
		box.push(this);
		obj = this;
		};
		
		stopAction = function(prev,next)
		{
		_root.window.smalltext.setString(prev+test0.get());
		};
		analysis = function(sen)
		{
		sent = sen;
		getCommand();
		_parent.wait(this);
		};
		
		add = function(ad)
		{
		box.push(ad);
		};
		
		
		getCommand = function()
		{
		head   = sent.indexof('<',this.key);
		bottom = sent.indexof('>',this.key);
		con    = sent.slice(head+1,bottom);
		obj.set(sent.slice(key,head));
		select(con);		
		key = bottom+1;
		return con;
		
		};
		
		select = function(con)
		{
	
		if(con == (a='Print'))
			{
	_root.window.smalltext.setString('Print  ok '+con+obj);
			temp =  container.new();
			obj.add(temp);
			temp.setParent(obj);
			obj = temp; 
			obj.start();
			}
			
		if(con == (a = '/Print'))
			{
	_root.window.smalltext.setString('/Print  ok '+con+obj);
/*
			obj = obj.end();
*/
			obj = obj.getParent();
			}
		if(con == (a='Roop'))
			{
	_root.window.smalltext.setString('Roop  ok '+con+obj);
			temp =  container.new();
			obj.add(temp);
			temp.setParent(obj);
			obj = temp; 
			obj.start();
			}
		if(con == (a ='/Roop'))
			{
	_root.window.smalltext.setString('/Roop  ok '+con+obj);
/*
			obj = obj.end();
*/
			obj = obj.getParent();
			}
		};
		
戻る