yes. this is an example of a private class. but as someone earlier mentioned, you shouldn't ever _need_ to use them. and it would be more appropriate not to use them in production code. using the internal namespace gives you some restriction, and you could even use your own namespace for restriction but that's quite uncommon as well.
for reference.. - you cannot add a namespace to this 'private' class and should result in a compile error if you do. (ex. public class CustomClient) therefore, it must always be defined as 'class ClassName' with no namespace. - any classes that you need within this 'private' class must be imported outside the package package com { // code } import flash.display.Sprite class MySprite { // code } - and if some outside object gets a reference to it, you should be able to access public functions and properties so long as you do not try to cast the object as anything other than Object. in my experience, i have yet to feel the need for a pseudo 'private' class. the internal namespace serves me well most and in a few occasions a custom namespace was required. good luck :) On Sun, May 26, 2013 at 6:58 AM, Karl DeSaulniers <k...@designdrumm.com>wrote: > Ok, I am understanding things a little better I believe. Quick question to > solidify some knowledge. In reference to my question about a private class, > is the class CustomClient at the bottom an example of a private class? It > was mentioned that even if you don't have the word private there and don't > put public, flash automatically will interpret it as a private class. It is > inside the class file but outside the package for the main class (which was > also mentioned), it does not have public on it so you can't call it outside > this file. This is what a private class is, correct? > > package { > import flash.display.Sprite; > import flash.events.NetStatusEvent; > import flash.events.SecurityErrorEvent; > import flash.media.Video; > import flash.net.NetConnection; > import flash.net.NetStream; > import flash.events.Event; > > public class NetConnectionExample extends Sprite { > private var videoURL:String = " > http://www.helpexamples.com/flash/video/cuepoints.flv"; > private var connection:NetConnection; > private var stream:NetStream; > private var video:Video = new Video(); > > public function NetConnectionExample() { > connection = new NetConnection(); > connection.addEventListener(NetStatusEvent.NET_STATUS, > netStatusHandler); > connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, > securityErrorHandler); > connection.connect(null); > } > > private function netStatusHandler(event:NetStatusEvent):void { > switch (event.info.code) { > case "NetConnection.Connect.Success": > connectStream(); > break; > case "NetStream.Play.StreamNotFound": > trace("Stream not found: " + videoURL); > break; > } > } > > private function > securityErrorHandler(event:SecurityErrorEvent):void { > trace("securityErrorHandler: " + event); > } > > private function connectStream():void { > addChild(video); > var stream:NetStream = new NetStream(connection); > stream.addEventListener(NetStatusEvent.NET_STATUS, > netStatusHandler); > stream.client = new CustomClient(); > video.attachNetStream(stream); > stream.play(videoURL); > } > } > } > > class CustomClient { > public function onMetaData(info:Object):void { > trace("metadata: duration=" + info.duration + " width=" + > info.width + " height=" + info.height + " framerate=" + info.framerate); > } > public function onCuePoint(info:Object):void { > trace("cuepoint: time=" + info.time + " name=" + info.name + " > type=" + info.type); > } > } > > Best, > > Karl DeSaulniers > Design Drumm > http://designdrumm.com > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- Ktu; The information contained in this message may or may not be privileged and/or confidential. If you are NOT the intended recipient, congratulations, you got mail! _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders