dota2 fatal error报错error in connect0 of interface'gameu1011'

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.
I am new to flash, so the solution to this problem may be simple. Unfortunately I have been unable to find a working solution, so I am hoping you guys can help. I am developing a site using 3rd party flash - Coverflow, for an album. It looks great and you can download it here: . My challenge is that I want to progress the albums from a Javascript call within my HTML. In my search I have discovered ExternalInterface, but I can't get it to work. When I try to export the movie I get an "Access of undefined property gotoCoverFlowItem" error.
Below follows the code contained in the Coverflow.ai file which I am trying to modify, with the modification in it. The full code can be found at the link above. I am using the Flash 10 version.
////////////////////////////////////////////
// Project: Flash 10 Coverflow
// Date: 10/3/09
// Author: Stephen Weber
////////////////////////////////////////////
////////////////////////////////////////////
// IMPORTS
////////////////////////////////////////////
import flash.display.S
import flash.display.BitmapD
import flash.display.B
import flash.display.GradientT
import flash.display.G
import flash.display.S
import flash.display.MovieC
import flash.display.BlendM
import flash.display.L
import flash.events.E
import flash.events.KeyboardE
import flash.events.MouseE
import flash.events.IOErrorE
import flash.geom.M
import flash.geom.R
import flash.geom.ColorT
import flash.net.URLR
import flash.net.URLL
import flash.net.navigateToURL;
import flash.display.S
import flash.utils.setT
import flash.external.ExternalI
//TweenLite - Tweening Engine - SOURCE: /tweenliteas3/
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;
public class Coverflow extends Sprite {
////////////////////////////////////////////
// VARIABLES
////////////////////////////////////////////
// size of the stage
private var sw:N
private var sh:N
private var background:B
// padding between each cover, can be customed via xml
private var coverflowSpacing:Number=30;
// transition time for movement
private var transitionTime:Number=0.75;
// the center of the stage
private var centerX:N
private var centerY:N
// store each image cover's instance
private var coverArray:Array=new Array();
// title of each image
private var coverLabel:CoverflowTitle = new CoverflowTitle();
// the slider under the image cover
private var coverSlider:S
// how many image covers
private var coverflowItemsTotal:N
// how to open the link
private var _target:S
// size of the image cover
private var coverflowImageWidth:N
private var coverflowImageHeight:N
//Holds the objects in the data array
private var _data:Array = new Array();
// the y position of the item's title
private var coverLabelPositionY:N
//Z Position of Current CoverflowItem
private var centerCoverflowZPosition:Number=-125;
// display the middle of the cover or not
private var startIndexInCenter:Boolean=
// which cover to display in the beginning
private var startIndex:Number=0;
// the slide's Y position
private var coverSlidePositionY:N
//Holder for current CoverflowItem
private var _currentCover:N
//CoverflowItem Container
private var coverflowItemContainer:Sprite = new Sprite();
//XML Loading
private var coverflowXMLLoader:URLL
private var coverflowXML:XML;
// the image cover's white border padding
private var padding:Number=4;
// stage reference
private var _stage:S
//reflection
private var reflection:R
//Reflection Properties
private var reflectionAlpha:N
private var reflectionRatio:N
private var reflectionDistance:N
private var reflectionUpdateTime:N
private var reflectionDropoff:N
////////////////////////////////////////////
// CONSTRUCTOR - INITIAL ACTIONS
////////////////////////////////////////////
public function Coverflow(_width:Number, _height:Number, __stage:Stage = null):void {
centerX=_width&&1;
centerY=(_height&&1) - 20;
loadXML();
//Grabs Background color passed in through FlashVars
var backgColor:String = _stage.loaderInfo.parameters["backgroundColor"];
if(backgColor == null) {
backgColor = "0x000000";
//backgColor = "0xFFFFFF";
//Creates Background MovieClip
background = new Background();
//Set Background To Provided Width/Height
background.width = _
background.height = _
//Adds background MovieClip to DisplayList
addChild(background);
//Tints Background MovieClip with provided tint
TweenPlugin.activate([TintPlugin]);
TweenLite.to(background, 0, {tint:backgColor});
//Grabs Background color passed in through FlashVars
var labelColor:String = _stage.loaderInfo.parameters["labelColor"];
//Check for value and then default
if(labelColor == null) {
//labelColor = "0x000000";
labelColor = "0xFFFFFF";
//Tint Coverflow label to color provided
TweenLite.to(coverLabel, 0, {tint:labelColor});
if (_stage) {
_stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
////////////////////////////////////////////
// FUNCTIONS
////////////////////////////////////////////
private function keyDownHandler(e:KeyboardEvent):void {
if (e.keyCode==37||e.keyCode==74) {
clickPre();
if (e.keyCode==39||e.keyCode==75) {
clickNext();
// 72 stand for "H" key, 191 stand for "?" key
if (e.keyCode==72||e.keyCode==191) {
// display the previous image
private function clickPre(e:Event=null):void {
_currentCover--;
if (_currentCover&0) {
_currentCover=coverflowItemsTotal-1;
coverSlider.value=_currentC
gotoCoverflowItem(_currentCover);
// display the next image
private function clickNext(e:Event=null):void {
_currentCover++;
if (_currentCover&coverflowItemsTotal-1) {
_currentCover=0;
coverSlider.value=_currentC
gotoCoverflowItem(_currentCover);
// loading the XML
private function loadXML():void {
//Loads XML passed through FlashVars
var xml_source:String = _stage.loaderInfo.parameters["xmlPath"];
//If XML not found through FlashVars then defaults to xml path below
if(xml_source == null) {
xml_source = 'xml/data.xml';
// loading the cover xml here
coverflowXMLLoader = new URLLoader();
coverflowXMLLoader.load(new URLRequest("xml/data.xml"));
coverflowXMLLoader.PLETE, coverflowXMLLoader_Complete);
coverflowXMLLoader.addEventListener(IOErrorEvent.IO_ERROR, coverflowXMLLoader_IOError);
// parse the XML
private function coverflowXMLLoader_Complete(e:Event):void {
coverflowXML=new XML(e.target.data);
coverflowItemsTotal=coverflowXML.cover.length();
coverflowSpacing=Number(coverflowXML.@coverflowSpacing);
coverflowImageWidth=Number(coverflowXML.@imageWidth);
coverflowImageHeight=Number(coverflowXML.@imageHeight);
coverLabelPositionY=Number(coverflowXML.@coverLabelPositionY);
coverSlidePositionY=Number(coverflowXML.@coverSlidePositionY);
transitionTime=Number(coverflowXML.@transitionTime);
centerCoverflowZPosition=Number(coverflowXML.@centerCoverflowZPosition);
//Image Border
padding = Number(coverflowXML.@imagePadding)
//Reflection Attributes
reflectionAlpha=Number(coverflowXML.@reflectionAlpha);
reflectionRatio=Number(coverflowXML.@reflectionRatio);
reflectionDistance=Number(coverflowXML.@reflectionDistance);
reflectionUpdateTime=Number(coverflowXML.@reflectionUpdateTime);
reflectionDropoff=Number(coverflowXML.@reflectionDropoff);
startIndex=Number(coverflowXML.@startIndex);
startIndexInCenter = (coverflowXML.@startIndexInCenter.toLowerCase().toString()=="yes");
_target=coverflowXML.@target.toString();
for (var i=0; i&coverflowItemsT i++) {
//Make An Object To Hold Values
var _obj:Object = new Object();
//Set Values To Object from XML for each CoverflowItem
_obj.image = (coverflowXML.cover[i].@img.toString());
_obj.title = (coverflowXML.cover[i].@title.toString());
_obj.link = (coverflowXML.cover[i].@link.toString());
_data[i] = _
loadCover();
private function coverflowXMLLoader_IOError(event:IOErrorEvent):void {
trace("Coverflow XML Load Error: "+ event);
// load the image cover when xml is loaded
private function loadCover():void {
for (var i:int = 0; i & coverflowItemsT i++) {
var cover:Sprite=createCover(i,_data[i].image);
coverArray[i]=
cover.y=centerY;
cover.z=0;
coverflowItemContainer.addChild(cover);
if (startIndexInCenter) {
startIndex=coverArray.length&&1;
gotoCoverflowItem(startIndex);
gotoCoverflowItem(startIndex);
_currentCover=startI
coverSlider=new Scrollbar(coverflowItemsTotal,_stage);
coverSlider.value=startI
coverSlider.x = (_stage.stageWidth/2) - (coverSlider.width/2);
coverSlider.y=_stage.stageHeight-40;
coverSlider.addEventListener("UPDATE", coverSlider_Update);
coverSlider.addEventListener("PREVIOUS", coverSlider_Previous);
coverSlider.addEventListener("NEXT", coverSlider_Next);
addChild(coverSlider);
//coverLabel.x = (sw - coverLabel.width)&&1;
coverLabel.x = (_stage.stageWidth/2) - (coverLabel.width/2);
coverLabel.y=coverLabelPositionY;
addChild(coverLabel);
addChild(coverSlider);
addChild(coverLabel);
private function coverSlider_Update(e:Event):void {
var value:Number=(coverSlider.value);
gotoCoverflowItem(value);
e.stopPropagation();
private function coverSlider_Previous(e:Event):void {
clickPre();
private function coverSlider_Next(e:Event):void {
clickNext();
// move to a certain cover via number
private function gotoCoverflowItem(n:int):void {
_currentCover=n;
reOrderCover(n);
if (coverSlider) {
coverSlider.value=n;
ExternalInterface.addCallback("gotoCover", gotoCoverflowItem);
private function cover_Selected(event:CoverflowItemEvent):void {
var currentCover:uint=event.data.
if (coverArray[currentCover].rotationY==0) {
// open the link if user click the cover in the middle again
if (_data[currentCover].link!="") {
navigateToURL(new URLRequest(_data[currentCover].link), _target);
} catch (e:Error) {
gotoCoverflowItem(currentCover);
// change each cover's position and rotation
private function reOrderCover(currentCover:uint):void {
for (var i:uint = 0, len:uint = coverArray. i & i++) {
var cover:Sprite=coverArray[i];
if (i&currentCover) {
//Left Side
TweenLite.to(cover, transitionTime, {x:(centerX - (currentCover - i) * coverflowSpacing - coverflowImageWidth/2), z:(coverflowImageWidth/2), rotationY:-65});
} else if (i & currentCover) {
//Right Side
TweenLite.to(cover, transitionTime, {x:(centerX + (i - currentCover) * coverflowSpacing + coverflowImageWidth/2), z:(coverflowImageWidth/2), rotationY:65});
//Center Coverflow
TweenLite.to(cover, transitionTime, {x:centerX, z:centerCoverflowZPosition, rotationY:0});
//Label Handling
coverLabel._text.text=_data[i].
coverLabel.alpha=0;
TweenLite.to(coverLabel, 0.75, {alpha:1,delay:0.2});
for (i = 0; i & currentC i++) {
addChild(coverArray[i]);
for (i = coverArray.length - 1; i & currentC i--) {
addChild(coverArray[i]);
addChild(coverArray[currentCover]);
if (coverSlider) {
addChild(coverSlider);
addChild(coverLabel);
//Create CoverflowItem and Set Data To It
private function createCover(num:uint, url:String):Sprite {
//Setup Data
var _data:Object = new Object();
//Create CoverflowItem
var cover:CoverflowItem=new CoverflowItem(_data);
//Listen for Click
cover.addEventListener(CoverflowItemEvent.COVERFLOWITEM_SELECTED, cover_Selected);
//Set Some Values
cover.name=num.toString();
cover.image=
cover.padding=
cover.imageWidth=coverflowImageW
cover.imageHeight=coverflowImageH
cover.setReflection(reflectionAlpha, reflectionRatio, reflectionDistance, reflectionUpdateTime, reflectionDropoff);
//Put CoverflowItem in Sprite Container
var coverItem:Sprite = new Sprite();
cover.x=- coverflowImageWidth/2-
cover.y=- coverflowImageHeight/2-
coverItem.addChild(cover);
coverItem.name=num.toString();
return coverI
The code I added is:
ExternalInterface.addCallback("gotoCover", gotoCoverflowItem);
Please help!
109k18185238
Putting the ExternalInterface call at the end of the Coverflow constructor should work as desired. The current line you have is not inside a function.
I don't know what your javascript looks like, but this code requires a parameter for gotoCoverflowItem, so I am assuming you are passing the appropriate data.
I haven't gone through all the code, but keep in mind that the current code might have certain things that it does
- that might not get done if you are feeding it just the index of the next cover. I do see code in the gotoColorflowItem function that updates variables for the slider and current cover based on the selection, so it might be just fine.
Also, you are most likely going to get a runtime error if you try to test this outside of a browser for any reason, so you might want to put a try/catch for that case.
The author included his wisdom on the page :
"NOTE: I would not recommend trying to learn flash with this file. There are a lot of people asking how to change text color, if you are having these requests I would suggest going through
Flash tutorials to get you familiar with Flash or hiring a Flash developer to help you out."
5,42911226
Well, you can't just dump the ExternalInterface call anywhere you want to. It needs to be inside a function such as the constructor.
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled

我要回帖

更多关于 dota2 steam error 的文章

 

随机推荐