HI Im trying to make my as3 start on a specific frame but for some reason I just cant find a solutio


the below , trying make start on specific frame, can me please?

 

package

{

import fl.controls.button;

import flash.display.bitmap;

import flash.display.loader;

import flash.display.movieclip;

import flash.net.filefilter;

import flash.net.filereference;

import flash.text.textfield;

import flash.text.textfieldtype;

import flash.events.mouseevent;

import flash.events.event;

public class bitmaploader extends movieclip

{

  private static const _max_width: number = 640;

  private static const _max_height:number = 410;

  private var _fileref:filereference;

  private var _filefilter: filefilter;

  private var _loader: loader;

  private var _bitmap:movieclip;

  private var _browsebtn:button;

  private var _statictxt:textfield;

  private var _browsetxt:textfield;

  public function bitmaploader( )

  {

   _init( );

  }

  private function _init( ):void

  {

   _statictxt = new textfield ( );

   _statictxt.type = textfieldtype.dynamic;

   _statictxt.x = 10;

   _statictxt.y = 10;

   _statictxt.height = 21;

   _statictxt.text = "select video:";

   addchild( _statictxt );

   _browsetxt = new textfield ( ) ;

   _browsetxt.type = textfieldtype.input;

   _browsetxt.x = _statictxt.x + _statictxt.width + 4;

   _browsetxt.y = 10;

   _browsetxt.height = 21;

   _browsetxt.width = 200;

   _browsetxt.border = true;

   _browsetxt.background = true;

   addchild( _browsetxt );

   _browsebtn = new button ( ) ;

   _browsebtn.label = "browse";

   _browsebtn.name = "browse";

   _browsebtn.x = _browsetxt.x + _browsetxt.width + 4;

   _browsebtn.y = 10;

   _browsebtn.usehandcursor = true;

   _browsebtn.addeventlistener(mouseevent.click, _handlemouseevent);

   addchild( _browsebtn );

   _filefilter = new filefilter("clips","*.swf;*.flv;*.f4v;*.mov;*.mp4");

  }

  private function _handlemouseevent( evt : mouseevent ):void

  {

   switch ( string ( evt.target.name ))

   {

    case "browse" :

     _fileref = new filereference ( ) ;

     _fileref.browse( [_filefilter]);

     _fileref.addeventlistener( event.select, _onimageselect);

     trace( "browse" );

     break;

   }

  }

  private function _onimageselect( evt : event ):void

  {

   _fileref.load( );

   _fileref.addeventlistener(event.complete, _ondataloaded);

   _browsetxt.text = string(evt.target.name);

  }

  private function _ondataloaded(evt:event ):void

  {

   var tempfileref:filereference = filereference(evt.target);

   _loader = new loader( ) ;

   _loader.contentloaderinfo.addeventlistener( event.complete, _onimageloaded );

   _loader.loadbytes( tempfileref.data );

  }

  private function _onimageloaded(evt:event ):void

  {

   _bitmap = movieclip(evt.target.content);

   _bitmap.smoothing = true;

   _bitmap.x = 5;

   _bitmap.y = _browsetxt.y + _browsetxt.height + 5;

   addchild( _bitmap );

   if (_bitmap.width > _max_width || _bitmap.height > _max_height)

   {

    _resizebitmap( _bitmap );

   }

  }

  private function _resizebitmap( target : movieclip ):void

  {

   if (target.height > target.width)

   {

    target.width = _max_width;

    target.scaley = target.scalex;

   }

   else if (target.width >= target.height )

   {

    target.height = _max_height;

    target.scalex = target.scaley;

   }

  }

}

}

i'm confused. looks you're placing through actionscript, seem don't have timeline involved. if have timeline involved that's not reflected in code, have tried gotoandplay(someframe)? don't see in code.



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Some mp4 files not displaying correctly (CS6)

Thread: Samba is not authenticating with LDAP