;

PDA

Click to See Complete Forum and Search --> : Dynamic Text marquee/scroll?


gleninspain
12-16-2006, 07:02 PM
Hello there!

I was wondering if any of you savi people could help me with a little problem I have.....

I am making a Music player (By importing outside SWF's with the music imbedded).

I have made it so that when I press a button it plays a track and using ACTIONS-Set dynamic text control, the appropriate title is shown in my "txt1 box" . Eg "Placebo-Infrared".

That is all fine.

But i would like this text to marquee (much like the motion script ticker tape).

I tried this by accepting "yes" to the "Has html" contol in the txt1 propieties, and then putting "<marquee>placebo-infrared</marquee>" this didnt work.

I then tried putting in much more html code:

"<body>

<p>
<marquee>placebo-infrared</marquee>
</p>

</body>"

Still doesnīt work

Iīm no expert at HTML coding.. so I canīt really understand why it doesnt work.


Do i have to use Javascript? Actionscricpt? or is my HTML coding just useless?

Or is it actually possible...if it isnīt sorry for wasting your time!! :(


Thanks glen

blanius
12-16-2006, 09:45 PM
HTML in flash is limited, this is not the way to go at it.

You could script it in Actionscript. get the length of the string then use string slicing to take the part you want to see at that moment and show it in your textbox. I'll see if I can do an example.

blanius
12-16-2006, 10:40 PM
turned out a little more complicated then I thought but here goes.

put a text field named txt1 on the stage and try this

myText="Now is the time to show my text in a marquee way"

l=15 //Length of text we want to show
x=0 //where to start in the string

stringOf=function(c,l){//function to create a string of characters
var temp="" //This is a function I'm used to having in other languages.
for (var x=0;x<l;x++){
temp+=c
}
return temp
}

myText=stringOf(" ",l)+myText//add l number of spaces to the beginning of the string

display=function(){//Function to show text

var temp=myText.slice(x,l);//l=length you want to show
txt1.text=temp//put the text in the text box
x++//move up one in the text
l++//where to stop in the text see syntax for "slice" command
if (x==myText.length){//if we reach the end of the string
x=0 //reset the variables
l=15
}

}

setInterval(display,200)//setInterval runs a function on a continuous basis

stop()

gleninspain
12-17-2006, 07:28 AM
Wow thats great! Thank you ever so much !! :)

Just one more question...Is there a way to change the speed?

Don't worry if there isn't you've been a great help Mr Blanius :)

glen

gleninspain
12-17-2006, 07:58 AM
Oh don't worry i've found out how to do it!!!!

sorry!!

Thank you very very much!!

glen :) :thumbsup: