Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   Перехват ссылки внутри флэша. (http://www.flasher.ru/forum/showthread.php?t=108112)

Molecula 16.02.2008 03:37

Потому что генератор или движок не "подгребает" ссылки из ХТМЛь в СВФ.

Вам нужно сделать трепанацию черепа СВФ, посмотреть что там, вшить ссылки на мувики, зашить и сгенерировать заново.

Почитать доки на pdf2swf, может там есть лозейка.

winfast 16.02.2008 10:45

хм... нет, ну почему же... обычные ссылки например <a href="http://yandex.ru">yandex</a> вполне остаются кликабельными.. то есть при клике во флешке на них просиходит переход на yandex... хм а вот почему же требуемые ссылки не выполняются...... ?

ps.
а вот кстати параметры той утилиты.... но я там ничего нужно не заметил, чтобы можно было напрямую с ссылками работать (а может оно и не нужно):
Код:

Usage: pdf2swf [Options] input.pdf [-o output.swf]

Basic options:
-p  --pages=range          Convert only pages in range
-P  --password=password    Use password for deciphering the pdf
-v  --verbose              Be verbose. Use more than one -v for greater effect
-q  --quiet                Suppress normal messages. Use -qq to suppress warnings, also.
-F  --fontdir directory    Add directory to font search path
-V  --version              Print program version

Enhanced conversion options:
-S  --shapes              Don't use SWF Fonts, but store everything as shape
-z  --zlib                Use Flash 6 (MX) zlib compression (Needs at least Flash 6 Plugin to play)
-w  --samewindow          Don't open a new Browser Window for Links in the SWF
-f  --fonts                Store full fonts in SWF. (Don't reduce to used characters)
-T  --flashversion=num    Set the flash version in the header to num (default: 4)
-s insertstop              Insert a "Stop" Tag in every frame (don't turn pages automatically)
-s zoom=factor            Scale result, default: 72
-s jpegquality=quality    Set quality of embedded jpeg pictures (default:85)
-s caplinewidth=value      Set the minimum line width to trigger cap style handling to value. (3)
-s splinequality=value    Set the quality of spline convertion to value (0-100, default: 100).
-s fontquality=value      Set the quality of font convertion to value (0-100, default: 100).
-s ignoredraworder        Ignore draw order (makes the SWF file smaller and faster, but may produce
                          graphic errors)
-s filloverlap            Make intersecting shapes overlap, instead of canceling each
                          other out. (Needed for some Powerpoint PDFs)
Postprocessing options:
-b  --defaultviewer        Link default viewer to the pdf (/usr/local/share/swftools/swfs/default_viewer.swf)
-l  --defaultpreloader    Link default preloader the pdf (/usr/local/share/swftools/swfs/default_loader.swf)
-B  --viewer=filename      Link viewer "name" to the pdf ("pdf2swf -B" for list)
-L  --preloader=filename  Link preloader "name" to the pdf ("pdf2swf -L" for list)
pavel@gothica:~> pdf2swf
Usage: pdf2swf [Options] input.pdf [-o output.swf]

Basic options:
-p  --pages=range          Convert only pages in range
-P  --password=password    Use password for deciphering the pdf
-v  --verbose              Be verbose. Use more than one -v for greater effect
-q  --quiet                Suppress normal messages. Use -qq to suppress warnings, also.
-F  --fontdir directory    Add directory to font search path
-V  --version              Print program version

Enhanced conversion options:
-S  --shapes              Don't use SWF Fonts, but store everything as shape
-z  --zlib                Use Flash 6 (MX) zlib compression (Needs at least Flash 6 Plugin to play)
-w  --samewindow          Don't open a new Browser Window for Links in the SWF
-f  --fonts                Store full fonts in SWF. (Don't reduce to used characters)
-T  --flashversion=num    Set the flash version in the header to num (default: 4)
-s insertstop              Insert a "Stop" Tag in every frame (don't turn pages automatically)
-s zoom=factor            Scale result, default: 72
-s jpegquality=quality    Set quality of embedded jpeg pictures (default:85)
-s caplinewidth=value      Set the minimum line width to trigger cap style handling to value. (3)
-s splinequality=value    Set the quality of spline convertion to value (0-100, default: 100).
-s fontquality=value      Set the quality of font convertion to value (0-100, default: 100).
-s ignoredraworder        Ignore draw order (makes the SWF file smaller and faster, but may produce
                          graphic errors)
-s filloverlap            Make intersecting shapes overlap, instead of canceling each
                          other out. (Needed for some Powerpoint PDFs)
Postprocessing options:
-b  --defaultviewer        Link default viewer to the pdf (/usr/local/share/swftools/swfs/default_viewer.swf)
-l  --defaultpreloader    Link default preloader the pdf (/usr/local/share/swftools/swfs/default_loader.swf)
-B  --viewer=filename      Link viewer "name" to the pdf ("pdf2swf -B" for list)
-L  --preloader=filename  Link preloader "name" to the pdf ("pdf2swf -L" for list)
pavel@gothica:~> pdf2swf
Usage: pdf2swf [Options] input.pdf [-o output.swf]

Basic options:
-p  --pages=range          Convert only pages in range
-P  --password=password    Use password for deciphering the pdf
-v  --verbose              Be verbose. Use more than one -v for greater effect
-q  --quiet                Suppress normal messages. Use -qq to suppress warnings, also.
-F  --fontdir directory    Add directory to font search path
-V  --version              Print program version

Enhanced conversion options:
-S  --shapes              Don't use SWF Fonts, but store everything as shape
-z  --zlib                Use Flash 6 (MX) zlib compression (Needs at least Flash 6 Plugin to play)
-w  --samewindow          Don't open a new Browser Window for Links in the SWF
-f  --fonts                Store full fonts in SWF. (Don't reduce to used characters)
-T  --flashversion=num    Set the flash version in the header to num (default: 4)
-s insertstop              Insert a "Stop" Tag in every frame (don't turn pages automatically)
-s zoom=factor            Scale result, default: 72
-s jpegquality=quality    Set quality of embedded jpeg pictures (default:85)
-s caplinewidth=value      Set the minimum line width to trigger cap style handling to value. (3)
-s splinequality=value    Set the quality of spline convertion to value (0-100, default: 100).
-s fontquality=value      Set the quality of font convertion to value (0-100, default: 100).
-s ignoredraworder        Ignore draw order (makes the SWF file smaller and faster, but may produce
                          graphic errors)
-s filloverlap            Make intersecting shapes overlap, instead of canceling each
                          other out. (Needed for some Powerpoint PDFs)
Postprocessing options:
-b  --defaultviewer        Link default viewer to the pdf (/usr/local/share/swftools/swfs/default_viewer.swf)
-l  --defaultpreloader    Link default preloader the pdf (/usr/local/share/swftools/swfs/default_loader.swf)
-B  --viewer=filename      Link viewer "name" to the pdf ("pdf2swf -B" for list)
-L  --preloader=filename  Link preloader "name" to the pdf ("pdf2swf -L" for list)
pavel@gothica:~> pdf2swf
Usage: pdf2swf [Options] input.pdf [-o output.swf]

Basic options:
-p  --pages=range          Convert only pages in range
-P  --password=password    Use password for deciphering the pdf
-v  --verbose              Be verbose. Use more than one -v for greater effect
-q  --quiet                Suppress normal messages. Use -qq to suppress warnings, also.
-F  --fontdir directory    Add directory to font search path
-V  --version              Print program version

Enhanced conversion options:
-S  --shapes              Don't use SWF Fonts, but store everything as shape
-z  --zlib                Use Flash 6 (MX) zlib compression (Needs at least Flash 6 Plugin to play)
-w  --samewindow          Don't open a new Browser Window for Links in the SWF
-f  --fonts                Store full fonts in SWF. (Don't reduce to used characters)
-T  --flashversion=num    Set the flash version in the header to num (default: 4)
-s insertstop              Insert a "Stop" Tag in every frame (don't turn pages automatically)
-s zoom=factor            Scale result, default: 72
-s jpegquality=quality    Set quality of embedded jpeg pictures (default:85)
-s caplinewidth=value      Set the minimum line width to trigger cap style handling to value. (3)
-s splinequality=value    Set the quality of spline convertion to value (0-100, default: 100).
-s fontquality=value      Set the quality of font convertion to value (0-100, default: 100).
-s ignoredraworder        Ignore draw order (makes the SWF file smaller and faster, but may produce
                          graphic errors)
-s filloverlap            Make intersecting shapes overlap, instead of canceling each
                          other out. (Needed for some Powerpoint PDFs)
Postprocessing options:
-b  --defaultviewer        Link default viewer to the pdf (/usr/local/share/swftools/swfs/default_viewer.swf)
-l  --defaultpreloader    Link default preloader the pdf (/usr/local/share/swftools/swfs/default_loader.swf)
-B  --viewer=filename      Link viewer "name" to the pdf ("pdf2swf -B" for list)
-L  --preloader=filename  Link preloader "name" to the pdf ("pdf2swf -L" for list)


winfast 18.02.2008 12:39

Сделал ссылку в свфе:
Код:

<a href="asfunction:tree, 5">YANDEX</a>
В книге есть фнкция:
Код:

_global.tree = function(str:String)
{
        gotoPage(str, true);
}

Почему при клике в книге на странице НА ССЫЛКУ не происходит выполнение функции?(

ps. у меня сомнения на счет того, что вообще почемуто asfunction работает... в моем случае...хм

iNils 18.02.2008 13:17

Этот вопрос надо разбить на две части.
1. Происходит ли вызов tree?
2. Виден ли в tree метод gotoPage?

winfast 18.02.2008 13:51

У меня не происходит вызов метода gotoPage если мы его вызываем со страницы в книге (если он прописан в самой подгружаемой странице).
То есть если у меня на странице написан код
Код:

...
list_txt.htmlText += "<a href=\"asfunction:myUrls, track2.mp3\">Track 2</a><br>";
...

а в книге есть функция
Код:

_global.myUrls = function (arg:String) {
        gotoPage(5, true);
}

то она не вызывается.... То есть почемуто НЕ НАХОДИТ метод gotoPage.... интересно почему?

iNils 18.02.2008 21:01

Цитата:

а в книге есть функция _global.myUrls, то она не вызывается.... То есть почемуто НЕ НАХОДИТ метод gotoPage.... интересно почему?
Вы определитесь.
Не вызывается myUrls или gotoPage в ней?
Это совсем разные вещи.

winfast 19.02.2008 22:14

_global.myUrls... то есть!

silin 20.02.2008 00:27

не очень внимательно читал топик, но по сабжу:
может поможет известный фокус со специфическим цветом a:hover и определением его на клике..
Код:

var tf:TextField;
var CSS:String = " a {color: #0000FE;}, a:hover {color: #0000FF;}";

tf = this.createTextField("tf", 0, 0, 0, 400, 300);
tf.wordWrap = true;
tf.html = true;

tf.styleSheet = new TextField.StyleSheet();
tf.styleSheet.parseCSS(CSS);
tf.htmlText = 'А потом проверить, если ссылка вида, предположим, <a href="http://some_site_here">link1</a>,';
tf.htmlText+= 'то ничего не делать. А если ссылка имеет вид - <a href="#bookmark=7">link2</a> то выполнять какое нибудь действие.';

function onMouseDown() {
        var fmt:TextFormat;
        for (var i = 0; i < tf.text.length;i++ ) {
                fmt=tf.getTextFormat(i,i+1);
                if(fmt.color==0x0000FF){//цвет  hover, т.е. мышь на ссылке
                        trace(fmt.url);//урл этой ссылки, пропарсить(определить ее тип) уже не вопрс
                        return;
                }
        }
}


Molecula 20.02.2008 04:33

Э, да мы тут просто пытаемся заставить asfunction работать.

winfast,
Код:

_global.myUrls = function (arg:String) {
trace('hi');
}

Трейс hi выдает?

winfast 20.02.2008 15:08

нет... говорю же что MyUrls почему-то не видна........ (


Часовой пояс GMT +4, время: 12:51.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.