第一次提交

This commit is contained in:
dengtongyu committed 2018-12-03 17:31:53 +08:00
commit 8121362a03
4412 files changed
+1091845

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

@@ -0,0 +1,24 @@
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
#ie_historyFrame { width: 0px; height: 0px; display:none }
#firefox_anchorDiv { width: 0px; height: 0px; display:none }
#safari_formDiv { width: 0px; height: 0px; display:none }
#safari_rememberDiv { width: 0px; height: 0px; display:none }
@@ -0,0 +1,696 @@
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
BrowserHistoryUtils = {
addEvent: function(elm, evType, fn, useCapture) {
useCapture = useCapture || false;
if (elm.addEventListener) {
elm.addEventListener(evType, fn, useCapture);
return true;
}
else if (elm.attachEvent) {
var r = elm.attachEvent('on' + evType, fn);
return r;
}
else {
elm['on' + evType] = fn;
}
}
}
BrowserHistory = (function() {
// type of browser
var browser = {
ie: false,
ie8: false,
firefox: false,
safari: false,
opera: false,
version: -1
};
// Default app state URL to use when no fragment ID present
var defaultHash = '';
// Last-known app state URL
var currentHref = document.location.href;
// Initial URL (used only by IE)
var initialHref = document.location.href;
// Initial URL (used only by IE)
var initialHash = document.location.hash;
// History frame source URL prefix (used only by IE)
var historyFrameSourcePrefix = 'history/historyFrame.html?';
// History maintenance (used only by Safari)
var currentHistoryLength = -1;
// Flag to denote the existence of onhashchange
var browserHasHashChange = false;
var historyHash = [];
var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
var backStack = [];
var forwardStack = [];
var currentObjectId = null;
//UserAgent detection
var useragent = navigator.userAgent.toLowerCase();
if (useragent.indexOf("opera") != -1) {
browser.opera = true;
} else if (useragent.indexOf("msie") != -1) {
browser.ie = true;
browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
if (browser.version == 8)
{
browser.ie = false;
browser.ie8 = true;
}
} else if (useragent.indexOf("safari") != -1) {
browser.safari = true;
browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
} else if (useragent.indexOf("gecko") != -1) {
browser.firefox = true;
}
if (browser.ie == true && browser.version == 7) {
window["_ie_firstload"] = false;
}
function hashChangeHandler()
{
currentHref = document.location.href;
var flexAppUrl = getHash();
//ADR: to fix multiple
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
var pl = getPlayers();
for (var i = 0; i < pl.length; i++) {
pl[i].browserURLChange(flexAppUrl);
}
} else {
getPlayer().browserURLChange(flexAppUrl);
}
}
// Accessor functions for obtaining specific elements of the page.
function getHistoryFrame()
{
return document.getElementById('ie_historyFrame');
}
function getFormElement()
{
return document.getElementById('safari_formDiv');
}
function getRememberElement()
{
return document.getElementById("safari_remember_field");
}
// Get the Flash player object for performing ExternalInterface callbacks.
// Updated for changes to SWFObject2.
function getPlayer(id) {
var i;
if (id && document.getElementById(id)) {
var r = document.getElementById(id);
if (typeof r.SetVariable != "undefined") {
return r;
}
else {
var o = r.getElementsByTagName("object");
var e = r.getElementsByTagName("embed");
for (i = 0; i < o.length; i++) {
if (typeof o[i].browserURLChange != "undefined")
return o[i];
}
for (i = 0; i < e.length; i++) {
if (typeof e[i].browserURLChange != "undefined")
return e[i];
}
}
}
else {
var o = document.getElementsByTagName("object");
var e = document.getElementsByTagName("embed");
for (i = 0; i < e.length; i++) {
if (typeof e[i].browserURLChange != "undefined")
{
return e[i];
}
}
for (i = 0; i < o.length; i++) {
if (typeof o[i].browserURLChange != "undefined")
{
return o[i];
}
}
}
return undefined;
}
function getPlayers() {
var i;
var players = [];
if (players.length == 0) {
var tmp = document.getElementsByTagName('object');
for (i = 0; i < tmp.length; i++)
{
if (typeof tmp[i].browserURLChange != "undefined")
players.push(tmp[i]);
}
}
if (players.length == 0 || players[0].object == null) {
var tmp = document.getElementsByTagName('embed');
for (i = 0; i < tmp.length; i++)
{
if (typeof tmp[i].browserURLChange != "undefined")
players.push(tmp[i]);
}
}
return players;
}
function getIframeHash() {
var doc = getHistoryFrame().contentWindow.document;
var hash = String(doc.location.search);
if (hash.length == 1 && hash.charAt(0) == "?") {
hash = "";
}
else if (hash.length >= 2 && hash.charAt(0) == "?") {
hash = hash.substring(1);
}
return hash;
}
/* Get the current location hash excluding the '#' symbol. */
function getHash() {
// It would be nice if we could use document.location.hash here,
// but it's faulty sometimes.
var idx = document.location.href.indexOf('#');
return (idx >= 0) ? document.location.href.substr(idx+1) : '';
}
/* Get the current location hash excluding the '#' symbol. */
function setHash(hash) {
// It would be nice if we could use document.location.hash here,
// but it's faulty sometimes.
if (hash == '') hash = '#'
document.location.hash = hash;
}
function createState(baseUrl, newUrl, flexAppUrl) {
return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
}
/* Add a history entry to the browser.
* baseUrl: the portion of the location prior to the '#'
* newUrl: the entire new URL, including '#' and following fragment
* flexAppUrl: the portion of the location following the '#' only
*/
function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
//delete all the history entries
forwardStack = [];
if (browser.ie) {
//Check to see if we are being asked to do a navigate for the first
//history entry, and if so ignore, because it's coming from the creation
//of the history iframe
if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
currentHref = initialHref;
return;
}
if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
newUrl = baseUrl + '#' + defaultHash;
flexAppUrl = defaultHash;
} else {
// for IE, tell the history frame to go somewhere without a '#'
// in order to get this entry into the browser history.
getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
}
setHash(flexAppUrl);
} else {
//ADR
if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
initialState = createState(baseUrl, newUrl, flexAppUrl);
} else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
}
if (browser.safari && !browserHasHashChange) {
// for Safari, submit a form whose action points to the desired URL
if (browser.version <= 419.3) {
var file = window.location.pathname.toString();
file = file.substring(file.lastIndexOf("/")+1);
getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
//get the current elements and add them to the form
var qs = window.location.search.substring(1);
var qs_arr = qs.split("&");
for (var i = 0; i < qs_arr.length; i++) {
var tmp = qs_arr[i].split("=");
var elem = document.createElement("input");
elem.type = "hidden";
elem.name = tmp[0];
elem.value = tmp[1];
document.forms.historyForm.appendChild(elem);
}
document.forms.historyForm.submit();
} else {
top.location.hash = flexAppUrl;
}
// We also have to maintain the history by hand for Safari
historyHash[history.length] = flexAppUrl;
_storeStates();
} else {
// Otherwise, just tell the browser to go there
setHash(flexAppUrl);
}
}
backStack.push(createState(baseUrl, newUrl, flexAppUrl));
}
function _storeStates() {
if (browser.safari) {
getRememberElement().value = historyHash.join(",");
}
}
function handleBackButton() {
//The "current" page is always at the top of the history stack.
var current = backStack.pop();
if (!current) { return; }
var last = backStack[backStack.length - 1];
if (!last && backStack.length == 0){
last = initialState;
}
forwardStack.push(current);
}
function handleForwardButton() {
//summary: private method. Do not call this directly.
var last = forwardStack.pop();
if (!last) { return; }
backStack.push(last);
}
function handleArbitraryUrl() {
//delete all the history entries
forwardStack = [];
}
/* Called periodically to poll to see if we need to detect navigation that has occurred */
function checkForUrlChange() {
if (browser.ie) {
if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
//This occurs when the user has navigated to a specific URL
//within the app, and didn't use browser back/forward
//IE seems to have a bug where it stops updating the URL it
//shows the end-user at this point, but programatically it
//appears to be correct. Do a full app reload to get around
//this issue.
if (browser.version < 7) {
currentHref = document.location.href;
document.location.reload();
} else {
if (getHash() != getIframeHash()) {
// this.iframe.src = this.blankURL + hash;
var sourceToSet = historyFrameSourcePrefix + getHash();
getHistoryFrame().src = sourceToSet;
currentHref = document.location.href;
}
}
}
}
if (browser.safari && !browserHasHashChange) {
// For Safari, we have to check to see if history.length changed.
if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
//alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
var flexAppUrl = getHash();
if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
{
// If it did change and we're running Safari 3.x or earlier,
// then we have to look the old state up in our hand-maintained
// array since document.location.hash won't have changed,
// then call back into BrowserManager.
currentHistoryLength = history.length;
flexAppUrl = historyHash[currentHistoryLength];
}
//ADR: to fix multiple
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
var pl = getPlayers();
for (var i = 0; i < pl.length; i++) {
pl[i].browserURLChange(flexAppUrl);
}
} else {
getPlayer().browserURLChange(flexAppUrl);
}
_storeStates();
}
}
if (browser.firefox && !browserHasHashChange) {
if (currentHref != document.location.href) {
var bsl = backStack.length;
var urlActions = {
back: false,
forward: false,
set: false
}
if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
urlActions.back = true;
// FIXME: could this ever be a forward button?
// we can't clear it because we still need to check for forwards. Ugg.
// clearInterval(this.locationTimer);
handleBackButton();
}
// first check to see if we could have gone forward. We always halt on
// a no-hash item.
if (forwardStack.length > 0) {
if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
urlActions.forward = true;
handleForwardButton();
}
}
// ok, that didn't work, try someplace back in the history stack
if ((bsl >= 2) && (backStack[bsl - 2])) {
if (backStack[bsl - 2].flexAppUrl == getHash()) {
urlActions.back = true;
handleBackButton();
}
}
if (!urlActions.back && !urlActions.forward) {
var foundInStacks = {
back: -1,
forward: -1
}
for (var i = 0; i < backStack.length; i++) {
if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
arbitraryUrl = true;
foundInStacks.back = i;
}
}
for (var i = 0; i < forwardStack.length; i++) {
if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
arbitraryUrl = true;
foundInStacks.forward = i;
}
}
handleArbitraryUrl();
}
// Firefox changed; do a callback into BrowserManager to tell it.
currentHref = document.location.href;
var flexAppUrl = getHash();
//ADR: to fix multiple
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
var pl = getPlayers();
for (var i = 0; i < pl.length; i++) {
pl[i].browserURLChange(flexAppUrl);
}
} else {
getPlayer().browserURLChange(flexAppUrl);
}
}
}
}
var _initialize = function () {
browserHasHashChange = ("onhashchange" in document.body);
if (browser.ie)
{
var scripts = document.getElementsByTagName('script');
for (var i = 0, s; s = scripts[i]; i++) {
if (s.src.indexOf("history.js") > -1) {
var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
}
}
historyFrameSourcePrefix = iframe_location + "?";
var src = historyFrameSourcePrefix;
var iframe = document.createElement("iframe");
iframe.id = 'ie_historyFrame';
iframe.name = 'ie_historyFrame';
iframe.src = 'javascript:false;';
try {
document.body.appendChild(iframe);
} catch(e) {
setTimeout(function() {
document.body.appendChild(iframe);
}, 0);
}
}
if (browser.safari && !browserHasHashChange)
{
var rememberDiv = document.createElement("div");
rememberDiv.id = 'safari_rememberDiv';
document.body.appendChild(rememberDiv);
rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
var formDiv = document.createElement("div");
formDiv.id = 'safari_formDiv';
document.body.appendChild(formDiv);
var reloader_content = document.createElement('div');
reloader_content.id = 'safarireloader';
var scripts = document.getElementsByTagName('script');
for (var i = 0, s; s = scripts[i]; i++) {
if (s.src.indexOf("history.js") > -1) {
html = (new String(s.src)).replace(".js", ".html");
}
}
reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
document.body.appendChild(reloader_content);
reloader_content.style.position = 'absolute';
reloader_content.style.left = reloader_content.style.top = '-9999px';
iframe = reloader_content.getElementsByTagName('iframe')[0];
if (document.getElementById("safari_remember_field").value != "" ) {
historyHash = document.getElementById("safari_remember_field").value.split(",");
}
}
if (browserHasHashChange)
document.body.onhashchange = hashChangeHandler;
}
return {
historyHash: historyHash,
backStack: function() { return backStack; },
forwardStack: function() { return forwardStack },
getPlayer: getPlayer,
initialize: function(src) {
_initialize(src);
},
setURL: function(url) {
document.location.href = url;
},
getURL: function() {
return document.location.href;
},
getTitle: function() {
return document.title;
},
setTitle: function(title) {
try {
backStack[backStack.length - 1].title = title;
} catch(e) { }
//if on safari, set the title to be the empty string.
if (browser.safari) {
if (title == "") {
try {
var tmp = window.location.href.toString();
title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
} catch(e) {
title = "";
}
}
}
document.title = title;
},
setDefaultURL: function(def)
{
defaultHash = def;
def = getHash();
//trailing ? is important else an extra frame gets added to the history
//when navigating back to the first page. Alternatively could check
//in history frame navigation to compare # and ?.
if (browser.ie)
{
window['_ie_firstload'] = true;
var sourceToSet = historyFrameSourcePrefix + def;
var func = function() {
getHistoryFrame().src = sourceToSet;
window.location.replace("#" + def);
setInterval(checkForUrlChange, 50);
}
try {
func();
} catch(e) {
window.setTimeout(function() { func(); }, 0);
}
}
if (browser.safari)
{
currentHistoryLength = history.length;
if (historyHash.length == 0) {
historyHash[currentHistoryLength] = def;
var newloc = "#" + def;
window.location.replace(newloc);
} else {
//alert(historyHash[historyHash.length-1]);
}
setInterval(checkForUrlChange, 50);
}
if (browser.firefox || browser.opera)
{
var reg = new RegExp("#" + def + "$");
if (window.location.toString().match(reg)) {
} else {
var newloc ="#" + def;
window.location.replace(newloc);
}
setInterval(checkForUrlChange, 50);
}
},
/* Set the current browser URL; called from inside BrowserManager to propagate
* the application state out to the container.
*/
setBrowserURL: function(flexAppUrl, objectId) {
if (browser.ie && typeof objectId != "undefined") {
currentObjectId = objectId;
}
//fromIframe = fromIframe || false;
//fromFlex = fromFlex || false;
//alert("setBrowserURL: " + flexAppUrl);
//flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
var pos = document.location.href.indexOf('#');
var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
var newUrl = baseUrl + '#' + flexAppUrl;
if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
currentHref = newUrl;
addHistoryEntry(baseUrl, newUrl, flexAppUrl);
currentHistoryLength = history.length;
}
},
browserURLChange: function(flexAppUrl) {
var objectId = null;
if (browser.ie && currentObjectId != null) {
objectId = currentObjectId;
}
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
var pl = getPlayers();
for (var i = 0; i < pl.length; i++) {
try {
pl[i].browserURLChange(flexAppUrl);
} catch(e) { }
}
} else {
try {
getPlayer(objectId).browserURLChange(flexAppUrl);
} catch(e) { }
}
currentObjectId = null;
},
getUserAgent: function() {
return navigator.userAgent;
},
getPlatform: function() {
return navigator.platform;
}
}
})();
// Initialization
// Automated unit testing and other diagnostics
function setURL(url)
{
document.location.href = url;
}
function backButton()
{
history.back();
}
function forwardButton()
{
history.forward();
}
function goForwardOrBackInHistory(step)
{
history.go(step);
}
//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
(function(i) {
var u =navigator.userAgent;var e=/*@cc_on!@*/false;
var st = setTimeout;
if(/webkit/i.test(u)){
st(function(){
var dr=document.readyState;
if(dr=="loaded"||dr=="complete"){i()}
else{st(arguments.callee,10);}},10);
} else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
document.addEventListener("DOMContentLoaded",i,false);
} else if(e){
(function(){
var t=document.createElement('doc:rdy');
try{t.doScroll('left');
i();t=null;
}catch(e){st(arguments.callee,0);}})();
} else{
window.onload=i;
}
})( function() {BrowserHistory.initialize();} );
@@ -0,0 +1,45 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</head>
<body>
<script>
function processUrl()
{
var pos = url.indexOf("?");
url = pos != -1 ? url.substr(pos + 1) : "";
if (!parent._ie_firstload) {
parent.BrowserHistory.setBrowserURL(url);
try {
parent.BrowserHistory.browserURLChange(url);
} catch(e) { }
} else {
parent._ie_firstload = false;
}
}
var url = document.location.href;
processUrl();
document.write(encodeURIComponent(url));
</script>
Hidden frame for Browser History support.
</body>
</html>
@@ -0,0 +1,124 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<!--
Smart developers always View Source.
This application was built using Apache Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops and mobile phones via Adobe AIR.
Learn more about Flex at http://flex.apache.org
// -->
<head>
<title>${title}</title>
<meta name="google" value="notranslate" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and
the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as
the percentage of the height of its parent container, which has to be set explicitly. Fix for
Firefox 3.6 focus border issues. Initially, don't display flashContent div so it won't show
if JavaScript disabled.
-->
<style type="text/css" media="screen">
html, body { height:100%; }
body { margin:0; padding:0; overflow:auto; text-align:center;
background-color: ${bgcolor}; }
object:focus { outline:none; }
#flashContent { display:none; }
</style>
<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
<!-- BEGIN Browser History required section ${useBrowserHistory}>
<link rel="stylesheet" type="text/css" href="history/history.css" />
<script type="text/javascript" src="history/history.js"></script>
<!${useBrowserHistory} END Browser History required section -->
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
// For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.
var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
// To use express install, set to playerProductInstall.swf, otherwise the empty string.
var xiSwfUrlStr = "${expressInstallSwf}";
var flashvars = {};
var params = {};
params.quality = "high";
params.bgcolor = "${bgcolor}";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "true";
var attributes = {};
attributes.id = "${application}";
attributes.name = "${application}";
attributes.align = "middle";
swfobject.embedSWF(
"${swf}.swf", "flashContent",
"${width}", "${height}",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
// JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
swfobject.createCSS("#flashContent", "display:block;text-align:left;");
</script>
</head>
<body>
<!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough
JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
when JavaScript is disabled.
-->
<div id="flashContent">
<p>
To view this page ensure that Adobe Flash Player version
${version_major}.${version_minor}.${version_revision} or greater is installed.
</p>
<script type="text/javascript">
var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" );
</script>
</div>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
<param name="movie" value="${swf}.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="${bgcolor}" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
<param name="quality" value="high" />
<param name="bgcolor" value="${bgcolor}" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<!--<![endif]-->
<!--[if gte IE 6]>-->
<p>
Either scripts and active content are not permitted to run or Adobe Flash Player version
${version_major}.${version_minor}.${version_revision} or greater is not installed.
</p>
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</noscript>
</body>
</html>
@@ -0,0 +1,4 @@
/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(YLine truncated
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,100 @@
package com.yy.vip.pk.components
{
import com.yy.vip.pk.base.components.TabButton;
import flash.display.Graphics;
import org.flexlite.domUI.components.Label;
public class TabButtonMiddel extends TabButton
{
public var fontSize : int = 14;
public var selectedColor : uint = 0xcb9d3a;
public var unSelectedColor : uint = 0x95899d;
public static var STYLE_1:uint = 0;
public static var STYLE_2:uint = 1;
public var style : uint = TabButtonMiddel.STYLE_1;
public var tabWidth:Number = 90;
public var tabHeight : Number = 30;
override protected function createChildren():void
{
super.createChildren();
this.width = tabWidth;
this.height = tabHeight ;
_label = new Label();
_label.width = this.width;
_label.textAlign = "center";
_label.size = this.fontSize;
_label.textColor = 0xcb9d3a;
_label.fontFamily = "SimSun";
addChild(_label);
}
override protected function commitProperties():void
{
super.commitProperties();
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth,unscaledHeight);
updateBg();
}
public function updateBg():void{
var g:Graphics = _bg1.graphics;
if(_selected)
{
_label.textColor = selectedColor;
g.clear();
if(style == STYLE_1)
{
g.beginFill(0x1b276d,1);
g.moveTo(0,this.height);
g.lineTo(0,0);
g.lineTo(this.width,0);
g.lineTo(this.width,this.height);
g.endFill();
g.lineStyle(1,0x2bcdfb,1);
g.moveTo(0,this.height);
g.lineTo(0,0);
g.lineTo(this.width-1,0);
g.lineTo(this.width-1,this.height);
}
else if(style == STYLE_2)
{
g.beginFill(0xcb9d3a,1);
g.drawRect(0,this.height,this.width,2);
g.endFill();
}
}
else
{
_label.textColor = unSelectedColor;
g.clear();
if(style == STYLE_1)
{
g.lineStyle(1,0x2bcdfb,1);
g.moveTo(0,this.height - 1);
g.lineTo(this.width,this.height - 1);
}
else if(style == STYLE_2)
{
}
}
}
override public function depose():void{
super.depose();
}
}
}
@@ -0,0 +1,33 @@
package com.yy.vip.pk.components
{
import com.yy.vip.pk.base.layout.HLayout;
import org.flexlite.domUI.events.UIEvent;
public class TabHeader extends HLayout
{
public var tabItemWidth:Number = 41;
public function TabHeader()
{
super();
this.addEventListener(UIEvent.UPDATE_COMPLETE,headerUpdateHandler);
}
protected function headerUpdateHandler(event:UIEvent):void
{
var firstChid :* = this.getChildAt(0);
var lastChid :* = this.getChildAt(this.numChildren - 1);
for(var i:int = 0;i<this.numChildren;i++)
{
var chid :* = this.getChildAt(i);
if(!isNaN(tabItemWidth) && chid != lastChid)
chid.width = tabItemWidth;
}
if(firstChid && lastChid)
lastChid.width = (this.width - (this.numChildren - 1) * firstChid.width);
}
}
}
@@ -0,0 +1,66 @@
package com.yy.vip.pk.diamondrank
{
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.system.Security;
[SWF(width=260,height=284,backgroundColor=0xfcfcfc,frameRate=15)]
public class MainDiamondRank extends MovieClip
{
public function MainDiamondRank()
{
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if(stage)
{
this.addEventListener(Event.ADDED_TO_STAGE,initHandler);
}
else
{
this.initHandler();
}
}
private function initHandler(event:Event = null):void
{
try{
this.stage.addEventListener(MouseEvent.RIGHT_CLICK,rightClickHandler);
}
catch(e:Error)
{
}
this.stage.align = StageAlign.TOP_LEFT;
this.stage.scaleMode = StageScaleMode.NO_SCALE;
var t : String = this.loaderInfo.parameters.t;
var loader :Loader = new Loader();
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompleteHandler);
loader.load(new URLRequest("http://show.vip.yy.com/clientpkchatpub/notices/MainDiamondRankCore.swf?t="+t));
}
protected function ioErrorHandler(event:Event):void
{
}
protected function loadCompleteHandler(event:Event):void
{
addChild(event.currentTarget.loader);
}
protected function rightClickHandler(event:MouseEvent):void
{
event.stopImmediatePropagation();
}
}
}
@@ -0,0 +1,102 @@
package com.yy.vip.pk.diamondrank
{
import com.yy.vip.pk.diamondrank.service.AppService;
import com.yy.vip.pk.diamondrank.view.module.ListGroup;
import com.yy.vip.pk.event.CommonEvent;
import com.yy.vip.pk.event.JsCallEvent;
import com.yy.vip.pk.service.JsService;
import flash.display.MovieClip;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.system.Security;
[SWF(width=260,height=284,backgroundColor=0xfcfcfc,frameRate=15)]
public class MainDiamondRankCore extends MovieClip
{
/*public static var NORMAL_SIZE:Number = 165;
public static var GOLD_SIZE:Number = 250;
public static var APP_SIZE:Number = NORMAL_SIZE;*/
public static var NORMAL_SIZE:Number = 165;
public static var GOLD_SIZE:Number = 250;
public static var APP_SIZE:Number = NORMAL_SIZE;
private var _listGroup:ListGroup;
public function MainDiamondRankCore()
{
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if(!stage)
{
this.addEventListener(Event.ADDED_TO_STAGE,initHandler);
}
else
{
this.initHandler();
}
}
protected function callByMainSwfHandler(event:JsCallEvent):void
{
if(event.cmd == JsService.CMD_GET_CURRENT_USERINFO)
AppService.getInstance().currentUserInfo = event.data;
}
private function initHandler(event:Event = null):void
{
try{
this.stage.addEventListener(MouseEvent.RIGHT_CLICK,rightClickHandler);
}
catch(e:Error)
{
}
this.stage.align = StageAlign.TOP_LEFT;
this.stage.scaleMode = StageScaleMode.NO_SCALE;
_listGroup = new ListGroup();
_listGroup.width = stage.stageWidth;
this.addChild(_listGroup);
this.stage.addEventListener(Event.RESIZE,resizeHandler);
resizeHandler(null);
JsService.getInstance().addEventListener(JsCallEvent.CALL_BY_MAIN_SWF,callByMainSwfHandler);
JsService.getInstance().start(JsService.PUBLIC_TOP_NOTICE_SWF_ID);
JsService.getInstance().callMainSwf(JsService.CMD_GET_CURRENT_USERINFO,JsService.PUBLIC_TOP_NOTICE_SWF_ID);
AppService.getInstance().addEventListener(AppService.SIZE_CHANGE_EVENT,appSizeChangeHandler);
}
protected function appSizeChangeHandler(event:CommonEvent):void
{
if(event.data == 0)
{
APP_SIZE = NORMAL_SIZE;
JsService.getInstance().setSwfSize(JsService.PUBLIC_TOP_NOTICE_SWF_ID,NORMAL_SIZE);
}
else if(event.data == 1){
APP_SIZE = GOLD_SIZE;
JsService.getInstance().setSwfSize(JsService.PUBLIC_TOP_NOTICE_SWF_ID,GOLD_SIZE);
}
}
protected function resizeHandler(event:Event):void
{
_listGroup.width = this.stage.stageWidth;
_listGroup.height = this.stage.stageHeight;
_listGroup.update();
}
protected function rightClickHandler(event:MouseEvent):void
{
event.stopImmediatePropagation();
}
}
}
@@ -0,0 +1,110 @@
package com.yy.vip.pk.diamondrank.service
{
import com.yy.vip.pk.diamondrank.view.module.DiamondRankList;
import com.yy.vip.pk.diamondrank.view.module.NoticePanel;
import flash.events.Event;
import flash.events.EventDispatcher;
public class AppService extends EventDispatcher
{
private static var _instance:AppService;
private var _diamondRankList:DiamondRankList;
private var _noticePanel:NoticePanel;
private var _tid:uint;
private var _anchorLeftUid:uint;
private var _anchorRightUid:uint;
private var _currentUserUid:uint;
private var _currentUserInfo:Object = {};
public static var CURRENT_USER_CHANGE:String = "CURRENT_USER_CHANGE" ;
public static var SIZE_CHANGE_EVENT:String = "SIZE_CHANGE_EVENT" ;
public static var ANCHOR_CHANGE_EVENT:String = "ANCHOR_CHANGE_EVENT" ;
public var isZhubo:Boolean;
public function get currentUserUid():uint
{
return _currentUserUid;
}
public function set currentUserUid(value:uint):void
{
_currentUserUid = value;
}
public function set currentUserInfo(value:Object):void
{
this._currentUserInfo = value;
dispatchEvent(new Event(CURRENT_USER_CHANGE));
}
public function get currentUserInfo():Object
{
return this._currentUserInfo;
}
public function AppService()
{
}
public function get anchorRightUid():uint
{
return _anchorRightUid;
}
public function set anchorRightUid(value:uint):void
{
_anchorRightUid = value;
}
public function get anchorLeftUid():uint
{
return _anchorLeftUid;
}
public function set anchorLeftUid(value:uint):void
{
_anchorLeftUid = value;
}
public function get tid():uint
{
return _tid;
}
public function set tid(value:uint):void
{
_tid = value;
}
public function get noticePanel():NoticePanel
{
return _noticePanel;
}
public function set noticePanel(value:NoticePanel):void
{
_noticePanel = value;
}
public function get diamondRankList():DiamondRankList
{
return _diamondRankList;
}
public function set diamondRankList(value:DiamondRankList):void
{
_diamondRankList = value;
}
public static function getInstance():AppService{
if(!_instance)
_instance = new AppService();
return _instance;
}
}
}
@@ -0,0 +1,93 @@
package com.yy.vip.pk.diamondrank.view.module
{
import com.greensock.TweenLite;
import com.yy.vip.pk.event.JsCallEvent;
import com.yy.vip.pk.service.JsService;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.utils.Timer;
import flash.utils.setInterval;
import org.flexlite.domUI.components.Label;
import org.flexlite.domUI.core.UIComponent;
import org.flexlite.domUI.layouts.VerticalAlign;
public class BobaoPanel extends UIComponent
{
private var queue : Array = [];
private var showTimer :Timer ;
private var isTimeEnd:int = 0 ;
private var label :Label;
public function BobaoPanel()
{
var bobaoBg :MC_zhankuangbobao_bg = new MC_zhankuangbobao_bg();
this.addChild(bobaoBg);
this.label = new Label();
this.label.verticalAlign = VerticalAlign.MIDDLE;
this.label.htmlText = "年度总决赛,激战中…";
this.label.textColor = 0xfff7e1;
this.label.x = 31;
this.label.y = 60;
this.label.leading = 2;
this.label.width = 200;
this.label.height = 40;
this.addChild(this.label);
JsService.getInstance().addEventListener(JsCallEvent.CALL_BY_MAIN_SWF,callByMainHandler);
}
protected function callByMainHandler(event:JsCallEvent):void
{
if(event.cmd == JsService.CMD_SET_BOBAO_DEFAUT_TEXT || event.cmd == JsService.CMD_SET_BOBAO_TEXT )
addTextShow( event.data as String);
}
public function addTextShow(str : String):void{
queue.push(str);
if(!showTimer)
{
showTimer = new Timer(8000);
showTimer.addEventListener(TimerEvent.TIMER,showTimerHandler);
showTimer.start();
isTimeEnd = 0;
showText();
}
}
private function showText():void
{
var str : String;
if(isTimeEnd == 0)
{
if(queue.length > 0)
str = queue.shift();
if(str){
var self : * = this;
TweenLite.to(self.label,.2,{y:20,alpha:0,onComplete:function handler():void{
self.label.htmlText = str;
self.label.y = 100;
self.label.alpha = 0;
TweenLite.to(self.label,.2,{y:60,alpha:1,onComplete:function handler():void{
TweenLite.killTweensOf(self.label);
}});
}});
}
isTimeEnd = 1;
}
}
protected function showTimerHandler(event:TimerEvent):void
{
isTimeEnd = 0;
showText();
}
}
}
@@ -0,0 +1,343 @@
package com.yy.vip.pk.diamondrank.view.module
{
import com.yy.vip.pk.base.BaseGroup;
import com.yy.vip.pk.base.components.MaskLoader;
import com.yy.vip.pk.diamondrank.service.AppService;
import com.yy.vip.pk.diamondrank.view.renderer.TopListItemRenderer;
import com.yy.vip.pk.event.CommonEvent;
import com.yy.vip.pk.event.JsCallEvent;
import com.yy.vip.pk.service.JsService;
import com.yy.vip.pk.skin.NoticeScrollerSkin;
import flash.display.MovieClip;
import flash.display.Shape;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.LocalConnection;
import flash.system.ApplicationDomain;
import flash.system.LoaderContext;
import flash.system.SecurityDomain;
import org.flexlite.domUI.collections.ArrayCollection;
import org.flexlite.domUI.components.Label;
import org.flexlite.domUI.components.List;
import org.flexlite.domUI.components.Scroller;
import org.flexlite.domUI.core.UIComponent;
public class DiamondRankList extends UIComponent
{
private var _bg:Shape;
private var _subchannelBg:MC_Subchannel_170807_V2;
protected var _list:List;
protected var _listUI:UIComponent;
protected var _listBG:BaseGroup;
private var _myselfUI:UIComponent;
private var _quickUpgradeLabel:Label;
private var _quickUpgrade:MC_QuickUpgrade_170807_v2;
private var _head:MC_Head_170807;
private var _myLogo:MaskLoader;
private var _nameLabel:Label;
private var _lvIcon:MovieClip;
private var _lvLabel:Label;
private var _scoreLabel:Label;
private var _rankLabel:Label;
private var _scrollPanel:Scroller;
private static var _tips:TipsPanel;
private var _bobaoUI:BobaoPanel;
public function DiamondRankList()
{
AppService.getInstance().diamondRankList = this;
this.width = 260;
this.height = 228;
drawBack();
_myselfUI = new UIComponent();
_myselfUI.y = 137;
_myselfUI.visible = false;
this.addChild(_myselfUI);
mySelfBack();
_quickUpgradeLabel = new Label();
_quickUpgradeLabel.fontFamily = "simsun";
_quickUpgradeLabel.x = 77;
_quickUpgradeLabel.y = 58;
_quickUpgradeLabel.height = 20;
_quickUpgradeLabel.truncateToFit = false;
_quickUpgradeLabel.text = "";
_quickUpgradeLabel.textColor = 0xcb9d3a;
_myselfUI.addChild(_quickUpgradeLabel);
_quickUpgrade = new MC_QuickUpgrade_170807_v2();
_quickUpgrade.buttonMode = true;
_quickUpgrade.x = 187;
_quickUpgrade.y = 58;
_quickUpgrade.addEventListener(MouseEvent.CLICK,clickHandler);
_myselfUI.addChild(_quickUpgrade);
_nameLabel = new Label();
_nameLabel.fontFamily = "simsun";
_nameLabel.x = 78;
_nameLabel.y = 8;
_nameLabel.width = 100;
_nameLabel.maxWidth = 100;
_nameLabel.height = 20;
_nameLabel.truncateToFit = false;
_nameLabel.textColor = 0xcb9d3a;
_myselfUI.addChild(_nameLabel);
_lvLabel = new Label();
_lvLabel.fontFamily = "Arial";
_lvLabel.x = 205;
_lvLabel.y = 8;
_lvLabel.width = 40;
_lvLabel.maxWidth = 40;
_lvLabel.height = 20;
_lvLabel.truncateToFit = false;
_lvLabel.textColor = 0x95899d;
_myselfUI.addChild(_lvLabel);
_scoreLabel = new Label();
_scoreLabel.fontFamily = "simsun";
_scoreLabel.x = 78;
_scoreLabel.y = 34;
_scoreLabel.width = 100;
_scoreLabel.maxWidth = 100;
_scoreLabel.height = 20;
_scoreLabel.truncateToFit = false;
_scoreLabel.textColor = 0x95899d;
_myselfUI.addChild(_scoreLabel);
_rankLabel = new Label();
_rankLabel.fontFamily = "simsun";
_rankLabel.x = 187;
_rankLabel.y = 34;
_rankLabel.width = 80;
_rankLabel.maxWidth = 80;
_rankLabel.height = 20;
_rankLabel.truncateToFit = false;
_rankLabel.textColor = 0xcb9d3a;
_myselfUI.addChild(_rankLabel);
_head = new MC_Head_170807();
_head.x = 11;
_head.y = 9;
_myselfUI.addChild(_head);
_myLogo = new MaskLoader(52,52,26);
_myLogo.x = 1;
_myLogo.y = 1;
_head.addChild(_myLogo);
_subchannelBg = new MC_Subchannel_170807_V2();
_subchannelBg.y = 0;
this.addChild(_subchannelBg);
_listUI = new UIComponent();
_listUI.width = 237;
_listUI.height = 120;
_listUI.y = 10;
_listUI.x = 25;
this.addChild(_listUI);
_listBG = new BaseGroup();
_listBG.width = _listUI.width;
_listBG.height = _listUI.height + 5;
_listUI.addChild(_listBG);
setListItemRenderer();
_scrollPanel = new Scroller();
_scrollPanel.viewport = _listBG;
_scrollPanel.width = _listUI.width;
_scrollPanel.height = _listUI.height;
_scrollPanel.skinName = NoticeScrollerSkin;
_listUI.addChild(_scrollPanel);
_scrollPanel.verticalScrollBar.fixedThumbSize = true;
_bobaoUI = new BobaoPanel();
_bobaoUI.y = 134;
_bobaoUI.visible = true;
this.addChild(_bobaoUI);
_bobaoUI.addTextShow("");
_tips = new TipsPanel();
_tips.x = 100;
this.addChild(_tips);
JsService.getInstance().addEventListener(JsCallEvent.CALL_BY_MAIN_SWF,callByMainSwfHandler);
JsService.getInstance().callMainSwf(JsService.CMD_GET_SVIP_LIST,JsService.PUBLIC_TOP_NOTICE_SWF_ID);
JsService.getInstance().callMainSwf(JsService.CMD_GET_MYSELF_DATA,JsService.PUBLIC_TOP_NOTICE_SWF_ID);
//--------------ceshi--------------------
/*var st:String = "00000以上PK\n" +
"无下限自定义 \n" +
"粉丝福利群yy://qun-[gaid=14113059&action=add]\n" +
"输赢必须惩罚,除了巨额PK值大哥说过!\n" +
"惩罚救输的一方一律10倍救,刷给输方,刷给赢得一方救5倍\n" +
"变超人链接https://pay.duowan.com/"+
"00000以上PK\n" +
"无下限自定义 \n" +
"粉丝福利群yy://qun-[gaid=14113059&action=add]\n" +
"输赢必须惩罚,除了巨额PK值大哥说过!\n" +
"惩罚救输的一方一律10倍救,刷给输方,刷给赢得一方救5倍\n" +
"变超人链接https://pay.duowan.com/";
//AppService.getInstance().noticePanel.setContentLab(st);
var obj:Object = new Object();
obj = {uid:1362154759,nickName:"答非所问",is_svip:1,score:5000,grade:15,rank:999999,score_type:1};
//AppService.getInstance().diamondRankList.setMySelfData(obj)
var haoDatasArr:Array;
haoDatasArr = [{index:1,uid:50016139,name:"222232",value:11111,lv:22,type:0},
{index:2,uid:1362154759,name:"8888",value:222222,lv:12,type:1},
{index:3,uid:1362154759,name:"wwwerdfr",value:3333333,lv:17,type:1},
{index:4,uid:1362154759,name:"电风扇定位",value:4444444,lv:25,type:1},
{index:5,uid:50016139,name:"大幅度",value:666,lv:13,type:2},
{index:6,uid:50016139,name:"3434瑞丰光电如果",value:88,lv:14,type:2},
{index:7,uid:50016139,name:"而噩噩",value:44444,lv:15,type:2},
{index:8,uid:50016139,name:"而噩噩",value:44444,lv:16,type:2},
{index:9,uid:1362154759,name:"wwwerdfr",value:3333,lv:11,type:2},
{index:10,uid:1362154759,name:"电风扇定位",value:44444,lv:12,type:1},
{index:11,uid:50016139,name:"大幅度",value:666,lv:13,type:2},
{index:12,uid:50016139,name:"3434瑞丰光电如果",value:88,lv:14,type:2},
{index:13,uid:50016139,name:"而噩噩",value:44444,lv:15,type:2},
{index:14,uid:50016139,name:"而噩噩",value:44444,lv:16,type:2},
{index:15,uid:1362154759,name:"wwwerdfr",value:3333,lv:11,type:1}];
setList(haoDatasArr);*/
//setMySelfData({});
//--------------ceshi--------------------
}
protected function callByMainSwfHandler(event:JsCallEvent):void
{
if(event.cmd == JsService.CMD_GET_SVIP_LIST)
{
this.setList(event.data as Array);
}
else if(event.cmd == JsService.CMD_GET_MYSELF_DATA)
{
this.setMySelfData(event.data);
}
}
private function clickHandler(event:MouseEvent):void{
//navigateToURL(new URLRequest("http://svip.yy.com"),"_blank");
JsService.getInstance().callMainSwf(JsService.OPEN_URL,JsService.PUBLIC_TOP_NOTICE_SWF_ID,"http://svip.yy.com");
}
protected function setListItemRenderer():void
{
_list = new List();
//_list.scrollRect = new Rectangle(0,0,_listUI.width,_listUI.height);
_list.width = 230;
_list.itemRenderer = TopListItemRenderer;
// _list.skinName = ListSkin;
_listBG.addElement(_list);
}
private function drawBack():void{
var backUi:UIComponent = new UIComponent();
backUi.graphics.clear();
backUi.graphics.beginFill(0xf3f3f3,1);
backUi.graphics.drawRect(0,0,this.width,this.height);
backUi.graphics.endFill();
this.addChild(backUi);
}
private function mySelfBack():void{
var backUi:UIComponent = new UIComponent();
backUi.graphics.clear();
backUi.graphics.beginFill(0xfcfcfc,1);
backUi.graphics.drawRect(0,0,this.width,this.height);
backUi.graphics.endFill();
_myselfUI.addChild(backUi);
}
public function setTips(x:int,y:int,obj:Object):void{
_tips.x = x;
_tips.y = y;
_tips.setData(obj);
}
public function get context():LoaderContext{
var domain:String = new LocalConnection().domain;
var loaderURL:String = domain;
var context:LoaderContext = new LoaderContext();
context.applicationDomain = new ApplicationDomain(); //这个是关键
context.checkPolicyFile = true;
context.securityDomain = SecurityDomain.currentDomain;
if(loaderURL && loaderURL == "localhost")
context.securityDomain = null;
return context;
}
public function setMySelfData(obj:Object):void{
return;
var e : CommonEvent = new CommonEvent(AppService.SIZE_CHANGE_EVENT);
if(!obj || obj.is_svip == 0){//不是金钻
_myselfUI.visible = false;
e.data = 0;
AppService.getInstance().dispatchEvent(e);
return;
}
e.data = 1;
AppService.getInstance().dispatchEvent(e);
if(obj.hasOwnProperty("uid")){
_myLogo.load("http://pk.yy.com/avatar/" + (obj.uid),this.context);
}
if(obj.hasOwnProperty("score_type")){
if(obj.score_type != 0){
if(_lvIcon && _lvIcon.parent){
_lvIcon.parent.removeChild(_lvIcon);
}
if(obj.score_type == 1){
_lvIcon = new MC_VIP_Icon_170807();
}else if(obj.score_type == 2){
_lvIcon = new MC_PK_Icon_170807();
}
if(_lvIcon){
_lvIcon.x = 187;
_lvIcon.y = 10;
_myselfUI.addChild(_lvIcon);
}
}
}
if(obj.hasOwnProperty("nickName")){
_nameLabel.text = obj.nickName;
}
if(obj.hasOwnProperty("grade")){
_lvLabel.text = "Lv " + obj.grade;
}
if(obj.hasOwnProperty("score")){
_scoreLabel.text = "贡献值:" + obj.score;
}
if(obj.hasOwnProperty("rank")){
_rankLabel.text = "排名:" + obj.rank;
}
//{uid:1362154759,is_svip:1,score:5000,grade:15,rank:1,score_type:1};
_myselfUI.visible = true;
}
public function setList(arr:Array):void{
_list.dataProvider = new ArrayCollection(arr);
}
}
}
@@ -0,0 +1,104 @@
package com.yy.vip.pk.diamondrank.view.module
{
import com.yy.vip.pk.base.BaseGroup;
import com.yy.vip.pk.base.layout.HLayout;
import com.yy.vip.pk.components.TabButtonMiddel;
import com.yy.vip.pk.components.TabHeader;
import flash.display.Shape;
import flash.events.MouseEvent;
import org.flexlite.domUI.core.UIComponent;
import org.flexlite.domUI.layouts.HorizontalLayout;
public class ListGroup extends BaseGroup
{
private var _tabBtns:Array = new Array();
private var _header:HLayout;
private var _diamondRankList:DiamondRankList;
private var _noticePanel:NoticePanel;
private var _bg:UIComponent;
public function ListGroup()
{
super();
}
override protected function createChildren():void
{
super.createChildren();
_bg = new UIComponent();
this.addElement(_bg);
this.update();
_header = new HLayout();
_header.x = 5;
_header.y = 3;
_header.width = this.width;
_header.height = 25;
(_header.layout as HorizontalLayout).horizontalAlign = "center";
(_header.layout as HorizontalLayout).gap = 0;
addElement(_header);
_diamondRankList = new DiamondRankList();
_diamondRankList.y = _header.height+ _header.y + 1;
this.addElement(_diamondRankList);
_noticePanel = new NoticePanel();
_noticePanel.y = _header.height+ _header.y + 1;
_noticePanel.visible = false;
this.addElement(_noticePanel);
var tabBtn1:TabButtonMiddel = new TabButtonMiddel();//礼物栏按钮
tabBtn1.tabWidth = 116;
tabBtn1.tabHeight = 24;
tabBtn1.fontSize = 12;
tabBtn1.style = TabButtonMiddel.STYLE_2;
tabBtn1.clickManager = true;
_tabBtns.push(tabBtn1);
tabBtn1.text = "金钻排名";
_header.addElement(tabBtn1);
tabBtn1.selected();
tabBtn1.buttonMode = true;
tabBtn1.useHandCursor = true;
tabBtn1.mouseChildren = false;
tabBtn1.addEventListener(MouseEvent.CLICK,changeHandler);
tabBtn1.listView = _diamondRankList;
var tabBtn2:TabButtonMiddel= new TabButtonMiddel();//我的包裹按钮
tabBtn2.tabWidth = 116;
tabBtn2.tabHeight = 24;
tabBtn2.fontSize = 12;
tabBtn2.style = TabButtonMiddel.STYLE_2;
tabBtn2.clickManager = true;
_tabBtns.push(tabBtn2);
tabBtn2.text = "频道公告";
_header.addElement(tabBtn2);
tabBtn2.buttonMode = true;
tabBtn2.useHandCursor = true;
tabBtn2.mouseChildren = false;
tabBtn2.addEventListener(MouseEvent.CLICK,changeHandler);
tabBtn2.listView = _noticePanel;
}
private function changeHandler(event:MouseEvent):void{
event.stopPropagation();
}
public function update():void
{
if(_bg)
{
_bg.graphics.clear();
_bg.graphics.beginFill(0xfcfcfc,1);
_bg.graphics.drawRect(0,0,this.width,this.height);
_bg.graphics.endFill();
}
}
}
}
@@ -0,0 +1,218 @@
package com.yy.vip.pk.diamondrank.view.module
{
import com.yy.vip.pk.base.BaseGroup;
import com.yy.vip.pk.diamondrank.MainDiamondRankCore;
import com.yy.vip.pk.diamondrank.service.AppService;
import com.yy.vip.pk.event.JsCallEvent;
import com.yy.vip.pk.inter.ITabView;
import com.yy.vip.pk.service.JsService;
import com.yy.vip.pk.skin.NoticeScrollerSkin;
import com.yy.vip.pk.util.JSONUtil;
import com.yy.vip.pk.util.KeyUtil;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.TextEvent;
import flash.external.ExternalInterface;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import flash.sampler.NewObjectSample;
import flash.utils.setTimeout;
import org.flexlite.domUI.components.Group;
import org.flexlite.domUI.components.Label;
import org.flexlite.domUI.components.Scroller;
import org.flexlite.domUI.core.UIComponent;
import org.flexlite.domUI.events.UIEvent;
import org.flexlite.domUI.layouts.HorizontalAlign;
import org.flexlite.domUI.layouts.VerticalLayout;
import org.flexlite.domUI.skins.vector.ScrollerSkin;
import org.flexlite.domUI.skins.vector.VScrollBarSkin;
public class NoticePanel extends UIComponent implements ITabView
{
private var _editorBtn:MC_Editor_170807;
private var _bgGroup:Group;
private var _contentLabel:Label;
private var _scrollPanel:Scroller;
private var _contentUI:BaseGroup;
private var NOTICE_CONTENT_WIGHT:int = 235;
public function NoticePanel()
{
super();
}
override protected function createChildren():void
{
super.createChildren();
AppService.getInstance().noticePanel = this;
_bgGroup = new Group();
_bgGroup.x = 20;
_bgGroup.y = 5;
var _layout:VerticalLayout = new VerticalLayout();
_layout.horizontalAlign = HorizontalAlign.LEFT;
_bgGroup.layout = _layout;
this.addChild(_bgGroup);
_contentLabel = new Label();
_contentLabel.selectable = true;
_contentLabel.htmlText = "这家伙很懒,什么都没留下";
_contentLabel.leading = 6;
_contentLabel.textColor = 0xcb9d3a;
_contentLabel.size = 12;
_contentLabel.truncateToFit = false;
_contentLabel.width = NOTICE_CONTENT_WIGHT-15;
_contentLabel.toolTip = null;
_contentLabel.addEventListener(TextEvent.LINK,contentLabelClickHandler);
_contentUI = new BaseGroup();
_contentUI.width = NOTICE_CONTENT_WIGHT;
_contentUI.height = MainDiamondRankCore.GOLD_SIZE - 35;
_contentUI.addElement(_contentLabel);
_contentLabel.addEventListener(UIEvent.UPDATE_COMPLETE,contentLabelUpdateHandler);
_scrollPanel = new Scroller();
_scrollPanel.viewport = _contentUI;
_scrollPanel.width = NOTICE_CONTENT_WIGHT ;
_scrollPanel.height = MainDiamondRankCore.GOLD_SIZE - 35;
_scrollPanel.skinName = NoticeScrollerSkin;
_bgGroup.addElement(_scrollPanel);
_scrollPanel.verticalScrollBar.fixedThumbSize = true;
_editorBtn = new MC_Editor_170807();
_editorBtn.visible = false;
_editorBtn.x = 195;
_editorBtn.y = 5;
_editorBtn.addEventListener(MouseEvent.CLICK,clickHandler)
this.addChild(_editorBtn);
AppService.getInstance().addEventListener(AppService.CURRENT_USER_CHANGE,checkRoleHandler);
AppService.getInstance().addEventListener(AppService.SIZE_CHANGE_EVENT,sizeChangeHandler);
checkRoleHandler();
sizeChangeHandler();
}
protected function sizeChangeHandler(event:Event = null):void
{
if(MainDiamondRankCore.APP_SIZE == MainDiamondRankCore.NORMAL_SIZE)
{
_contentUI.height = MainDiamondRankCore.NORMAL_SIZE - 45;
}
else if(MainDiamondRankCore.APP_SIZE == MainDiamondRankCore.GOLD_SIZE)
{
_contentUI.height = MainDiamondRankCore.GOLD_SIZE - 45;
}
_scrollPanel.height = _contentUI.height;
_contentUI.setContentSize(_contentUI.width,_contentLabel.textHeight);
}
protected function contentLabelUpdateHandler(event:UIEvent):void
{
sizeChangeHandler();
}
protected function checkRoleHandler(event:Event = null):void
{
if(AppService.getInstance().currentUserInfo.role >= 255)
_editorBtn.visible = true;
else
JsService.getInstance().callMainSwf(JsService.CMD_CHECK_CANEDIT_NOTICE,JsService.PUBLIC_TOP_NOTICE_SWF_ID);
}
protected function contentLabelClickHandler(event:TextEvent):void
{
event.stopImmediatePropagation();
if(event.text.indexOf("http://") !=-1 || event.text.indexOf("https://")!=-1)
{
JsService.getInstance().callMainSwf(JsService.OPEN_URL,JsService.PUBLIC_TOP_NOTICE_SWF_ID,event.text);
}
else if(event.text.indexOf("yy://") !=-1)
{
var arr:Array = event.text.split(",");
JsService.getInstance().callMainSwf(JsService.CMD_GO_CHANNEL,JsService.PUBLIC_TOP_NOTICE_SWF_ID,[arr[1],arr[2]]);
}
else
{
navigateToURL(new URLRequest(event.text),"_blank");
}
}
protected function callByMainSwfHandler(event:JsCallEvent):void
{
if(event.cmd == JsService.CMD_CHECK_CANEDIT_NOTICE)
{
if(AppService.getInstance().currentUserInfo.role >= 255)
_editorBtn.visible = true;
else if(Boolean(event.data) == true)
_editorBtn.visible = true;
else
_editorBtn.visible = false;
JsService.getInstance().callMainSwf(JsService.DEBUG_LOG,JsService.PUBLIC_TOP_NOTICE_SWF_ID,"查公告编辑权返回:" + JSONUtil.encode(event.data) + "|" + AppService.getInstance().currentUserInfo.role);
}
else if(event.cmd == JsService.CMD_GET_ETIT_NOTICE_CONTENT)
{
this.setContentLab(event.data as String);
}
}
private function clickHandler(event:MouseEvent):void{
JsService.getInstance().callMainSwf(JsService.CMD_SHOW_ETIT_NOTICE_PANEL,JsService.PUBLIC_TOP_NOTICE_SWF_ID,this._contentLabel.text);
}
private function setContentLab(value:String):void{
var pattern : Object =/(http\:[\w\.\/]+)/gim;
value = value.replace(pattern,"<a href=\"event:$1\"><u><font color='#ff0000'>$1</font></u></a>");
pattern =/(https\:[\w\.\/]+)/gim;
value = value.replace(pattern,"<a href=\"event:$1\"><u><font color='#ff0000'>$1</font></u></a>");
value = filterAirTicket(value);
value = filterAirTicket2(value);
_contentLabel.htmlText = value;
}
private function filterAirTicket(msg : String):String{
//yy://pd-[sid=2710&subid=999315&type=wonder_channel]
//yy://pd-[sid=2710&amp;subid=999315&amp;type=wonder_channel]
var firstIndex : * = msg.indexOf("yy://pd-");
if(firstIndex >= 0){
msg = msg.replace(new RegExp("yy://pd-\\[sid=(\\d+)&(amp;)?subid=(\\d+)(&(amp;)?type=wonder_channel)?\\]","gm"),
'<a href=\"event:yy://pd-[sid=$1&subid=$3&type=wonder_channel],$1,$3\"><font color="#ff0000">[飞机票($1)]</font></a>' );
}
return msg;
}
private function filterAirTicket2(msg : String):String{
//yy://qun-[gaid=14113059&action=add]
var firstIndex : * = msg.indexOf("yy://qun-");
if(firstIndex >= 0){
msg = msg.replace(new RegExp("yy://qun-\\[gaid=(\\d+)(&(amp;)?action=add)?\\]","gm"),
'<a href=\"yy://qun-[gaid=$1&action=add]\"><font color="#ff0000">[加Y群($1)]</font></a>' );
}
return msg;
}
private var _selected:Boolean;
private var _initData:Boolean;
public function set selected(value:Boolean):void{
if(this._selected == value)
return;
this._selected = value;
if(this._selected && !_initData)
{
_initData = true;
JsService.getInstance().addEventListener(JsCallEvent.CALL_BY_MAIN_SWF,callByMainSwfHandler);
checkRoleHandler();
JsService.getInstance().callMainSwf(JsService.CMD_GET_ETIT_NOTICE_CONTENT,JsService.PUBLIC_TOP_NOTICE_SWF_ID);
}
}
}
}
@@ -0,0 +1,108 @@
package com.yy.vip.pk.diamondrank.view.module
{
import com.yy.vip.pk.service.JsService;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import flash.text.TextFormatAlign;
import flash.utils.clearTimeout;
import flash.utils.setTimeout;
import org.flexlite.domUI.components.Label;
import org.flexlite.domUI.core.UIComponent;
public class TipsPanel extends UIComponent
{
private var _nameLabel:Label;
private var _levelLabel:Label;
private var _valueLabel:Label;
private var _rankLabel:Label;
private var _bg:MC_Tips_Bg_170807;
private var _btn:MC_Diamond_Btn_170807;
private var _cit:int;
public function TipsPanel()
{
this.visible = false;
_bg = new MC_Tips_Bg_170807();
this.addChild(_bg);
_nameLabel = new Label();
_nameLabel.fontFamily = "simsun";
_nameLabel.textAlign = TextFormatAlign.CENTER;
_nameLabel.y = 5;
_nameLabel.width = 160;
_nameLabel.maxWidth = 160;
_nameLabel.height = 20;
_nameLabel.truncateToFit = false;
_nameLabel.textColor = 0x333333;
this.addChild(_nameLabel);
_levelLabel = new Label();
_levelLabel.x = 10;
_levelLabel.y = 25;
_levelLabel.width = 100;
_levelLabel.maxWidth = 100;
_levelLabel.height = 20;
_levelLabel.truncateToFit = false;
this.addChild(_levelLabel);
_valueLabel = new Label();
_valueLabel.x = 64;
_valueLabel.y = 25;
_valueLabel.width = 100;
_valueLabel.maxWidth = 100;
_valueLabel.height = 20;
_valueLabel.truncateToFit = false;
this.addChild(_valueLabel);
_rankLabel = new Label();
_rankLabel.x = 10;
_rankLabel.y = 45;
_rankLabel.width = 100;
_rankLabel.maxWidth = 100;
_rankLabel.height = 20;
_rankLabel.truncateToFit = false;
this.addChild(_rankLabel);
_btn = new MC_Diamond_Btn_170807();
_btn.x = (_bg.width - _btn.width) / 2;
_btn.y = 69;
_btn.addEventListener(MouseEvent.CLICK,clickHandler);
this.addChild(_btn);
this.addEventListener(MouseEvent.ROLL_OVER,overHandler);
this.addEventListener(MouseEvent.ROLL_OUT,hideTips);
}
private function overHandler(event:MouseEvent):void{
clearTimeout(_cit);
}
private function clickHandler(event:MouseEvent):void{
JsService.getInstance().callMainSwf(JsService.OPEN_URL,JsService.PUBLIC_TOP_NOTICE_SWF_ID,"http://svip.yy.com");
}
public function setData(obj:Object):void{
if(obj){
this.visible = true;
clearTimeout(_cit);
_cit = setTimeout(hideTips,1000);
_nameLabel.text = obj.name;
_levelLabel.htmlText = "<font color='#999999' face='simsun' size='12'>等级:</font><font color='#f63055' face='simsun' size='12'>"+obj.lv+"</font>";
_valueLabel.htmlText = "<font color='#999999' face='simsun' size='12'>贡献值:</font><font color='#f63055' face='simsun' size='12'>"+obj.value+"</font>";
_rankLabel.htmlText = "<font color='#999999' face='simsun' size='12'>排名:</font><font color='#f63055' face='simsun' size='12'>"+obj.index+"</font>";
}
}
private function hideTips(event:MouseEvent = null):void{
clearTimeout(_cit);
this.visible = false;
}
}
}
@@ -0,0 +1,228 @@
package com.yy.vip.pk.diamondrank.view.renderer
{
import com.yy.vip.pk.diamondrank.service.AppService;
import com.yy.vip.pk.util.FontUtil;
import com.yy.vip.pk.util.StringUtil;
import com.yy.vip.pk.util.TextEffect;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.geom.Point;
import org.flexlite.domUI.components.IItemRenderer;
import org.flexlite.domUI.components.Label;
import org.flexlite.domUI.core.UIComponent;
public class TopListItemRenderer extends UIComponent implements IItemRenderer
{
private var _main:UIComponent;
private var _topMc:*;
private var _nameLabel:Label;
private var _levelLabel:Label;
private var _valueLabel:Label;
private var _index:Number;
private var _data:*;
private var _lvIcon:MovieClip;
private var _lvLabel:Label;
public function TopListItemRenderer()
{
super();
this.height = 25;
}
override protected function createChildren():void{
super.createChildren();
_main = new UIComponent();
addChild(_main);
_nameLabel = new Label();
_nameLabel.fontFamily = "";
_nameLabel.x = 24;
_nameLabel.y = 1;
_nameLabel.width = 60;
_nameLabel.maxWidth = 80;
_nameLabel.height = 20;
_nameLabel.truncateToFit = false;
_nameLabel.textColor = 0xcb9d3a;
_nameLabel.mouseChildren =false;
_nameLabel.buttonMode = true;
_nameLabel.addEventListener(MouseEvent.MOUSE_OVER,overHandler);
_main.addChild(_nameLabel);
_levelLabel = new Label();
_levelLabel.fontFamily = "Arial";
_levelLabel.x = 140;
_levelLabel.y = 1;
_levelLabel.width = 60;
_levelLabel.maxWidth = 80;
_levelLabel.height = 20;
_levelLabel.truncateToFit = false;
_levelLabel.textColor = 0x95899d;
_main.addChild(_levelLabel);
_valueLabel = new Label();
_valueLabel.fontFamily = "Arial";
_valueLabel.x = 175;
_valueLabel.y = 1;
_valueLabel.width = 60;
_valueLabel.maxWidth = 80;
_valueLabel.height = 20;
_valueLabel.truncateToFit = false;
_valueLabel.textColor = 0xcb9d3a;
_main.addChild(_valueLabel);
_lvLabel = new Label();
_lvLabel.fontFamily = "Arial";
_lvLabel.x = 135;
_lvLabel.y = 1;
_lvLabel.width = 40;
_lvLabel.maxWidth = 40;
_lvLabel.height = 20;
_lvLabel.truncateToFit = false;
_lvLabel.textColor = 0x95899d;
_main.addChild(_lvLabel);
}
public function get data():Object
{
return _data;
}
/**
* 设置itemlistdata
* @param value
*
*/
public function set data(value:Object):void
{
if(this._data == value)
return;
this._data = value;
this._nameLabel.text = StringUtil.html_encode(value.name);
this._valueLabel.text = value.value;
if(_topMc is TextEffect)
{
(_topMc as TextEffect).depose();
}
if(_topMc is MovieClip)
{
(_topMc as MovieClip).stop();
}
if(_topMc && _topMc.parent){
_topMc.parent.removeChild(_topMc);
_topMc = null;
}
if(value.hasOwnProperty("index")){
switch(value.index){
case 1:
_topMc = new MC_First_170807();
_topMc.x = 1;
break;
case 2:
_topMc = new MC_Second_170807();
_topMc.x = 3;
break;
case 3:
_topMc = new MC_Third_170807();
break;
default:
_topMc = new TextEffect();
_topMc.createTxt("simsun",12,false,false,"right");
_topMc.glowFilter = null;
_topMc.Ccolors = [0x95899d,0x95899d,0x95899d];
_topMc.txtFilter((value.index).toString());
_topMc.x = -21;
_topMc.y = 2;
break;
}
if(_topMc){
_main.addChild(_topMc);
}
}
if(_lvIcon is MovieClip)
{
(_lvIcon as MovieClip).stop();
}
if(_lvIcon && _lvIcon.parent)
_lvIcon.parent.removeChild(_lvIcon)
_lvIcon = null;
if(value.hasOwnProperty("type")){
if(value.type == 1){
_lvIcon = new MC_VIP_Icon_170807();
}else if(value.type == 2){
_lvIcon = new MC_PK_Icon_170807();
}else{
_lvIcon = new MC_Level_Icon_170807();
}
if(_lvIcon){
_lvIcon.x = 117;
_lvIcon.y = 3;
_main.addChild(_lvIcon);
}
}
if(value.hasOwnProperty("lv") && _lvIcon){
_lvLabel.text = "Lv"+value.lv;
if(value.type == 1 || value.type == 2){
if(value.lv < 12){
_lvIcon.gotoAndStop(1);
}else if(value.lv < 17){
_lvIcon.gotoAndStop(2);
}else if(value.lv < 25){
_lvIcon.gotoAndStop(3);
}else{
_lvIcon.gotoAndStop(4);
}
}else{
if(value.lv < 4){
_lvIcon.gotoAndStop(1);
}else if(value.lv < 7){
_lvIcon.gotoAndStop(2);
}else if(value.lv < 13){
_lvIcon.gotoAndStop(3);
}else if(value.lv < 20){
_lvIcon.gotoAndStop(4);
}else if(value.lv < 25){
_lvIcon.gotoAndStop(5);
}else{
_lvIcon.gotoAndStop(6);
}
}
}
}
private function overHandler(even:MouseEvent):void{
AppService.getInstance().diamondRankList.setTips(90,25,this._data)//p.y - 5
}
public function get selected():Boolean
{
return false;
}
public function set selected(value:Boolean):void
{
}
public function get itemIndex():int
{
return this._index;
}
public function set itemIndex(value:int):void
{
this._index = value;
}
public function get label():String
{
return null;
}
public function set label(value:String):void
{
}
}
}
@@ -0,0 +1,51 @@
package com.yy.vip.pk.skin
{
import org.flexlite.domCore.dx_internal;
import org.flexlite.domUI.components.HScrollBar;
import org.flexlite.domUI.components.VScrollBar;
import org.flexlite.domUI.skins.VectorSkin;
use namespace dx_internal;
/**
* 垂直滚动条默认皮肤
* @author DOM
*/
public class NoticeScrollerSkin extends VectorSkin
{
public function NoticeScrollerSkin()
{
super();
}
public var horizontalScrollBar:HScrollBar;
public var verticalScrollBar:VScrollBar;
/**
* @inheritDoc
*/
override protected function createChildren():void
{
super.createChildren();
horizontalScrollBar = new HScrollBar();
horizontalScrollBar.visible = false;
addElement(horizontalScrollBar);
verticalScrollBar = new VScrollBar();
verticalScrollBar.skinName = NoticeVScrollBarSkin;
verticalScrollBar.visible = false;
addElement(verticalScrollBar);
}
/**
* @inheritDoc
*/
override protected function updateDisplayList(w:Number,h:Number):void
{
super.updateDisplayList(w,h);
this.alpha = currentState=="disabled"?0.5:1;
}
}
}
@@ -0,0 +1,65 @@
package com.yy.vip.pk.skin
{
import org.flexlite.domCore.dx_internal;
import org.flexlite.domUI.components.Button;
import org.flexlite.domUI.components.VScrollBar;
import org.flexlite.domUI.skins.VectorSkin;
import org.flexlite.domUI.skins.vector.VScrollBarThumbSkin;
use namespace dx_internal;
public class NoticeVScrollBarSkin extends VectorSkin
{
public function NoticeVScrollBarSkin()
{
super();
this.minWidth = 15;
this.minHeight = 50;
}
public var decrementButton:Button;
public var incrementButton:Button;
public var thumb:Button;
public var track:Button;
/**
* @inheritDoc
*/
override protected function createChildren():void
{
super.createChildren();
track = new Button();
track.top = 1;
track.bottom = 1;
track.height = 54;
track.left = 1;
track.skinName = NoticeVScrollBarTrackSkin;
addElement(track);
thumb = new Button();
thumb.alpha = .15;
thumb.left = 1;
thumb.skinName = NoticeVScrollBarThumbSkin;
addElement(thumb);
track.visible = (owner as VScrollBar).showTrack;
thumb.alpha = track.visible?.5:.15;
}
/**
* @inheritDoc
*/
override protected function updateDisplayList(w:Number,h:Number):void
{
super.updateDisplayList(w,h);
this.alpha = currentState=="disabled"?0.5:1;
track.visible = (owner as VScrollBar).showTrack;
thumb.alpha = track.visible?.7:.15;
}
}
}
@@ -0,0 +1,93 @@
package com.yy.vip.pk.skin
{
import flash.display.GradientType;
import org.flexlite.domCore.dx_internal;
import org.flexlite.domUI.components.VScrollBar;
import org.flexlite.domUI.skins.VectorSkin;
use namespace dx_internal;
/**
* 垂直滚动条thumb默认皮肤
* @author DOM
*/
public class NoticeVScrollBarThumbSkin extends VectorSkin
{
public function NoticeVScrollBarThumbSkin()
{
states = ["up","over","down","disabled"];
this.currentState = "up";
this.height = 30;
this.width = 11;
}
/**
* @inheritDoc
*/
override protected function updateDisplayList(w:Number, h:Number):void
{
super.updateDisplayList(w, h);
graphics.clear();
switch (currentState)
{
case "up":
case "disabled":
case "down":
/*drawRoundRect(
0, 0, w, h, 10,
borderColors[0], .8,
horizontalGradientMatrix(0, 0, w, h ),
GradientType.LINEAR, null,
{ x: 1, y: 1, w: w , h: h , r: 0}); */
drawRoundRect(
1, 1,w-2 , h-2, 7,
[0xcfcfcf,0xcfcfcf], 1,
horizontalGradientMatrix(1, 1, w-2 , h-2),GradientType.LINEAR);
//drawLine(w-1,0,w-1,h,bottomLineColors[0]);
break;
case "over":
/*drawRoundRect(
0, 0, w, h, 0,
borderColors[1], 1,
horizontalGradientMatrix(0, 0, w, h ),
GradientType.LINEAR, null,
{ x: 1, y: 1, w: w - 2, h: h - 2, r: 0});
drawRoundRect(
1, 1, w - 2, h - 2, 0,
[fillColors[2],fillColors[3]], 1,
horizontalGradientMatrix(1, 1, w - 2, h - 2),GradientType.LINEAR);
drawLine(w-1,0,w-1,h,bottomLineColors[1]);*/
drawRoundRect(
1, 1,w-2 , h-2, 7,
[0xcfcfcf,0xcfcfcf], 1,
horizontalGradientMatrix(1, 1, w-2 , h-2),GradientType.LINEAR);
//drawLine(w-1,0,w-1,h,bottomLineColors[0]);
break;
case "down":
/*drawRoundRect(
0, 0, w, h, 0,
borderColors[2], 1,
horizontalGradientMatrix(0, 0, w, h ),
GradientType.LINEAR, null,
{ x: 1, y: 1, w: w - 2, h: h - 2, r: 0});
drawRoundRect(
1, 1, w - 2, h - 2, 0,
[fillColors[4],fillColors[5]], 1,
horizontalGradientMatrix(1, 1, w - 2, h - 2),GradientType.LINEAR);
drawLine(w-1,0,w-1,h,bottomLineColors[2]);*/
drawRoundRect(
1, 1,w-2 , h-2, 7,
[0xcfcfcf,0xcfcfcf], 1,
horizontalGradientMatrix(1, 1, w-2 , h-2),GradientType.LINEAR);
break;
}
//this.alpha = currentState=="disabled"?0.5:1;
this.alpha = 1;
}
}
}
@@ -0,0 +1,36 @@
package com.yy.vip.pk.skin
{
import flash.display.GradientType;
import org.flexlite.domCore.dx_internal;
import org.flexlite.domUI.skins.VectorSkin;
use namespace dx_internal;
/**
* 垂直滚动条track默认皮肤
* @author DOM
*/
public class NoticeVScrollBarTrackSkin extends VectorSkin
{
public function NoticeVScrollBarTrackSkin()
{
super();
states = ["up","over","down","disabled"];
this.currentState = "up";
this.minHeight = 15;
this.width = 11;
}
/**
* @inheritDoc
*/
override protected function updateDisplayList(w:Number, h:Number):void
{
super.updateDisplayList(w, h);
graphics.clear();
}
}
}
@@ -0,0 +1,66 @@
package com.yy.vip.pk.videolists
{
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.system.Security;
//[SWF(width=260,height=200,backgroundColor=0xe7e7e7,frameRate=15)]
[SWF(width=260,height=266,backgroundColor=0xe7e7e7,frameRate=15)]
public class MainVideoLists extends MovieClip
{
public function MainVideoLists()
{
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if(stage)
init();
else
this.addEventListener(Event.ADDED_TO_STAGE,this.init);
Security.loadPolicyFile("http://vipweb.bs2cdn.yy.com/crossdomain.xml");
}
private function init(event : Event = null):void{
try{
this.stage.addEventListener(MouseEvent.RIGHT_CLICK,rightClickHandler);
}
catch(e:Error)
{
}
this.stage.align = StageAlign.TOP_LEFT;
this.stage.scaleMode = StageScaleMode.NO_SCALE;
var t : String = this.loaderInfo.parameters.t;
var loader :Loader = new Loader();
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompleteHandler);
loader.load(new URLRequest("http://show.vip.yy.com/clientpkchatpub/notices/MainVideoListsCore.swf?t="+t));
}
protected function ioErrorHandler(event:IOErrorEvent):void
{
}
protected function loadCompleteHandler(event:Event):void
{
addChild(event.currentTarget.loader);
}
protected function rightClickHandler(event:MouseEvent):void
{
event.stopImmediatePropagation();
}
}
}
@@ -0,0 +1,136 @@
package com.yy.vip.pk.videolists
{
import com.yy.vip.pk.diamondrank.service.AppService;
import com.yy.vip.pk.event.JsCallEvent;
import com.yy.vip.pk.service.JsService;
import com.yy.vip.pk.videolists.module.ListGroup;
import flash.display.Bitmap;
import flash.display.MovieClip;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.system.Security;
import org.flexlite.domCore.Injector;
import org.flexlite.domUI.core.Theme;
import org.flexlite.domUI.skins.themes.VectorTheme;
//[SWF(width=260,height=200,backgroundColor=0xe7e7e7,frameRate=15)]
[SWF(width=260,height=266,backgroundColor=0xe7e7e7,frameRate=15)]
public class MainVideoListsCore extends MovieClip
{
private var _listGroup:ListGroup;
//private var USER_SIZE:Number = 170;
//private var ZHUBO_SIZE:Number = 200;
private var USER_SIZE:Number = 236;
private var ZHUBO_SIZE:Number = 266;
public function MainVideoListsCore()
{
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if(stage)
init();
else
this.addEventListener(Event.ADDED_TO_STAGE,this.init);
Security.loadPolicyFile("http://vipweb.bs2cdn.yy.com/crossdomain.xml");
Injector.mapClass(Theme,VectorTheme);
if(!stage)
{
this.addEventListener(Event.ADDED_TO_STAGE,initHandler);
}
else
{
this.initHandler();
}
}
protected function initHandler(event:Event = null):void
{
JsService.getInstance().addEventListener(JsCallEvent.CALL_BY_MAIN_SWF,callByMainHandler);
JsService.getInstance().setSwfSize(JsService.PUBLIC_TOP_VIDEOS_SWF_ID,USER_SIZE);
JsService.getInstance().start(JsService.PUBLIC_TOP_VIDEOS_SWF_ID);
JsService.getInstance().callMainSwf(JsService.CMD_GET_INIT_VIDEO_LIST_DATA,JsService.PUBLIC_TOP_VIDEOS_SWF_ID);
}
private function init(event : Event = null):void{
try{
try{
this.stage.addEventListener(MouseEvent.RIGHT_CLICK,rightClickHandler);
}
catch(e:Error)
{
}
this.stage.align = StageAlign.TOP_LEFT;
this.stage.scaleMode = StageScaleMode.NO_SCALE;
this.stage.addEventListener(Event.RESIZE,resizeHandler);
_listGroup = new ListGroup();
this.addChild(_listGroup);
resizeHandler(null);
_listGroup.x = 0;
_listGroup.y = 0;
}
catch(e:Error)
{
}
}
protected function resizeHandler(event:Event):void
{
if(_listGroup)
{
_listGroup.width = this.stage.stageWidth;
_listGroup.height = this.stage.stageHeight;
_listGroup.update();
}
}
protected function rightClickHandler(event:MouseEvent):void
{
event.stopImmediatePropagation();
}
protected function callByMainHandler(event:JsCallEvent):void
{
if(event.cmd == JsService.CMD_GET_INIT_VIDEO_LIST_DATA)
{
this.seInfo(event.data[0],event.data[1],event.data[2],event.data[3]);
}
}
public function seInfo(tid:uint,anchorLeftUid:uint,anchorRightUid:uint,currentUserUid:uint):void{
AppService.getInstance().tid = tid;
AppService.getInstance().anchorLeftUid = anchorLeftUid;
AppService.getInstance().anchorRightUid = anchorRightUid;
AppService.getInstance().currentUserUid = currentUserUid;
if(anchorLeftUid == currentUserUid || anchorRightUid == currentUserUid)
{
AppService.getInstance().isZhubo = true;
JsService.getInstance().setSwfSize(JsService.PUBLIC_TOP_VIDEOS_SWF_ID,ZHUBO_SIZE);
}
else
{
AppService.getInstance().isZhubo = false;
JsService.getInstance().setSwfSize(JsService.PUBLIC_TOP_VIDEOS_SWF_ID,USER_SIZE);
}
AppService.getInstance().dispatchEvent(new Event(AppService.ANCHOR_CHANGE_EVENT));
}
}
}
@@ -0,0 +1,225 @@
package com.yy.vip.pk.videolists.module
{
import com.yy.vip.pk.base.BaseGroup;
import com.yy.vip.pk.base.layout.HLayout;
import com.yy.vip.pk.base.layout.VLayout;
import com.yy.vip.pk.components.TabButtonMiddel;
import com.yy.vip.pk.service.DataReportService;
import com.yy.vip.pk.service.JsService;
import com.yy.vip.pk.util.BULoader;
import flash.display.Bitmap;
import flash.display.Loader;
import flash.display.Shape;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.MouseEvent;
import flash.external.ExternalInterface;
import flash.filters.DropShadowFilter;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import org.flexlite.domUI.core.UIComponent;
import org.flexlite.domUI.layouts.HorizontalLayout;
public class ListGroup extends UIComponent
{
private var _tabBtns:Array = new Array();
private var _header:HLayout;
private var _videoList:VideoList;
private var sp:Shape;
private var core:BaseGroup;
public function ListGroup()
{
super();
}
private var bannerUI :UIComponent = new UIComponent();
override protected function createChildren():void
{
super.createChildren();
drawBg();
bannerUI.addEventListener(MouseEvent.CLICK,clickHandler);
bannerUI.x = 15;
bannerUI.y = 10;
this.addChild(bannerUI);
var _loader:BULoader = new BULoader("http://vip.yy.com/vip/actpushs?adNo=60028",function completeHandler(res:Object,res1:Object):void{
if(res.code == 0){
if(res.data && res.data.length > 0)
{
var obj :Object = res.data[0];
var url : String = obj.images;
var des : String = obj.desc;
var imageLinks : String = obj.imageLinks;
if(url){
var loader :Loader =new Loader();
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,loadErrorHandler);
loader.load(new URLRequest(url));
bannerUI.addChild(loader);
if(imageLinks && imageLinks.split("+").length > 0)
{
var channelIds : Array = imageLinks.split("+");
bannerUI.mouseChildren = false;
bannerUI.buttonMode = true;
bannerUI.useHandCursor = true;
var channleId :Number = Number(channelIds[0]);
var subChannleId :Number = Number(channleId);
if(channelIds.length > 1)
subChannleId = Number(channelIds[1]);
bannerUI.addEventListener(MouseEvent.CLICK,function imageLinksHandler(e:MouseEvent):void{
ExternalInterface.call("callExternal","IChannel_JoinChannel",0,channleId,subChannleId,subChannleId,"");
});
}
}
}
}
});
_loader.timestamp = true;
var params:Object = {};
_loader.dataFormat ="JSON";
_loader.method = "get";
_loader.start();
this.core = new BaseGroup();
this.core.y = 66;
this.addChild(this.core);
_header = new HLayout();
_header.width = 260;
_header.x = 0;
_header.y = 10;
_header.height = 25;
(_header.layout as HorizontalLayout).horizontalAlign = "center";
(_header.layout as HorizontalLayout).gap = 0;
this.core.addElement(_header);
_videoList = new VideoList();
_videoList.y = _header.height + 1;
this.core.addElement(_videoList);
var tabBtn1:TabButtonMiddel = new TabButtonMiddel();//礼物栏按钮
tabBtn1.fontSize = 12;
tabBtn1.tabWidth = 75;
tabBtn1.tabHeight = 25;
tabBtn1.style = TabButtonMiddel.STYLE_2;
tabBtn1.clickManager = true;
_tabBtns.push(tabBtn1);
tabBtn1.text = "公会惩罚";
_header.addElement(tabBtn1);
tabBtn1.selected();
tabBtn1.buttonMode = true;
tabBtn1.useHandCursor = true;
tabBtn1.mouseChildren = false;
tabBtn1.addEventListener(MouseEvent.CLICK,changeHandler);
tabBtn1.listView = _videoList;
_videoList.selectTad(1);
var tabBtn2:TabButtonMiddel= new TabButtonMiddel();//我的包裹按钮
tabBtn2.tabWidth = 75;
tabBtn2.tabHeight = 25;
tabBtn2.fontSize = 12;
tabBtn2.style = TabButtonMiddel.STYLE_2;
tabBtn2.clickManager = true;
_tabBtns.push(tabBtn2);
tabBtn2.text = "最热惩罚";
_header.addElement(tabBtn2);
tabBtn2.buttonMode = true;
tabBtn2.useHandCursor = true;
tabBtn2.mouseChildren = false;
tabBtn2.addEventListener(MouseEvent.CLICK,changeHandler);
tabBtn2.listView = _videoList;
var tabBtn3:TabButtonMiddel= new TabButtonMiddel();//我的包裹按钮
tabBtn3.tabWidth = 75;
tabBtn3.tabHeight = 25;
tabBtn3.fontSize = 12;
tabBtn3.style = TabButtonMiddel.STYLE_2;
tabBtn3.clickManager = true;
_tabBtns.push(tabBtn3);
tabBtn3.text = "主播惩罚";
_header.addElement(tabBtn3);
tabBtn3.buttonMode = true;
tabBtn3.useHandCursor = true;
tabBtn3.mouseChildren = false;
tabBtn3.addEventListener(MouseEvent.CLICK,changeHandler);
tabBtn3.listView = _videoList;
}
protected function loadErrorHandler(event:IOErrorEvent):void
{
}
protected function clickHandler(event:Event):void
{
JsService.getInstance().callMainSwf(JsService.CMD_CLICK_VIDEOS_BANNE,JsService.PUBLIC_TOP_VIDEOS_SWF_ID,null);
}
private function drawBg():void
{
var coreWidth : Number = this.width - 10;
var coreHeight : Number = this.height - 14;
if(!sp)
{
var spUI:UIComponent = new UIComponent();
sp = new Shape();
sp.filters = [new DropShadowFilter(4,90,0x000000,0.1)];
this.addChild(spUI);
spUI.addChild(sp);
}
sp.graphics.clear();
sp.graphics.beginFill(0xfcfcfc,1);
sp.graphics.drawRoundRect(7,7,coreWidth,coreHeight,10,10);
sp.graphics.endFill();
}
private function changeHandler(event:MouseEvent):void{
event.stopPropagation();
for(var i:uint = 0;i < _tabBtns.length;i++){
if(_tabBtns[i] == event.currentTarget){
_videoList.selectTad(i+1);
reportClick(i);
return;
}
}
}
private function reportClick(i:uint):void
{
if(i == 0)
{
JsService.getInstance().callMainSwf(JsService.CMD_DATA_REPORT,JsService.PUBLIC_TOP_VIDEOS_SWF_ID,{type:DataReportService.DATA_TYPE_CLICK_CHENFA_VDEIOS_GONGHUI,remark:"工会惩罚主播视频菜单"});
}
else if(i == 1)
{
JsService.getInstance().callMainSwf(JsService.CMD_DATA_REPORT,JsService.PUBLIC_TOP_VIDEOS_SWF_ID,{type:DataReportService.DATA_TYPE_CLICK_CHENFA_VDEIOS_HOT,remark:"最热惩罚主播视频菜单"});
}
else if(i == 2)
{
JsService.getInstance().callMainSwf(JsService.CMD_DATA_REPORT,JsService.PUBLIC_TOP_VIDEOS_SWF_ID,{type:DataReportService.DATA_TYPE_CLICK_CHENFA_VDEIOS_ZHUBO,remark:"主播惩罚视频菜单"});
}
}
public function update():void
{
drawBg();
}
}
}
@@ -0,0 +1,60 @@
package com.yy.vip.pk.videolists.module
{
import com.yy.vip.pk.util.UnicodeCheck;
import flash.display.Sprite;
import org.flexlite.domUI.components.Label;
import org.flexlite.domUI.core.UIComponent;
public class TipsPanel extends UIComponent
{
private static var _msg_tlp:String = "<textformat leading='4'><font color='#333333' face='SimSun' size='12'>{0}\n</font>" +
"<font color='#999999' face='SimSun' size='12'>上传时间:{1}\n共有</font>" +
"<font color='#f63055' face='SimSun' size='12'>{2}</font>" +
"<font color='#999999' face='SimSun' size='12'>人看过</font></textformat>";
private var _bgSpr:Sprite;
private var _lab:Label;
public function TipsPanel()
{
this.mouseChildren = this.mouseEnabled = false;
_bgSpr = new Sprite();
this.addChild(_bgSpr);
_lab = new Label();
_lab.x = 5;
_lab.y = 5;
_lab.width = 140;
_lab.maxWidth = 140;
_lab.height = 70;
_lab.truncateToFit = false;
this.addChild(_lab);
}
public function setData(obj:Object):void{
if(obj){
var date:Date;
if(obj.createDate){
date = new Date(obj.createDate);
}
var nameStr:String = UnicodeCheck.strProcessing(obj.nickName,18,true);
var timeStr:String = date ? date.fullYear+"."+(date.month+1)+"."+date.date : "";
var msg:String = _msg_tlp;
msg = msg.replace("{0}",nameStr);
msg = msg.replace("{1}",timeStr);
msg = msg.replace("{2}",obj.count);
_lab.htmlText = msg;
this.width = _lab.textWidth + 10;
this.height = _lab.textHeight + 10;
_bgSpr.graphics.clear();
_bgSpr.graphics.lineStyle(1,0xA42CCB,1,true);
_bgSpr.graphics.beginFill(0xFFFFFF,1);
_bgSpr.graphics.drawRoundRect(0,0,this.width,this.height,6,6);
_bgSpr.graphics.endFill();
}
}
}
}
@@ -0,0 +1,133 @@
package com.yy.vip.pk.videolists.module
{
import flash.display.Bitmap;
import flash.display.Loader;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.net.URLRequest;
import flash.system.LoaderContext;
import flash.text.TextFormatAlign;
import org.flexlite.domUI.components.Label;
import org.flexlite.domUI.core.UIComponent;
public class VideoItem extends UIComponent
{
private var _itemObj:Object;
private var _url:String;
private var _loader:Loader;
private var _image:Bitmap;
private var swidth:Number;
private var sheight:Number;
private var _nameLabel:Label;
public function VideoItem()
{
this.mouseChildren = false;
this.buttonMode = true;
this.width = 110;
this.height = 103;
swidth = 110;
sheight = 80;
drawBg();
_nameLabel = new Label();
_nameLabel.fontFamily = "simsun";
_nameLabel.textAlign = TextFormatAlign.CENTER;
_nameLabel.y = sheight + 8;
_nameLabel.width = swidth;
_nameLabel.maxWidth = swidth;
_nameLabel.height = 20;
_nameLabel.truncateToFit = false;
_nameLabel.textColor = 0x95899d;
this.addChild(_nameLabel);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,onLoaderErrorHandler);
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaderComplete);
}
protected function onLoaderErrorHandler(event:IOErrorEvent):void
{
}
private function drawBg():void{
}
public function get itemObj():Object
{
return _itemObj;
}
public function set itemObj(value:Object):void
{
_itemObj = value;
}
private function onLoaderComplete(e:Event):void{
var loader:Loader;
loader= Loader(e.target.loader);
if(_image && _image.bitmapData)
_image.bitmapData.dispose();
if(_image && _image.parent)
_image.parent.removeChild(_image);
_image = Bitmap(loader.content);
_image.smoothing = true;
//110 80
var rx:Number = swidth / loader.contentLoaderInfo.width;
var ry:Number = sheight / loader.contentLoaderInfo.height;
_image.scaleY = _image.scaleX = rx < ry ? rx : ry;
_image.x = (swidth - _image.width) / 2;
_image.y = (sheight - _image.height) / 2;
addChild(_image);
_image.visible = true;
}
public function unloadAndStop():void
{
if(_loader)
_loader.unloadAndStop();
if(_image && _image.bitmapData)
_image.bitmapData.dispose();
if(_image && _image.parent)
_image.parent.removeChild(_image);
}
public function load(obj:Object,context:LoaderContext):void{
if(!_itemObj || _itemObj.pic != obj.pic){
_itemObj = obj;
_nameLabel.text = _itemObj.name;
if(_image && _image.bitmapData)
_image.bitmapData.dispose();
if(_image && _image.parent)
_image.parent.removeChild(_image);
if(_itemObj.pic)
_loader.load(new URLRequest(_itemObj.pic),new LoaderContext(true));
}
}
}
}
@@ -0,0 +1,305 @@
package com.yy.vip.pk.videolists.module
{
import com.yy.vip.pk.base.BaseGroup;
import com.yy.vip.pk.diamondrank.service.AppService;
import com.yy.vip.pk.service.DataReportService;
import com.yy.vip.pk.service.JsService;
import com.yy.vip.pk.skin.NoticeScrollerSkin;
import com.yy.vip.pk.util.BULoader;
import com.yy.vip.pk.util.JSONUtil;
import flash.events.Event;
import flash.events.MouseEvent;
import org.flexlite.domUI.components.Label;
import org.flexlite.domUI.components.Scroller;
import org.flexlite.domUI.core.UIComponent;
public class VideoList extends UIComponent
{
protected var _listUI:UIComponent;
protected var _listBG:BaseGroup;
private var _scrollPanel:Scroller;
private var _tab:uint = 1;
private var _nullBg:MC_PunishBg_170823;
private var _uploadBtn:MC_UploadBtn_170823_v2;
private var _recommendBtn:MC_RecommendBtn_170823_v2;
private var _refreshLab:Label;
private var _refreshBtn:MC_RefreshBtn_170823;
private var _loader:BULoader;
private var _videoItemsArr:Array;
private static var _tips:TipsPanel;
public function VideoList()
{
this.width = 260;
this.height = 170;
_videoItemsArr = new Array();
_loader = new BULoader(null,completeHandler,this.errorHandler);
_refreshLab = new Label();
_refreshLab.fontFamily = "simsun";
_refreshLab.x = 20;
_refreshLab.y = 15;
_refreshLab.width = 150;
_refreshLab.maxWidth = 150;
_refreshLab.height = 20;
_refreshLab.truncateToFit = false;
_refreshLab.textColor = 0x95899d;
_refreshLab.text = "下拉可查看更多惩罚哦~";
//this.addChild(_refreshLab);
_refreshBtn = new MC_RefreshBtn_170823();
_refreshBtn.x = 200;
_refreshBtn.y = _refreshLab.y + 2;
_refreshBtn.addEventListener(MouseEvent.CLICK,refreshHandler);
//this.addChild(_refreshBtn);
_nullBg = new MC_PunishBg_170823();
_nullBg. x = (this.width - _nullBg.width) / 2;
_nullBg.y = 34;
_nullBg.visible = false;
this.addChild(_nullBg);
_listUI = new UIComponent();
_listUI.y = 20;
_listUI.width = 250;
_listUI.height = 100;
this.addChild(_listUI);
_listBG = new BaseGroup();
_listBG.width = _listUI.width;
_listBG.height = _listUI.height + 5;
_listUI.addChild(_listBG);
_scrollPanel = new Scroller();
_scrollPanel.viewport = _listBG;
_scrollPanel.width = _listUI.width + 10;
_scrollPanel.height = _listUI.height;
_listUI.addChild(_scrollPanel);
_scrollPanel.skinName = NoticeScrollerSkin;
_scrollPanel.verticalScrollBar.fixedThumbSize = true;
_recommendBtn = new MC_RecommendBtn_170823_v2();
_recommendBtn.mouseChildren = false;
_recommendBtn.buttonMode = true;
_recommendBtn.useHandCursor = true;
_recommendBtn.x = 134;
_recommendBtn.y = 132;
_recommendBtn.addEventListener(MouseEvent.CLICK,recommendHandler);
this.addChild(_recommendBtn);
_uploadBtn = new MC_UploadBtn_170823_v2();
_uploadBtn.mouseChildren = false;
_uploadBtn.buttonMode = true;
_uploadBtn.useHandCursor = true;
_uploadBtn.x = 38;
_uploadBtn.y = 132;
_uploadBtn.addEventListener(MouseEvent.CLICK,uploadHandler);
this.addChild(_uploadBtn);
if(!_tips)
{
_tips = new TipsPanel();
}
this.addEventListener(MouseEvent.MOUSE_OVER,overHandler);
this.addEventListener(MouseEvent.MOUSE_OUT,outHandler);
this.addEventListener(MouseEvent.CLICK,clickHandler);
AppService.getInstance().addEventListener(AppService.ANCHOR_CHANGE_EVENT,changeHandler);
btnStatus();
}
private function recommendHandler(event:MouseEvent):void{
JsService.getInstance().callMainSwf(JsService.OPEN_URL,JsService.PUBLIC_TOP_VIDEOS_SWF_ID,"http://test.yy.com/pkacttest/1708videoupload/index.html");
}
private function uploadHandler(event:MouseEvent):void{
JsService.getInstance().callMainSwf(JsService.OPEN_URL,JsService.PUBLIC_TOP_VIDEOS_SWF_ID,"http://test.yy.com/pkacttest/1708videoupload/index.html");
}
private function changeHandler(event:Event):void{
btnStatus();
}
private function btnStatus():void{
if(AppService.getInstance().currentUserUid > 0 &&
(AppService.getInstance().anchorLeftUid == AppService.getInstance().currentUserUid ||
AppService.getInstance().anchorRightUid == AppService.getInstance().currentUserUid)){
_uploadBtn.visible = _recommendBtn.visible = true;
}else{
_uploadBtn.visible = _recommendBtn.visible = false;
}
}
private function clickHandler(event:MouseEvent):void{
if(event.target == "[object VideoItem]"){
JsService.getInstance().callMainSwf(JsService.CMD_SHOW_VIDEO_PLAYER,JsService.PUBLIC_TOP_VIDEOS_SWF_ID,event.target.itemObj);
JsService.getInstance().callMainSwf(JsService.CMD_DATA_REPORT,JsService.PUBLIC_TOP_VIDEOS_SWF_ID,{type:DataReportService.DATA_TYPE_PLAY_CHENGFA_VIDEO,remark:"点击播放惩罚视频"});
}
}
private function overHandler(event:MouseEvent):void{
if(event.target == "[object VideoItem]"){
this.addChild(_tips);
_tips.setData(event.target.itemObj);
if(event.target.x < 11){
_tips.x = 110;
}else{
_tips.x = 10;
}
_tips.y = 50;
_tips.visible = true;
}else{
_tips.visible = false;
}
}
private function outHandler(event:MouseEvent):void{
_tips.visible = false;
}
private function refreshHandler(event:MouseEvent):void{
selectTad(_tab);
}
private function clear():void{
_nullBg.visible = true;
for(var i:uint = 0; i < _videoItemsArr.length;i++){
if(_videoItemsArr[i] && _videoItemsArr[i].parent){
_videoItemsArr[i].parent.removeElement(_videoItemsArr[i]);
}
}
}
private function loadData():void{
var urlStr: String = "http://pk.yy.com/service/web/anchorvideo/index";
_loader.source = urlStr;
_loader.timestamp = true;
var params:Object = {};
params.tid = AppService.getInstance().tid;
params.left = AppService.getInstance().anchorLeftUid;
params.right = AppService.getInstance().anchorRightUid;
params.tab = _tab;
_loader.params = params;
_loader.dataFormat ="JSON";
_loader.method = "get";
_loader.start();
}
private function errorHandler(rsp:Object,s:Object):void
{
JsService.getInstance().callMainSwf(JsService.DEBUG_LOG,JsService.PUBLIC_TOP_VIDEOS_SWF_ID,"请求惩罚视频数据返回错误:" + rsp.toString());
}
private function completeHandler(rsp:Object,s:Object):void
{
try
{
JsService.getInstance().callMainSwf(JsService.DEBUG_LOG,JsService.PUBLIC_TOP_VIDEOS_SWF_ID,"请求惩罚视频数据返回");
}
catch(e:Error)
{
JsService.getInstance().callMainSwf(JsService.DEBUG_LOG,JsService.PUBLIC_TOP_VIDEOS_SWF_ID,"请求惩罚视频数据返回错误");
}
if(rsp)
{
if(rsp.hasOwnProperty("result") && rsp.result == true){
if(rsp.hasOwnProperty("data") && rsp.data.length > 0){
_nullBg.visible = false;
createList(rsp.data)
return;
}
}
}
}
private function createList(obj:Object):void{
var i:uint;
var id:uint = 0;
for(i = 0; i < _videoItemsArr.length;i++){
if(_videoItemsArr[i] && _videoItemsArr[i].parent){
_videoItemsArr[i].parent.removeElement(_videoItemsArr[i]);
}
}
for(i = 0; i < obj.length;i++){
if(obj[i].hasOwnProperty("pic")){
if(i >= _videoItemsArr.length){
var videoItem:VideoItem = new VideoItem();
_videoItemsArr.push(videoItem);
}
_videoItemsArr[id].x = id % 2 * (_videoItemsArr[id].width + 9) + 15;
_videoItemsArr[id].y = int(id / 2) * (_videoItemsArr[id].height + 10);
//_videoItemsArr[id].load(obj[i],AppService.getInstance().context);
_videoItemsArr[id].load(obj[i],null);
_listBG.addElement(_videoItemsArr[id]);
id++;
}
}
}
public function selectTad(tab:uint):void{
_tab = tab;
clear();
loadData();
//ceshi();
}
private function ceshi():void{
var str:String = '{"result": true, "code": 0,"desc": null, "data":[' +
' {"id": 1,"filename": "刘晓霞《数阵.mp4","name": "脱衣舞","uid": 50013335,"auditStatus": null,"auditReson": null,' +
'"transVideoUrl": null,"videoUrl": "http://pkvideo.bs2dl.yy.com/刘晓霞《数阵》.mp4",' +
'"count": 999,"tid": 12345, "asid": 80012,"auditBy": null,"createBy": null, "createDate": 1503480550292,' +
'"sid": 123412235,"nickName": "80012-xxxxx","pic":"50016139"},' +
' {"id": 2,"filename": "刘晓霞《数阵.mp4","name": "脱衣舞","uid": 50013335,"auditStatus": null,"auditReson": null,' +
'"transVideoUrl": null,"videoUrl": "http://pkvideo.bs2dl.yy.com/刘晓霞《数阵》.mp4",' +
'"count": 999,"tid": 12345, "asid": 80012,"auditBy": null,"createBy": null, "createDate": 1303480550292,' +
'"sid": 123412235,"nickName": "80012-xxxxx","pic":"1362154759"},' +
' {"id": 1,"filename": "刘晓霞《数阵.mp4","name": "脱衣舞","uid": 50013335,"auditStatus": null,"auditReson": null,' +
'"transVideoUrl": null,"videoUrl": "http://pkvideo.bs2dl.yy.com/刘晓霞《数阵》.mp4",' +
'"count": 999,"tid": 12345, "asid": 80012,"auditBy": null,"createBy": null, "createDate": 1403480550292,' +
'"sid": 123412235,"nickName": "80012-xxxxx","pic":"50016139"},' +
' {"id": 2,"filename": "刘晓霞《数阵.mp4","name": "脱衣舞","uid": 50013335,"auditStatus": null,"auditReson": null,' +
'"transVideoUrl": null,"videoUrl": "http://pkvideo.bs2dl.yy.com/刘晓霞《数阵》.mp4",' +
'"count": 999,"tid": 12345, "asid": 80012,"auditBy": null,"createBy": null, "createDate": 1603480550292,' +
'"sid": 123412235,"nickName": "80012-xxxxx","pic":"1362154759"}' +
']}';
var obj:Object = JSONUtil.decode(str);
createList(obj.data);
}
}
}
/**
* {
"result": true,
"code": 0,
"desc": null,
"data": [
{
"id": 1,
"filename": "刘晓霞《数阵.mp4",
"name": "脱衣舞",
"uid": 50013335,
"auditStatus": null,
"auditReson": null,
"transVideoUrl": null,
"videoUrl": "http://pkvideo.bs2dl.yy.com/刘晓霞《数阵》.mp4",
"count": 999,
"tid": 12345,
"asid": 80012,
"auditBy": null,
"createBy": null,
"createDate": null,
"sid": 123412235,
"nickName": "80012-xxxxx",
"pic":"http://234354365546"
}
]
}**/
@@ -0,0 +1,307 @@
package com.yy.vip.pk.yyshow
{
import com.yy.vip.pk.event.JsCallEvent;
import com.yy.vip.pk.service.JsService;
import com.yy.vip.pk.util.DeposeUtil;
import com.yy.vip.pk.util.UrlUtil;
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.MouseEvent;
import flash.events.SecurityErrorEvent;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import flash.system.Security;
import flash.text.TextField;
import flash.utils.clearTimeout;
import flash.utils.setTimeout;
[SWF(width=260,height=75,frameRate=15)]
public class YYShowBrocast extends MovieClip
{
private var it : uint
private var logoLoader :Loader;
private var bgLoader:Loader;
private var bgSprite:Sprite;
private var label1:TextField;
private var label2:TextField;
private var iconLoader:Loader;
private var label3:TextField;
private var label4:TextField;
private var data:Object;
private var mainSprite:Sprite;
private var logoSprite:Sprite;
private var bgLoaderUI:Sprite;
private var iconLoaderUI:Sprite;
public function YYShowBrocast()
{
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if(stage)
initHandler();
else
this.addEventListener(Event.ADDED_TO_STAGE,this.initHandler);
}
protected function initHandler(event:Event = null):void
{
this.visible = false;
bgSprite = new Sprite();
this.addChild(bgSprite);
logoSprite = new Sprite();
bgSprite.addChild(logoSprite);
mainSprite = new Sprite();
mainSprite.x = 65;
bgSprite.addChild(mainSprite);
label1 = new TextField();
label2 = new TextField();
label3 = new TextField();
label4 = new TextField();
mainSprite.addChild(label1);
mainSprite.addChild(label2);
mainSprite.addChild(label3);
mainSprite.addChild(label4);
this.addEventListener(MouseEvent.CLICK,clickHandler);
JsService.getInstance().addEventListener(JsCallEvent.CALL_BY_MAIN_SWF,callByMainSwfHandler);
JsService.getInstance().start(JsService.PUBLIC_TOP_YYSHOW_SWF_ID);
try{
this.stage.addEventListener(MouseEvent.RIGHT_CLICK,rightClickHandler);
}
catch(e:Error)
{
}
}
protected function rightClickHandler(event:MouseEvent):void
{
event.stopImmediatePropagation();
}
protected function clickHandler(event:MouseEvent):void
{
if(this.data && this.data.url)
JsService.getInstance().callMainSwf(JsService.CMD_SHOW_ETIT_NOTICE_PANEL,JsService.PUBLIC_TOP_YYSHOW_SWF_ID,this.data.url);
}
protected function callByMainSwfHandler(event:JsCallEvent):void
{
var data:Object = event.data;
this.data = data;
if(event.cmd == JsService.CMD_BROCAST_YYSHOW)
{
this.visible = false;
bgSprite.graphics.clear();
bgSprite.graphics.beginFill(data.bgColor,1);
bgSprite.graphics.drawRect(0,0,260,75);
bgSprite.graphics.endFill();
clearLoader();
var bgUrl:String = data.bgUrl;
if(!bgLoaderUI)
{
bgLoaderUI = new Sprite()
bgSprite.addChildAt(bgLoaderUI,0);
}
if(!bgLoader){
bgLoader = new Loader();
bgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,bgCompleteHandler)
bgLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR,ioErrorHandler);
bgLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
bgLoaderUI.addChild(bgLoader);
}
if(bgUrl.indexOf("http")!=-1 && (bgUrl.indexOf(".png")!=-1 || bgUrl.indexOf(".jpg")!=-1))
bgLoader.load(new URLRequest(UrlUtil.checkHttps(bgUrl)));
label1.width = 80;
label1.x = 15;
label1.y = 10;
label1.textColor = uint(data.msgInfo.tip1Color);
label1.text = data.msgInfo.tip1;
if(!iconLoaderUI)
{
iconLoaderUI = new Sprite()
mainSprite.addChild(iconLoaderUI);
}
if(!iconLoader){
iconLoader = new Loader();
iconLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR,ioErrorHandler);
iconLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
iconLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,iconLoaderComplete);
iconLoaderUI.addChild(iconLoader);
}
iconLoaderUI.x = label1.x + label1.textWidth + 20;
iconLoaderUI.y = 10;
if(data.msgInfo.img )
{
var iconUrl:String = data.msgInfo.img;
if(iconUrl.indexOf("http")!=-1 && (iconUrl.indexOf(".png")!=-1 || iconUrl.indexOf(".jpg")!=-1))
iconLoader.load(new URLRequest(UrlUtil.checkHttps(iconUrl)));
}
label2.width = 90;
label2.x = iconLoaderUI.x + 30;
label2.y = 10;
label2.textColor = uint(data.msgInfo.nickColor);
label2.text = data.msgInfo.nick;
label3.width = 90;
label3.x = 15;
label3.y = 36;
label3.textColor = uint(data.msgInfo.roleNameColor);
label3.text = data.msgInfo.roleName;
label4.width = 90;
label4.x = label3.x + label3.textWidth + 5;
label4.y = 36;
label4.textColor = uint(data.msgInfo.roleTipColor);
label4.text = data.msgInfo.roleTip;
if(data.logo)
{
if(!logoLoader)
{
logoLoader = new Loader();
logoLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR,ioErrorHandler);
logoLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
logoLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,logoLoaderCompleteHandler);
}
if(data.logo.indexOf("http")!=-1 && (data.logo.indexOf(".png")!=-1 || data.logo.indexOf(".jpg")!=-1))
logoLoader.load(new URLRequest(UrlUtil.checkHttps(data.logo)));
}
}
}
protected function logoLoaderCompleteHandler(event:Event):void
{
if(logoLoader && logoSprite)
{
logoLoader.x = 3;
logoLoader.y = 3;
logoLoader.scaleX = logoLoader.scaleY = 0.85;
logoSprite.addChild(logoLoader);
}
if(logoLoader && logoLoader.contentLoaderInfo)
{
logoLoader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR,ioErrorHandler);
logoLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
logoLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,logoLoaderCompleteHandler);
}
}
protected function iconLoaderComplete(event:Event):void
{
if(iconLoaderUI && iconLoader)
iconLoaderUI.addChild(iconLoader);
if(iconLoader)
{
iconLoader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR,ioErrorHandler);
iconLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
iconLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,iconLoaderComplete);
}
}
protected function bgCompleteHandler(event:Event):void
{
if(!bgLoader)
return;
bgLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,bgCompleteHandler)
bgLoader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR,ioErrorHandler);
bgLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
this.mouseEnabled = this.buttonMode = this.useHandCursor = this.data.url?true:false;
JsService.getInstance().showYYShowDiv();
this.visible = true;
try{
var contentWidth:Number = bgLoader.contentLoaderInfo.width;
var contentHeight:Number = bgLoader.contentLoaderInfo.height;
var rx:Number = 260/ contentWidth;
var ry:Number = 75 / contentHeight;
bgLoaderUI.scaleY = ry;
bgLoaderUI.scaleX = rx;
clearTimeout(it);
it = setTimeout(function ():void{
depose();
}
,data.showTime * 1000);
}
catch(e:Error){
depose();
}
}
private function depose():void
{
clearTimeout(it);
clearLoader();
JsService.getInstance().hideYYShowDiv();
}
protected function ioErrorHandler(event:Event):void
{
}
private function clearLoader():void
{
try{
this.visible = false;
clearTimeout(it);
this.mouseEnabled = this.buttonMode = this.useHandCursor = false;
DeposeUtil.removeFromStage(bgLoader);
if(bgLoader)
{
bgLoader.unloadAndStop(true);
bgLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,bgCompleteHandler)
bgLoader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR,ioErrorHandler);
bgLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
}
bgLoader = null;
DeposeUtil.removeFromStage(iconLoader);
if(iconLoader)
{
iconLoader.unloadAndStop(true);
iconLoader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR,ioErrorHandler);
iconLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
iconLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,iconLoaderComplete);
}
iconLoader = null;
DeposeUtil.removeFromStage(logoLoader);
if(logoLoader)
{
logoLoader.unloadAndStop(true);
logoLoader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR,ioErrorHandler);
logoLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
logoLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,logoLoaderCompleteHandler);
}
logoLoader = null;
}
catch(e:Error){
}
}
}
}