Skip navigation
Currently Being Moderated

Using a function to change Netstream video size.

Jul 24, 2012 9:04 PM

Hi folks,


forgive me I am new to script in Flex.  I got an Application that has two scripted functions.  The first is called at creationComplete and sets up a netconnect/netstream video playback.  And a second that is fired when a button is clicked, which sets the application to Full Screen.  What I want to do is resize the video at the same time.  For testing purpose I am using hard coded values that match my monitor size.


The problem I am having is that the code I wrote to change the video size spits out an error "1120: Access of undefined property vid."  - Is it possible to have one function access the vairibles of another function?


My code:


            private function initApp():void
                var nc:NetConnection = new NetConnection(); 
                var ns:NetStream = new NetStream(nc); 
                ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);  
                ns.addEventListener(DRMAuthenticateEvent.DRM_AUTHENTICATE, DRMAuthHandler);
                function asyncErrorHandler(event:AsyncErrorEvent):void 
                    // ignore error 
                var vid:Video = new Video(); 
                function DRMAuthHandler(event:DRMAuthenticateEvent):void
            public function goFull():void
                stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;


I want the function goFull to change the video size that is loaded from the initApp function.... possible?





More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points