我有一个动态文本字段,文本保存在文件夹资产中,当我测试在闪光灯中电影工作精细文本显示在框滚动条工作,但当我上传到服务器上joomla网站它显示一切除了没有文字外,滚动条可以显示文本显示的所有内容。
我在joomla中使用的路径是images / story / storybook.swf
我已将包含文本文件的assets文件夹放在story文件夹
中import flash.events.Event;
import flash.net.URLRequest;
import flash.events.MouseEvent;
import flash.geom.Rectangle;
var textLoader:URLLoader = new URLLoader();
textLoader.addEventListener(Event.COMPLETE, textLoaded);
textLoader.load(new URLRequest("assets/story_02.txt"));
function textLoaded(evt:Event):void
{
info_txt.text = textLoader.data;
info_txt.wordWrap = true;
}
function upScrollText(evt:MouseEvent):void
{
//trace (info_txt.scrollV -=1);
info_txt.scrollV -=1;
}
bScrollUp.addEventListener(MouseEvent.CLICK,upScrollText);
function downScrollText(evt:MouseEvent):void
{
//trace (info_txt.scrollV +=1);
info_txt.scrollV +=1;
}
bScrollDown.addEventListener(MouseEvent.CLICK, downScrollText);
var bounds:Rectangle = new Rectangle(bScrollDrag.x,bScrollDrag.y,0,100);
var dragging:Boolean = false;
function dragScroll(evt:MouseEvent):void
{
bScrollDrag.startDrag(false,bounds);
dragging = true;
}
function dropScroll(evt:MouseEvent):void
{
bScrollDrag.stopDrag();
dragging = false;
}
bScrollDrag.addEventListener(MouseEvent.MOUSE_DOWN,dragScroll);
stage.addEventListener(MouseEvent.MOUSE_UP,dropScroll);
function checkSlider(evt:Event):void
{
if (dragging)
{
//trace("scroll");
info_txt.scrollV = Math.round((bScrollDrag.y - bounds.y)*info_txt.maxScrollV/100)
}
}
stage.addEventListener(Event.ENTER_FRAME,checkSlider);
function speechScrolled(evt:Event):void
{
bScrollDrag.y = bounds.y+(info_txt.scrollV*100/info_txt.maxScrollV)
}
info_txt.addEventListener(Event.SCROLL,speechScrolled);
info_txt.mouseWheelEnabled = true;
答案 0 :(得分:0)
试试这个:“/ images ...
new URLRequest("/images/story/assets/story_02.txt")
然后更改:info_txt.text = textLoader.data;
by:info_txt.text = evt.data;