You are here: Re: It does not look good for Target. Web Accessibility news « HTML « IT news, forums, messages
Re: It does not look good for Target. Web Accessibility news

Posted by Travis Newbury on 10/05/07 19:23

On Oct 5, 9:49 am, "Jonathan N. Little" <lws4...@centralva.net> wrote:
> 5Kb eh? URL?

I created a Flash object (called GenericSlide) which will read XML (or
asp/php/pearl/ any server side process that will return XML)

It will dynamically load images and text, create animated bullets, and
can synchronize the bullets and images to MP3 audio.

It is slightly over your 5K limit weighing in at 5.02 KB (5,150
bytes) If I took out all the comments I would probably be less than
5k

There is no time line in the Flash (something you only see when the
flash developer is a real programmer) Here is the Actionscript that
runs it:

// The Generic Slide
/* Slide Layout
<generic>
<slide>
<slide_number>6</slide_number>
<title>Title of the Slide</title>
<image_url></image_url>
<slide_audio_url></slide_audio_url>
<bullet_text>
<text_width></text_width>
<bullet_url></bullet_url>
<text_url></text_url>
<content></content>
<fade_in_time></fade_in_time>
</bullet_text>
</slide>
</genric>
*/
var PlayerSound:Sound = new Sound();
var BulletHolder;
var ThisSlide = _root.CurrentSlide;
var MyInterval:Object = new Object();
var MyXML:GenericXML = new GenericXML();
var SlideHolder:GenericXML = new GenericXML();
var TimingArray:Array = new Array();

///////////////////////
// Remove this
//var CurrentSlide = 1;
///////////////////////

MyXML.ignoreWhite = true;
MyXML.onLoad = function(success){
this.setXML();
var x:Number = 0;
var SlideArray:Array = new Array();
//var CurrentSlide = _root.CurrentSlide;
var CurrentSlide = 5;
// Now search for this record
this.SearchString = "/generic/slide";
SlideArray = this.GetDataArray();
// Now go through all the slides and find the one where the slide
number = the CurrentSlide
for(x=0;x<SlideArray.length;x++){
SlideHolder.parseXML(SlideArray[x]);
SlideHolder.SearchString = "/slide/slide_number";
if(SlideHolder.GetData(0) == String(_root.CurrentSlide))
break;
}
// Ok we are there now and we have the right one
CreateSlide(SlideHolder);
}
function CreateSlide(MySlide){
// first lets make the background
this.createEmptyMovieClip("Background",this.getNextHighestDepth());
SlideHolder.SetXML();
SlideHolder.SearchString = "/slide/image_url";
Background.loadMovie(SlideHolder.GetData(0));

// the sound
PlayerSound.onLoad = function(success){
PlayerSound.start(0);
}
SlideHolder.ReloadXML();
SlideHolder.SearchString = "slide/slide_audio_url";
PlayerSound.loadSound(SlideHolder.GetData(0));

// the title text
SlideHolder.ReloadXML();
SlideHolder.SearchString="slide/slide_title";
this.createTextField("my_txt", this.getNextHighestDepth(),
30,30,600,75);
my_txt.multiline = true;
my_txt.wordWrap = true;
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0x000000;
my_fmt.font = "Arial";
my_fmt.size=24;
my_fmt.bold = true;
my_txt.text = SlideHolder.GetData(0);
my_txt.setTextFormat(my_fmt);

// Ok now we create the bullets
SlideHolder.ReloadXML();
SlideHolder.SearchString = "slide/bullet_text/content";
for(x=0;x<SlideHolder.GetSize();x++){
BulletHolder = SlideHolder.GetData(x);
this.createTextField("my_txt" + x, this.getNextHighestDepth(), 30,
(50*(x+1)+50),500,50);
eval("my_txt" + x).multiline = true;
eval("my_txt" + x).wordWrap = true;
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0x000000;
my_fmt.font = "Arial";
my_fmt.size=18;
my_fmt.bold = true;
my_fmt.bullet = true;
eval("my_txt" + x).text = BulletHolder;
eval("my_txt" + x).setTextFormat(my_fmt);
eval("my_txt" + x)._visible = false;
}
// Get the timing crap
SlideHolder.ReloadXML();
SlideHolder.SearchString = "slide/bullet_text/fade_in_time";
for(x=0;x<SlideHolder.GetSize();x++){
TimingArray.push(SlideHolder.GetData(x))
}
// Start the audio loop
this.onEnterFrame = FadeLoop;
//MyInterval = setInterval(FadeLoop,500);
}

function FadeLoop(){
var y:Number = 0;
for(y=0;y<TimingArray.length;y++){
if(Math.round(PlayerSound.position)/1000 > Number(TimingArray[y])){
eval("my_txt" + y)._visible = true;
}
}
}

MyXML.load("GenericSlide.xml");

-----------------------------------
GenericXML is an AS class I I wrote that parses XML. (AS3 now makes
it obsolete.)

I also wrote a flash based learning management system system for
Siemens that weighs in at an astounding 87K which maintains one
Siemens operating companies online courses, students, teachers, and
scheduling.

I will be more than happy to send you the GenericSlide's SWF and the
FLA if you want it. So spacegirl is correct, flash is very light
weight in the hands of someone that knows how to use it. BUT it takes
good design, which is something that has been lacking in the Flash
development community for years. But is now starting to rear its
head.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация