페이지는 단일 swf 파일을 호출하고 여러 메서드를 중첩합니다. _자바스크립트 기술

WBOY
풀어 주다: 2016-05-16 17:59:12
원래의
999명이 탐색했습니다.

HTML 쪽:
PART 1:

코드 복사 코드는 다음과 같습니다.

{{foreach from=$question.question_item item="it" name="question_item"}}

{{$it.item_id}}< ;/td>
{{$it.item_name}}
9
<입력 type="hidden" class="swfhdn" value="{title:{{$it.item_name}},vote:12 vote,proportion:0.25,singleId:swfdv{{$key 1}}}"/>< ;/td> ;

{{/foreach}}

파트 2:
코드 복사 코드는 다음과 같습니다:





JS 파일:
코드 복사 코드는 다음과 같습니다:

function createSWF(swfHome,swfHeight)
{
if(swfobject.hasFlashPlayerVersion("9"))
{
var flashvars = {};
flashvars.quesID = swfHome;
swfobject.embedSWF("swf/statistic2.swf",swfHome,"520",swfHeight,"9","",flashvars); >}
}
var aryMSG = new Array();
function resultArray() { return aryMSG; }
function init()
{
var ary = $(". swfhdn");
for(j = 0; j{
aryMSG.push(ary[j].value);
}
var arySWF = $(".swfarea") ;
for(i = 0; i < arySWF.length; i )
{
var swfheight = $(".swfQuesCount")[i].value * 18 3;
createSWF( arySWF[i].id.toString(),swfheight.toString())
}
}

FLEX 측:

코드 복사 코드는 다음과 같습니다.

< mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" backgroundColor="0xffffff"
verticalScrollPolicy= "off" horizonScrollPolicy="off"
creationComplete="application1_creationCompleteHandler(event)">


import com.flexlib.moudel.statistical.StatisticalService;
import com.flexlib.moudel .statistical.StatisticalBar;
import com .flexlib.moudel.statistical.StatisticalPane;
import mx.events.FlexEvent;
private var res:StatisticalService()
공용 함수 StatisticalManager( ary:Array):void
{
var bar:StatisticalBar();
bar.width = 350;
bar.height = 15;
// bar.color = 0x9999ff ;
var pale:StatisticalPane = new StatisticalPane();
pane.width = 520;
pane.titleSpace = 50 ;
pane.voteSpace = 35;
pane.percentSpace = 60;
res.autoColorEnabled =true; .geostropicEnabled = true;
res.geostropic = [0xffffff,0xcccccc];
res.StatisticalList(pane,bar,cvs);
}
보호된 함수 application1_creationCompleteHandler(event:FlexEvent):void
{
var item:Object = Application.application.parameters;
var aryMSG:Object = ExternalInterface.call("resultArray")
var strtmp:String
var newAry:Array = new Array();
for( var i:int = 0; i < aryMSG.length; i )
{
strtmp = aryMSG[i].substring(aryMSG[i].indexOf(" SingleId:") 9,aryMSG[i] .length - 1);
if(strtmp == item.quesID){ newAry.push(aryMSG[i]); }
}
StatisticalManager(newAry );
}
] ]>


관련 라벨:
swf
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
최신 이슈
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!