Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

jocamo

Niveis com AS2

Recommended Posts

Estou testando algo em AS2 e já adianto que não quero nada em AS3.

Minha dúvida é por que certos swfs só carregam no nível 0. Se eu colocar nível 1....não carrega. Porque isto acontece?

Pergunto porque tenho um swf que quando clico num botão com a action loadmovie>level ...sófunciona com o "level 0".

Compartilhar este post


Link para o post
Compartilhar em outros sites

Porque provavelmente dentro desse arquivo SWF tem código chamando o _root!

 

Se o código tivesse sido feito com this provavelmente não teria esse problema.

Para resolver isso é muito fácil basta fazer _lockroot('clip')

 

Que resolve a maioria dos problemas com esse tipo de swf e projetos que vem com _root criando objetos.

 

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Porque provavelmente dentro desse arquivo SWF tem código chamando o _root!

 

Se o código tivesse sido feito com this provavelmente não teria esse problema.

Para resolver isso é muito fácil basta fazer _lockroot('clip')

 

Que resolve a maioria dos problemas com esse tipo de swf e projetos que vem com _root criando objetos.

 

Abraços

 

Onde faço esta alteração?

Segue o code do arquivo Main.as do swf que quero carregar.

 

package{	                                 
	import flash.display.*;	
	import caurina.transitions.Tweener;                     
	import caurina.transitions.properties.TextShortcuts; 		
	import caurina.transitions.properties.ColorShortcuts; 	
	import caurina.transitions.properties.FilterShortcuts; 		
	import flash.events.*;   
	import flash.net.*;     
  	import flash.text.*; 
	import flash.utils.*;
 	import flash.filters.GlowFilter;
	import flash.geom.ColorTransform; 	
	                                    	
	public class Main extends Sprite{		

		// colummns and position of the thumbnail
		private var _columns : Number;		
		// current category
		private var _curNum : Number = 0; 
		// array to store all the thumbnail images
		private var _itemIconArr : Array = new Array(); 
		// array to store all the thumbnail's link		
		private var _linkArr : Array = new Array();
		// container to store all the thumbnail items
		private var _itemContainer : Sprite = new Sprite(); 

		// the title of our product slide
		private var _title : String; 
		
		private var _itemXML:XMLList;

		// the shadow of the thumbnail image
		private var glow:GlowFilter = new GlowFilter(0xFFFFFF,1,2,2,2,2);
		
		// the container's header background color
		private var _headerColor : Number;
		
		// detecting to display the custom header color or not 
		private var _isCustomHeader : Boolean = false;
		
		private var _rotationArr : Array = [];		   
		private var _firstItem : MovieClip;
		// how many items
		private var _itemNum : Number;   
		// which item is playing now
		private var _currentNum : Number;
		private var _isOpen :Boolean = false;
		public var dragBtn : DragBtn = new DragBtn(); 
		private var aboutContent:AboutContent=new AboutContent(); 
		private var itemScroll:ItemScroll=new ItemScroll(aboutContent);
		
		private var contentContainer:Sprite=new Sprite();      
		private var _scaleRatio : Number = .6;  
		private var _smallContainerW : Number;
		
		
		private var galleryTitle:TextField = new  TextField();		
		
		private var l:Loading;    
		// the about button on the left bottom screen
		private var aboutBtn:About = new About();  
		// the location of the author's avatar
		private var avatar:String;              
		// the style of the about content
		private var style:StyleSheet = new StyleSheet();
		private var hover:Object = new Object();
		private var link:Object = new Object();
		private var _titleArr : Array = [];
		private var contentXML:XMLList = new XMLList();
		private var contentArr:Array = new Array();  
		// the about information 
		private var aboutInfo : String;
		// the author's title
		private var aboutTitle : String;    
		private var imageContent:List;
		private var galleryTitleBg:Sprite = new Sprite();
		//private var _cursorDemo : CursorDemo = new CursorDemo();
		private var intervalId:Number; 
		private var thisRoot:* = this;   
		// detecting the about information is displayed or not
		private var _isAbout : Boolean = false;               
		// detecting user has clicked the more button or not		
		private var _isMore : Boolean = false; 
                                                     

		
		// constructor function
		public function Main(){ 
			stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT; 
			stageBg.width=stage.stageWidth;
			stageBg.height=stage.stageHeight;
			TextShortcuts.init(); 			
			ColorShortcuts.init(); 
			FilterShortcuts.init(); 			
			hover.color = "#000000";
			link.textDecoration= "underline";
			link.color = "#0066CC";
			style.setStyle("a:link", link);
			style.setStyle("a:hover", hover);
			l = new Loading(); 
			l.x = stage.stageWidth/2;
			l.y = stage.stageHeight/2;
			addChild(l);	   
 			addChild(aboutBtn);
			aboutBtn.x=12;
			aboutBtn.y=stage.stageHeight-24;
			aboutBtn.alpha = 0;
			Tweener.addTween(aboutBtn, {alpha:1, time:.8, transition:"easeOutQuart"}); 																 
			aboutBtn.buttonMode = true;
			aboutBtn.addEventListener(MouseEvent.MOUSE_OVER,overAbout);
			aboutBtn.addEventListener(MouseEvent.MOUSE_OUT,outAbout);			
			loadXML(); 
			addChild(contentContainer); 
			stage.addEventListener(Event.RESIZE, layout);
		}                             
		
		// loading the xml file
	  	private function loadXML():void{
			var xmlLoader:URLLoader=new URLLoader();
			xmlLoader.load(new URLRequest("xml/gallery.xml")); 
			xmlLoader.addEventListener(ProgressEvent.PROGRESS, xmlProgress);
			xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
			xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, xmlIOError);			

		}   

		 // fire when the xml is loading
		 private function xmlProgress(e:ProgressEvent):void{
				//loading.htmlText = "<font face='Arial' size='24'>"+String(Math.floor(e.bytesLoaded / e.bytesTotal * 100))+"%</font>";
		  }

		  // parse the xml when it's been loaded
		  private function xmlLoaded(e:Event):void{  
			//loading.htmlText = "";  
			var myXML:XML = new XML(e.target.data);      

		    aboutInfo = myXML.info.text();
			aboutTitle = myXML.info.@title; 
			avatar = myXML.info.@avatar;
			var avatarLoader:Loader = new Loader();
			avatarLoader.load(new URLRequest(avatar));
			aboutContent.addChild(avatarLoader);
			avatarLoader.x = avatarLoader.y = 0;

			// the about information
			aboutContent.aboutText.wordWrap = true;
			aboutContent.aboutText.autoSize = TextFieldAutoSize.LEFT;
			aboutContent.aboutText.antiAliasType = AntiAliasType.ADVANCED;
			var pattern:RegExp = /(%09)+|(%0A)+|(%0D)+/g;
			var st:String = aboutInfo.replace(pattern, "");
			st = decodeURI(st);
			aboutContent.aboutText.styleSheet=style
			aboutContent.aboutText.htmlText=st;
			aboutContent.authorText.wordWrap = true;
			aboutContent.authorText.autoSize = TextFieldAutoSize.LEFT;
			aboutContent.authorText.multiline = true;						
			aboutContent.authorText.text = aboutTitle;
			
			
		 	_itemXML=myXML.stack;
			var _itemNum:Number=_itemXML.length();  
		   
			for(var i:int=0;i<_itemNum;i++){
				_itemIconArr[i]=(_itemXML.@thumb[i]);
				_linkArr[i]=(_itemXML.@link[i]);		
				_titleArr[i]=(_itemXML.@title[i]);
				contentArr[i] = _itemXML[i].image; 				  				
			}          
		 
			aboutBtn.addEventListener(MouseEvent.CLICK, clickAbout);                      

			addImageItem(_itemIconArr); 	        
		}                              


	   	// fire when the xml location is uncorrect
		public function xmlIOError(e:IOErrorEvent):void{

		}		      
			   
		// add the displayobject to the stage
		private function initContainer():void{
            // try to remove exist element in the stage
			removeExist();

			galleryTitleBg.graphics.beginFill(0xFFFFFF);
			galleryTitleBg.graphics.lineStyle(0, 0xFFFFFF);
			galleryTitleBg.graphics.drawRect(0, 0, 480, 24);
			galleryTitleBg.graphics.endFill();              
			addChild(galleryTitleBg);
		   
			imageContent= new List(contentArr[_currentNum]);
			imageContent.name = "imageContent";
			//imageContent.alpha = 1;

			this.addChild(imageContent);
			//Tweener.addTween(contentContainer, {alpha:1, time:.5, transition:"easeOutQuart"});  						
			galleryTitleBg.alpha = 0;
			galleryTitleBg.addChild(galleryTitle);         
			galleryTitleBg.buttonMode = true;
			galleryTitle.mouseEnabled = false;
			galleryTitle.selectable = false;           
			galleryTitleBg.addEventListener(MouseEvent.CLICK,clickImage)			
			var tf:TextFormat = new TextFormat();  
			tf.size=14;
			tf.font="Verdana";
			galleryTitle.defaultTextFormat = tf;
			galleryTitle.textColor=0x000000;
			galleryTitle.autoSize = TextFieldAutoSize.LEFT
			galleryTitle.text="";
 			Tweener.addTween(galleryTitle, {_text:_titleArr[_currentNum].toString(),time:.5, transition:"easeOutQuart"});  									
		     		
		} 
      
		
		// remove exist displayobjec on the stage 
		private function removeExist():void{
			try{ 
				Tweener.removeTweens(galleryTitle);
				Tweener.removeTweens(imageContent);        
				galleryTitle.text="";  
				if(thisRoot.contains(galleryTitleBg)){
					thisRoot.removeChild(galleryTitleBg);
				}  			        
				if(thisRoot.getChildByName("imageContent")!=null){
					var mc:MovieClip = MovieClip(getChildByName("imageContent"));
					Tweener.addTween(mc, {y:mc.y+100,alpha:0,time:.2, transition:"easeOutQuart",onComplete:function():void{
						thisRoot.removeChild(thisRoot.getChildByName("imageContent"));						
					}});  									

				}
				if(thisRoot.contains(aboutContent)){
					Tweener.addTween(aboutContent, {y:1200,time:.5, transition:"easeOutQuart",onComplete:function():void{
						thisRoot.removeChild(aboutContent);						
					}});  									
					Tweener.addTween(itemScroll, {y:1200,time:.5, transition:"easeOutQuart",onComplete:function():void{
						thisRoot.removeChild(itemScroll);           						
					}});  									
					
				}     						

		       }catch(e:Error){
				
		       }	
		}                 
		// dynamic change each displayobject's layout
		private function layout(e:Event):void{
			aboutBtn.x=12;
			aboutBtn.y=stage.stageHeight-24;
			l.x = stage.stageWidth/2;
			l.y = stage.stageHeight/2;
			
			
			try{
				imageContent.x= (stage.stageWidth-imageContent.width)/2+100;			
				imageContent.y= (stage.stageHeight-300)/2;     
				galleryTitleBg.x=/*galleryTitle.x =*/ imageContent.x + 58;
				galleryTitleBg.y=/*galleryTitle.y = */imageContent.y - 14;

				aboutContent.y=itemScroll.y=(stage.stageHeight-itemScroll.height)/2;			
				aboutContent.x=_itemContainer.x+_itemContainer.width/2+36;                                                       
				itemScroll.x = aboutContent.x+aboutContent.width+16;
			}catch(e:Error){
				
			}	
			stageBg.width=stage.stageWidth;
			stageBg.height=stage.stageHeight; 
			/*
			galleryTitle.x=_itemContainer.x+_itemContainer.width/2+59;
			galleryTitle.y=_itemContainer.y-_itemContainer.height/2-36;
			*/
			
		}
		
	   
		
		// add the thumbnail item to the container
		private function addImageItem(a:Array):void{
			addChild(_itemContainer); 
			_itemNum = a.length;
			for(var i:int=0;i<_itemNum;++i){
				var si:StackItem = new StackItem();                 
			 	var lo:Loader = new Loader();
				var tf:TextField = new TextField();
				var _loadingTf:TextField = new TextField();
				 
				lo.load(new URLRequest(_itemIconArr[i]));                                               
				lo.contentLoaderInfo.addEventListener (Event.COMPLETE, _thumbLoaded); 				
				
				lo.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, _thumbProgress);			
				lo.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, _thumbIOError);	            
				lo.name = "iconLoader";
				si.addChild(lo);
				lo.x = si.width - 64;
				lo.y = 20;     
				_smallContainerW = 2*si.width*_scaleRatio;																												                                                           
				 				
				_itemContainer.addChild(si);  				
				_rotationArr[i]=i*(360/_itemNum-5)+15; 
				
				si.buttonMode = true; 
				si.name = i.toString();
				si._label.text=_titleArr[i];
				si.alpha = .9;
				
				si._more.visible = false;

				Tweener.addTween(si._bg, {_hue:120/_itemNum*i,/*_contrast:1,*/time:.5, transition:"easeOutQuart"}); 										
				si._more.addEventListener(MouseEvent.CLICK,_clickMore);
				si.addEventListener(MouseEvent.CLICK,_clickItem);
				//si.blendMode = BlendMode.DARKEN;
				si.cacheAsBitmap = true;
			}             
			_itemContainer.x = (stage.stageWidth-_itemContainer.width)/2;
			_itemContainer.y = (stage.stageHeight-_itemContainer.height)/2;			 
			
			_firstItem = _itemContainer.getChildByName((_itemNum-1).toString()) as MovieClip;			
			_firstItem.addEventListener(MouseEvent.CLICK,_clickfirstItem); 
			/*
			_firstItem.addChild(_cursorDemo);     
			_cursorDemo.x=_cursorDemo.y=40;			
			*/
			Tweener.addTween(_firstItem._bg, {_hue:-180, _contrast:1,time:.5, transition:"easeOutQuart"}); 													
			_itemContainer.addChild(dragBtn);  
			dragBtn.buttonMode = true;
			_enableDrag();
			stage.addEventListener(MouseEvent.MOUSE_UP,_upDrag);    
			//_clickfirstItem(null);
 			//intervalId = setTimeout(_clickfirstItem, 2000, null);			
		}             
                        
		// display the about content, fire when user click the about button on the left bottom
		private function clickAbout(e:MouseEvent):void{
			if(!_isOpen) {
				_clickfirstItem(null); 
			} 
			removeExist();	
         
			if(!_isMore) {
			
				 Tweener.addTween(_itemContainer, {scaleY:_scaleRatio,scaleX:_scaleRatio, time:.5, transition:"easeOutQuart",onComplete:function():void{   
				     Tweener.addTween(_itemContainer, {y:(stage.stageHeight)/2,x:(stage.stageWidth)/2-320,time:.5, transition:"easeOutQuart",onComplete:function():void{ 
					if(!_isAbout){ 
						addChild(aboutContent);                      
						if(aboutContent.height>itemScroll.height){   
							addChild(itemScroll);						
						}

						aboutContent.y=itemScroll.y=(stage.stageHeight-itemScroll.height)/2;			
						aboutContent.x=_itemContainer.x+_itemContainer.width/2+36;                                                       
						itemScroll.x = aboutContent.x+aboutContent.width+16; 			
						_isAbout = true;
					}else{
						
					}
					//layout(null);
					if(!_isMore) e.stopPropagation();									   					
					_isMore = true;   

				}})      
					
				}});               
			}else{
					addChild(aboutContent);
					addChild(itemScroll);          
					aboutContent.y=itemScroll.y=(stage.stageHeight-itemScroll.height)/2;			
					aboutContent.x=_itemContainer.x+_itemContainer.width/2+24;                                                       
					itemScroll.x = aboutContent.x+aboutContent.width+12; 			
                
			}
		}           
		// make the about button darker, fire when user move over the about button
		private function overAbout(e:MouseEvent):void{
			Tweener.addTween(aboutBtn, {_brightness:-1,time:.5, transition:"easeOutQuart"}); 													
		}   
		// make the about button lighter, fire when user move out the about button
		private function outAbout(e:MouseEvent):void{
			Tweener.addTween(aboutBtn, {_brightness:0,time:.5, transition:"easeOutQuart"}); 																
		}
		// fire when user click the more button
		private function _clickMore(e:MouseEvent):void{
				//addChild(itemScroll);                                                        
				//itemScroll.x = _itemContainer.width; 			 
				var si:StackItem = StackItem(_itemContainer.getChildByName(_currentNum.toString()));						
				Tweener.addTween(_itemContainer, {scaleY:_scaleRatio,scaleX:_scaleRatio, time:.5, transition:"easeOutQuart",onComplete:function():void{
				     initContainer(); 											   
					 layout(null);				
				     Tweener.addTween(_itemContainer, {y:(stage.stageHeight)/2,x:(stage.stageWidth)/2-320,time:.4, transition:"easeOutQuart",onComplete:function():void{
					 //layout(null);
					 if(!_isMore) {
						e.stopPropagation();									   					
						Tweener.addTween(si._more, {alpha:0,time:.5, transition:"easeOutQuart"});  			
					}

						
					 _isMore = true;   
					
				}})      
					
				}});                                          
			 
		}   
		// disable user to drag the stackmenu
		private function _enableDrag():void{
			_firstItem.addEventListener(MouseEvent.CLICK,_clickfirstItem);   
			dragBtn.addEventListener(MouseEvent.MOUSE_DOWN,_downDrag);
			dragBtn.addEventListener(MouseEvent.MOUSE_UP,_upDrag);			
			
		}                       
		// make the stack menu dragable                         
		private function _disableDrag():void{
			_firstItem.removeEventListener(MouseEvent.CLICK,_clickfirstItem);
			dragBtn.removeEventListener(MouseEvent.MOUSE_DOWN,_downDrag);
			dragBtn.removeEventListener(MouseEvent.MOUSE_UP,_upDrag);			

		}
		
		private function _downDrag(e:MouseEvent):void{
			_itemContainer.startDrag();
		}
		private function _upDrag(e:MouseEvent):void{
			_itemContainer.stopDrag();
		}

		
		// fire when user click the stack menu
		private function _clickItem(e:MouseEvent):void{
			var _tempNum:Number =e.currentTarget.name;	 
			//if(intervalId) clearInterval(intervalId)
			if(_tempNum != _itemNum-1){
				if(_currentNum!=_tempNum){    
					var preSI:StackItem = StackItem(_itemContainer.getChildByName(_currentNum.toString()));								
					_hidePreIcon();
					Tweener.addTween(preSI, {rotation:_rotationArr[_currentNum], time:.5, transition:"easeOutQuart",onComplete:function():void{
						preSI._more.visible = false;
						preSI._more.alpha = 1;
					}}); 													
				
				}
				var si:StackItem = StackItem(_itemContainer.getChildByName(_tempNum.toString()));		
				try{
					var _bm:Bitmap = Bitmap(Loader(si.getChildByName("iconLoader")).content);                                   	
					_bm.visible = true;                                                                                         					                                                                                                    	 	  Tweener.addTween(_bm, {alpha:1,time:.5, delay:.5, transition:"easeOutQuart"});  						
				}catch(e:Error){
					
				}
				Tweener.addTween(si, {rotation:0, time:.4, transition:"easeOutQuart",onComplete:function():void{
					if(_isMore){
						_clickMore(null);
					}else{
						si._more.visible = true; 													  					
						si._more.alpha = 1;						
					}

				}}); 													
				_currentNum = _tempNum;

			}             
			e.stopPropagation();
		}           
		// make all the stack menu and about button clickable		                 
		private function _enableItemClick():void{ 
			aboutBtn.addEventListener(MouseEvent.CLICK, clickAbout);			
			for(var i:int=0;i<_itemNum;++i){   
				var si:StackItem = StackItem(_itemContainer.getChildByName(i.toString()));
				si.addEventListener(MouseEvent.CLICK,_clickItem);
				si.buttonMode = true;
			}
		}   
		// make all the stack menu and about button unclickable
		private function _disableItemClick():void{ 
			aboutBtn.removeEventListener(MouseEvent.CLICK, clickAbout);			
			for(var i:int=0;i<_itemNum;++i){   
				var si:StackItem = StackItem(_itemContainer.getChildByName(i.toString()));
				si.removeEventListener(MouseEvent.CLICK,_clickItem);					
				si.buttonMode = false;
			}     
			_firstItem.buttonMode = true;
			
		}        
		// hide the icon of previous stack menu
		private function _hidePreIcon():void{  
			var preSI:StackItem = StackItem(_itemContainer.getChildByName(_currentNum.toString()));			
			try{
				var _preBm:Bitmap = Bitmap(Loader(preSI.getChildByName("iconLoader")).content);						
				Tweener.addTween(_preBm, {alpha:0,time:.5, transition:"easeOutQuart"});  						
				Tweener.addTween(preSI._more, {alpha:0,time:.5, transition:"easeOutQuart"});  										
			}catch(e:Error){

			}	 
		}
		// fire when user click the cover stack menu
		private function _clickfirstItem(e:MouseEvent):void{
	
			removeExist();     
			_isMore = false;			
			_hidePreIcon();			 
			var _tempNum:Number = 0;        
			Tweener.addTween(_itemContainer, {scaleY:1,scaleX:1,time:.5, transition:"easeOutSine",onComplete:function():void{
				//Tweener.addTween(_itemContainer, {scaleY:1,scaleX:1,time:.5,transition:"easeOutQuart"});				
			}});  									   				
			
			for(var i:int=0;i<_itemNum;++i){   
				var si:StackItem = StackItem(_itemContainer.getChildByName(i.toString()));
				if(!_isOpen){     
					_disableDrag();
					//_disableItemClick();       
						Tweener.addTween(_itemContainer, {y:(stage.stageHeight)/2,x:(stage.stageWidth)/2, time:.3, transition:"easeOutQuart"}); 									
					Tweener.addTween(si, {rotation:_rotationArr[i], time:.3, delay:(_itemNum/6-i*.2), transition:"easeOutBounce",onComplete:function():void{ 
						_tempNum++;              						
						if(_tempNum==_itemNum-1){ 
							_enableItemClick();							
							_enableDrag();
							_isOpen = true;	
						}
					}}); 														

				}else{       
					_disableItemClick();         									           
					_disableDrag();					
					Tweener.addTween(si, {rotation:0, rounded:true,time:.3, delay:(_itemNum/6-i*.2), transition:"easeInOutBounce",onComplete:function():void{
						_tempNum++;     
						Tweener.addTween(_itemContainer, {y:(stage.stageHeight-_firstItem.height)/2,x:(stage.stageWidth-_itemContainer.width)/2, time:.5, transition:"easeOutQuart"}); 																											

						if(_tempNum==_itemNum-1){  
							_enableItemClick();
							_enableDrag();
							_isOpen = false; 
							_isAbout = false;                               							   				
						}
						
					}}); 																			
				}
			}      
			
		}
		
		// fire when the thum image is downloading
		private function _thumbProgress(e:ProgressEvent):void{
			//trace("loading",String(Math.floor(e.bytesLoaded / e.bytesTotal * 100)))   
            //loading.htmlText = "<font face='Arial' size='24'>"+String(Math.floor(e.bytesLoaded / e.bytesTotal * 100))+"%</font>";    
		}                                                  
		                            
		// fire when the thum image is loaded
		private function _thumbLoaded(e:Event):void{ 
		   	l.visible = false;
			var tempLoader:Loader=Loader(e.target.loader);
			/*
			var _tf:TextField=TextField(tempLoader.parent.getChildByName("_loadingTf"));
			_tf.visible=false;
			*/
			if(tempLoader.content is Bitmap){    
				//get the loaders content as a bitmap
				var _tempBM:Bitmap = Bitmap(tempLoader.content);
				_tempBM.smoothing=true;
				//_tempBM.visible = true;
				_tempBM.alpha = 0;
				_tempBM.cacheAsBitmap = true;                              
				_tempBM.width = 55;
				_tempBM.height = 55;
				//Tweener.addTween(_tempBM, {_filter:glow, time:.5, transition:"easeoutsine"}); 						
				if(tempLoader.parent == _firstItem){
				  	var _firstBm:Bitmap = Bitmap(Loader(_firstItem.getChildByName("iconLoader")).content);
					_firstBm.alpha = 1;
					_firstBm.visible = true;
					
				}
			}	        
  
		}                
		
		// fire when the thumb location is uncorrect
		public function _thumbIOError(e:IOErrorEvent):void{
			    trace(e);
			
		}              
		// open the link on a new window when user click the thumbnail
		private function clickImage(e:MouseEvent):void{
            try {            
                navigateToURL(new URLRequest(_linkArr[_currentNum]),"_blank");
            }
            catch (e:Error) {
                // handle error here
            }
		}		 
	   
	}
}        

Compartilhar este post


Link para o post
Compartilhar em outros sites

Caro Jocamo acho que você está confundindo as bolas...

Isso ai é AS 3.0!!!

 

Se você ta tentando abrir isso em um arquivo AS 2.0 não vai funcionar nunca!!! por incompatibilidade de scripts...

E não tem nada de errado com o package até onde eu sei, ele passou no teste de erros... sem erro nenhum

 

Se você realmente está tentando abrir isso em AS 2 ai sim você vai ter milhões de erros rs...

 

 

abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Caro Jocamo acho que você está confundindo as bolas...

Isso ai é AS 3.0!!!

 

Se você ta tentando abrir isso em um arquivo AS 2.0 não vai funcionar nunca!!! por incompatibilidade de scripts...

E não tem nada de errado com o package até onde eu sei, ele passou no teste de erros... sem erro nenhum

 

Se você realmente está tentando abrir isso em AS 2 ai sim você vai ter milhões de erros rs...

 

 

abraços

 

 

OLha só Berseck,

Sei que dá conflito com AS diferentes.

O que quero que você entenda é que :

Abro o Flash,. crio um arquivo em AS2 e coloco no botão a ação,

 

on (release) {
	loadMovieNum("cartela.swf", 0);
}

 

(Obs: este arquivo "cartela.swf" foi gerado via classes e arquivos ActionScript as ....> em AS3)

 

Mas mesmo assim , no arquivo que gerei em AS2 , quando clico no botão , carrega o arquivo "cartela.swf"

Agora, se coloco "level 1" na ação loadMovieNum, não carrega.

Minha dúvida é só esta.

Esclareço que já tentei fazer o arquivo que chama o swf cartela.swf em AS3 com este code no frame e mesmo assim não carrega o arquivo cartela.swf

 

//instanciando as variaveis
    var imgRequest:URLRequest;
    var imgLoader:Loader = new Loader();
    
    //chamando função para carregar arquivo
    loadMc.addEventListener(MouseEvent.CLICK,carregarArquivo);
    unLoadMc.addEventListener(MouseEvent.CLICK,descarregarArquivo);
    //função para carregar o arquivo
    function carregarArquivo(evt:MouseEvent):void {
       //aponta objeto que deve ser carregado
       imgRequest = new URLRequest("cartela.swf");
       //executa o carregamento
       imgLoader.load(imgRequest);
       //determino a posição x e y do objeto dentro do palco
       imgLoader.x = 200;
       imgLoader.y =150;
       //adiciono o objeto ao palco
       addChild(imgLoader);
    }
    //função para descarregar o arquivo
    function descarregarArquivo(evt:MouseEvent):void {
       //descarrega os arquivos carregados pela variavel imgLoader
       imgLoader.unload();
       
    }

Compartilhar este post


Link para o post
Compartilhar em outros sites

Bom primeiramente você não deveria abrir arquivo algum de AS 3 em AS 2....

E não se usa mais loadMovieNum... e sim loadMovie ou clipLoad da classe MovieClipLoader

 

Só uma dica par ti... esse seu cartola da vida ai ta extendendo a MAIN!!! e não um movie clip...... ou seja ele vai EXTENDER O ROOT!!!!

Se não tentar carregar no root... ele não vai carregar a classe simples assim.....

 

Faça a classe extender movieclip.... ai quem sabe tu consegue carregar dentro de um MovieClip...

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.