how to create xml dynamicaly of a page content

hey folks ;

let me show you how simple is to create a dynamic page content and convert
state of the stage to xml,so that you can later reuse it or get the one to a
previous state.and this is why i like flex a lot :-).simple but complex

ok
now lets a focus on the matter ,
assume we have a drawing functionality that create several structures,
on the stage dynamically.
so what is the best way that we can use to store (save ) this ,im not talking about any
undo functionality here (if we want that we need to create it with cairngorm or using some other framework- ex- purmvc ).so it beyond the target of this post so ,if i had some time will post a sample about those later.

so first let us check the coding

public function getCurrentOptions() : XML
{
var result:XML = “””””””””””

;
result.note.@noteColor = noteColorPicker.selectedColor;
result.note.content = content.text;
result.note.@noteAlign = noteAlignment.alignment;
result.page.@pageColor = pageColorPicker.selectedColor;
return result;
}
“-please remove the tags if your using this as this is ????

ok let me explain;
now what we are trying to do here is to get the all the object states in to a one single xml
so that we can store it.
here
im storing 4 things to my xml page.
notecolor,content,alignment,pagecolor…
so if you want to store a object current x,y coordinate this is the easiest way to do it.
plus suppose you need to store how many objects opened in the stage,simple you can create a object arry in the xml file and store each information (size,color,shapetype,coordinate x/y…etc)

so later on what you want is a way to get the xml file loaded .
so the saved stage will be exactly the way it was :-).

so when it comes to saving
their are two ways possible
1) the first one and the easiest is to create a xmlfile .
2)second one is to use the xmlfile to store in a database.
this need some more knowledge about the database infrastructure.
so i suggest you may need this link.

the first method can simply find in many blog sites ,since its too common,im not posting it here.
but if you are unable to find it let me know will post it for a newb with the simple guidelines.
hope this helps.

best regards
gehan

Yorumlar

Bu blogdaki popüler yayınlar

Natalli Dick Christy Ending Underwater

Megan reverse margarita

Nude ever fiilth