动作脚本2.0

时间:2009-10-29 08:17:45

标签: actionscript

嗨,我有一个小闪光灯如下

public function startApp () : Void
 {
  mcWindowRoot.refToClass = this;
  mcNext = mcWindowRoot;
  _oLogoutDelegate = Delegate.create (this, onLogoutHandler);
  _oWindowManagerRef.addEventListener ("onLogout", _oLogoutDelegate);
  loadWhatNext ();
 }
 /**
 * Enter description here
 *
 */
 function loadWhatNext (mc : MovieClip) : Void
 {
  var doneFinish = mcNext.container.attachMovie ("done", "done", mcNext.container.getNextHighestDepth ());
  //var returnPage = mcNext.container.attachMovie ("item", "item", mcNext.container.getNextHighestDepth () , 
              //{
               //_x : 135, _y : 230
              //});

  var miRefTemp = _oWindowManagerRef;
  //returnPage.item_txt.htmlText = _level0.account_Return;
  //returnPage.onPress = 
  doneFinish.onPress = function ()
  {
   trace ("AccountNext returnPage.onPress doneFinish.onPress" )
   trace ("AccountNext miRefTemp " + miRefTemp)
   trace ("AccountNext this.refToClass " + this._parent._parent.refToClass)
   trace ("AccountNext this " + this)
   this._parent._parent.refToClass.closeWindow ();

   _oShell.loadWindow( "", null);
  }

  if (aNextdata != undefined && aNextdata.length > 0)
  {
   for (var i = 0 ; i < 3; i ++)
   {
    if (aNextdata [i].text != undefined)
    {
     var tempItem = mcNext.copy.attachMovie ("item", "item" + i, i, 
     {
      _x : 143, _y : 150 + (i * 20)
     });
     tempItem.item_txt.htmlText = aNextdata [i].text;
     tempItem.url = aNextdata [i].link;
     tempItem.refToClass = _refWindow;
     var asInterpreter = new asFunctionInterpreter (_oWindowManagerRef._oWindowManagerRef.oController.propertiesMap.get ("BaseURL") , this);
     var deepLinks : Object = new Object ();

     deepLinks = asInterpreter.getAsSingleURL ( aNextdata [i].link );

     tempItem.deepLinks = deepLinks;

     trace("Next :: LINKS : " + tempItem.wModule );

     tempItem.oShell = _oShell;
     tempItem.onPress = function ()
     {
      if (this.deepLinks.type == "internal")
      {
       this.oShell.loadWindow( this.deepLinks.wModule , this.deepLinks.wParams);
      } 
      else
      {
       getURL (this.deepLinks.link, "_blank");
      }

      this.refToClass.closeWindow ();
     }
    }
   }
  } else
  {
   trace ("end tab " + _refWindow);
  }
 }
 /**
 * Enter description here
 *
 * @param  evt
 */
 private function onLogoutHandler (evt : Object) : Void
 {
  _oWindowManagerRef.removeEventListener ("onLogout", _oLogoutDelegate);
  closeWindow ();
 }
 /**
 * Enter description here
 *
 */
 public function closeMyWindow () : Void
 {
  _global._doNav ('windowType:wclose')
 }
 /**
 * Enter description here
 *
 */
 public function removeMyWindow () : Void
 {
  _oWindowManagerRef.removeWindow (idWindow);
 }
}

如果你能从这部分代码中看到

if (aNextdata != undefined && aNextdata.length > 0)

我得到三个链接一个在另一个之下,但我的问题是只有第一个链接在新页面打开,应该在同一页面打开所以我应该为此做什么请帮助我谢谢你。

1 个答案:

答案 0 :(得分:0)

很难从您的问题中说出来,但可能是getUrl调用导致您的链接在新窗口中打开。 getUrl的第二个可选参数指定链接应该打开的窗口。如果你替换

getURL (this.deepLinks.link, "_blank");

getURL (this.deepLinks.link);

您的链接应在同一窗口中打开。