swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] New Viewer


From: nicole
Subject: Re: [Swftools-common] New Viewer
Date: Thu, 8 Jan 2009 11:31:26 -0500

Try this:


function hltext ( txt )
{
        var mc = _root.text;

        var my_snap:TextSnapshot = mc.getTextSnapshot();
        var start_pos:Number = 0;
        start_pos = my_snap.findText ( start_pos, txt, false );
        while ( start_pos > 0 )
        {
                        trace ( start_pos );

                        my_snap.setSelected( start_pos, start_pos + txt.length, true );
                        start_pos += txt.length;
                        start_pos = my_snap.findText ( start_pos, txt, false );

        }

        _root.text_selection = my_snap.getSelectedText(true);
}

HTH.

Nicole


On Thu, Jan 8, 2009 at 10:47 AM, Cristian Rusu <address@hidden> wrote:
 Hello

Attached is the Viewer I built based on rfxView with additional features

-Full Screen
-Remember the view/zoom mode on resize/fullscreen.
-Page jump(text in a  page number)
-Swf loaded from server/file not inserverd in viewer
-Load progress % ...
-Search box, for now only tells the number of findings

Please help me figure out how to actually display the highlight not working with this

function hltext ( txt )
{
var mc = _root.text;
var my_snap:TextSnapshot = mc.getTextSnapshot();
var start_pos:Number = 0;
start_pos = my_snap.findText ( start_pos, txt, false );
while ( start_pos > 0 )
{
trace ( start_pos );
my_snap.setSelected( start_pos, start_pos + txt.length, true );
start_pos += txt.length;
start_pos = my_snap.findText ( start_pos, txt, false );
}

}

Thanks!

Sincerely
Cristian Rusu
Web Programmer & Electronic publisher


reply via email to

[Prev in Thread] Current Thread [Next in Thread]