Мне нужна помощь с CDATA, когда я его использую, он показывает в окне браузера и все атрибуты, которые внутри CDATA
Например, мой XML-файл выглядит так
<?xml version='1.0' encoding='utf-8'?>
<project>
<projecttext>
<contenttext><![CDATA[<h1>text</h1>]]></contenttext>
</projecttext>
</project>
, и я получаюокно браузера это
<h1>text</h1>
мой флэш-скрипт
//
//IMPORTS AND STAGE INIT
//
stop();
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import caurina.transitions.Tweener;
import caurina.transitions.properties.ColorShortcuts;
ColorShortcuts.init();
//
Stage.scaleMode = "noScale";
Stage.align = "TL";
//
//XML DOCUMENT INIT
//
var XMLdaten = new XML();
XMLdaten.ignoreWhite = true;
XMLdaten.load(_global.modulexml);
//XMLdaten.load("xml/contentpage.xml");
//
//MEDIA LOADER
//
mediaLoader = function (item, link, mcap) {
var my_mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
my_mcl.addListener(mclListener);
//this happens when loading is completed
mclListener.onLoadComplete = function(mc:MovieClip):Void {
Tweener.removeTweens(item);
Tweener.removeTweens(mcap);
Tweener.addTween(item,{_x:0, time:1, transition:"easeOutExpo"});
Tweener.addTween(mcap,{_x:0, time:1, transition:"easeOutExpo", delay:0.1});
mc_project.scrollpane.container.smask._height = mc_project.scrollpane.container._height;
};
my_mcl.loadClip(link,item);
};
//
//ADD PROJECT DETAIL MODE
//
addDetail = function () {
//
attachMovie("mc_project","mc_project",getNextHighestDepth(),{_x:Math.floor(Stage.width/2)-470, _y:Stage.height, _alpha:100});
scbgr = new flash.geom.Rectangle();
scbgr.left = 5;
scbgr.right = 10;
scbgr.top = 5;
scbgr.bottom = 70;
pheight = Math.floor(Stage.height-_root.XMLoptions_headerheight-_root.XMLoptions_footerheight);
mc_project.scrollpane.scbg.scale9Grid = scbgr;
mc_project.scrollpane.scbg._height = pheight-95-Math.floor(slideshowheight);
mc_project.scrollpane.smask._height = pheight-95-Math.floor(slideshowheight);
//
//ASSIGNING TEXT
//
//MOVING TEXT IF CONTENT EMPTY
//
mc_project.scrollpane.container.content_txt.autoSize = "left";
mc_project.scrollpane.container.content_txt.styleSheet = cssfile;
mc_project.scrollpane.container.content_txt.htmlText = XMLdaten_projecttext;
//
//ASSIGNING MEDIA
//
myoffset = 0;
mc_project.scrollpane.container.content_txt._width = 890;
mc_project.scrollpane.container.smask._height = pheight-95;
//
//MAKE PROJECT DETAIL VISIBLE
//
mc_project.scrollpane.container.setMask(mc_project.scrollpane.smask);
Tweener.removeTweens(mc_project);
lockText = function () {
mc_project.scrollpane.container.content_txt.autoSize = "none";
};
if (ss_activated) {
Tweener.addTween(mc_project,{_y:slideshowheight+5, time:0.5, transition:"easeOutExpo"});
} else {
Tweener.addTween(mc_project,{_y:5, time:0.5, transition:"easeOutExpo"});
}
setTimeout(lockText,100);
//
//PROJECT TEXT SCROLLING
//
sa = 30;
//
if (mc_project.scrollpane.container._height<=mc_project.scrollpane.smask._height) {
mc_project.scrollpane.scbg._visible = false;
mc_project.scrollpane.scrollbar._visible = false;
} else {
mc_project.scrollpane.scbg._visible = true;
mc_project.scrollpane.scrollbar._visible = true;
}
//
mc_project.scrollpane.scrollbar.onRollOver = function() {
this.useHandCursor = true;
Tweener.addTween(this.hover,{_alpha:100, time:0.5, transition:"easeOutSine"});
};
mc_project.scrollpane.scrollbar.onRollOut = function() {
Tweener.addTween(this.hover,{_alpha:0, time:0.5, transition:"easeInSine"});
};
mc_project.scrollpane.scrollbar.onReleaseOutside = function() {
Tweener.addTween(this.hover,{_alpha:0, time:0.5, transition:"easeInSine"});
};
//on scrollbar press
mc_project.scrollpane.scrollbar.onMouseDown = function() {
if (this.hitTest(_root._xmouse, _root._ymouse) && mc_project.scrollpane.container._height>mc_project.scrollpane.smask._height) {
this.startDrag(false,mc_project.scrollpane.scbg._x,mc_project.scrollpane.scbg._y,mc_project.scrollpane.scbg._x,mc_project.scrollpane.scbg._height-this._height);
mc_project.scrollpane.container.onEnterFrame = scrollThumbs;
dragging = true;
}
};
//on scrollbar release
mc_project.scrollpane.scrollbar.onMouseUp = function() {
stopDrag();
dragging = false;
delete this.onEnterFrame;
};
//scrolling functionality
scrollThumbs = function () {
var positionvar = -this._parent.scrollbar._y*(((this._height-this._parent.scrollbar._height+5)/(this._parent.scbg._height-this._parent.scrollbar._height))-1);
this.Y = (positionvar-this._y)*.2;
this._y += this.Y;
this._y = parseInt(this._y);
if (Math.abs(positionvar-this._y)<1 && !dragging) {
delete this.onEnterFrame;
}
};
//
//MOUSE SCROLL FUNCTION
//
function mousescrolling() {
mouseListener = new Object();
//
mouseListener.onMouseWheel = function(delta) {
if (mc_project.scrollpane.container._height>mc_project.scrollpane.smask._height) {
if (delta>0) {
stopDrag();
mc_project.scrollpane.container.onEnterFrame = scrollThumbs;
if (mc_project.scrollpane.scrollbar._y>mc_project.scrollpane.scbg._y && (mc_project.scrollpane.scrollbar._y-mc_project.scrollpane.scbg._y)<sa) {
mc_project.scrollpane.scrollbar._y -= Math.floor(mc_project.scrollpane.scrollbar._y-mc_project.scrollpane.scbg._y);
} else if (mc_project.scrollpane.scrollbar._y>mc_project.scrollpane.scbg._y && (mc_project.scrollpane.scrollbar._y-mc_project.scrollpane.scbg._y)>=sa) {
mc_project.scrollpane.scrollbar._y -= sa;
}
} else {
stopDrag();
mc_project.scrollpane.container.onEnterFrame = scrollThumbs;
if (mc_project.scrollpane.scrollbar._y<(mc_project.scrollpane.scbg._height-mc_project.scrollpane.scrollbar._height) && (mc_project.scrollpane.scbg._height-mc_project.scrollpane.scrollbar._y-mc_project.scrollpane.scrollbar._height)<sa) {
mc_project.scrollpane.scrollbar._y += Math.floor(mc_project.scrollpane.scbg._height-mc_project.scrollpane.scrollbar._y-mc_project.scrollpane.scrollbar._height);
} else if (mc_project.scrollpane.scrollbar._y<(mc_project.scrollpane.scbg._height-mc_project.scrollpane.scrollbar._height) && (mc_project.scrollpane.scbg._height-mc_project.scrollpane.scrollbar._y-mc_project.scrollpane.scrollbar._height)>=sa) {
mc_project.scrollpane.scrollbar._y += sa;
}
}
}
};
Mouse.addListener(mouseListener);
return mouseListener;
}
mouseListener = mousescrolling();
};
//
//RESIZE POSITIONING
//
position = function () {
pheight = Math.floor(Stage.height-_root.XMLoptions_headerheight-_root.XMLoptions_footerheight);
//
mc_project._x = Math.floor(Stage.width/2)-470;
if (ss_activated) {
slideshow._x = Math.floor(Stage.width/2)-460;
}
mc_project._alpha = 100;
mc_project.scrollpane.scbg._height = pheight-90-Math.floor(slideshowheight);
mc_project.scrollpane.smask._height = pheight-90-Math.floor(slideshowheight);
mc_project.scrollpane.scrollbar._y = 0;
//
if (mc_project.scrollpane.container._height<=mc_project.scrollpane.smask._height) {
mc_project.scrollpane.scbg._visible = false;
mc_project.scrollpane.scrollbar._visible = false;
} else {
mc_project.scrollpane.scbg._visible = true;
mc_project.scrollpane.scrollbar._visible = true;
}
};
//
resizeListener = new Object();
resizeListener.onResize = function() {
position();
};
Stage.addListener(resizeListener);
//
//XML DOCUMENT LOAD & DATA ASSIGN
//
XMLdaten.onLoad = function(success) {
if (success) {
//
XMLdaten_medialink = [];
XMLdaten_mediaheight = [];
XMLdaten_mediacaption = [];
//
maxv = _root.maxv;
if (maxv != undefined) {
pheight = Stage.height-maxv;
} else {
pheight = Stage.height;
}
regularImageLoad = function (link, item) {
my_mcl = new MovieClipLoader();
mclListener = new Object();
my_mcl.loadClip(link,item);
};
//
XMLdaten_projecttext = XMLdaten.firstChild.childNodes[0];
if (XMLdaten.firstChild.childNodes[1].attributes["height"] != undefined && XMLdaten.firstChild.childNodes[1].attributes["height"] != "") {
ss_activated = true;
slideshowtype = XMLdaten.firstChild.childNodes[1].attributes["slideshowtype"];
slideshowheight = parseInt(XMLdaten.firstChild.childNodes[1].attributes["height"]);
_global.slideshowxml = XMLdaten.firstChild.childNodes[1].attributes["slideshowxml"];
createEmptyMovieClip("slideshow",getNextHighestDepth(),{_x:0, _y:0});
slideshow._x = Math.floor(Stage.width/2)-460;
slideshow._y = 3;
regularImageLoad(slideshowtype,slideshow);
}else{
slideshowheight = 0;
}
//
//Load Stylesheet
cssfile = new TextField.StyleSheet();
cssfile.load("xml/styles.css");
cssfile.onLoad = function(success) {
if (success) {
cssloaded = true;
if(XMLdaten_projecttext!=""){
addDetail();
}
} else {
cssloaded = false;
}
};
//
xmlloaded = true;
} else {
xmlloaded = false;
}
};
я использую шаблон бизнес-портфолио xml
спасибо всем