Jump to content
Search Community

sprog

Members
  • Posts

    13
  • Joined

  • Last visited

sprog's Achievements

0

Reputation

  1. Thanks! I will see if it makes a difference. At the moment I am creating new instance of DataLoader every ten seconds for four files to load in the contents and check it against the cache data to determine whether the contents of the file has changed. Maybe I can make a dictionary with filename=DataLoader instance and reuse the same DataLoader.
  2. Aah, obviously I didn't thought about that! Thanks. If I need to load the same SWF multiple times per day what's the best way to unload/dispose such SWFLoader? The same question for the DataLoader (for loading text) which needs to be loaded every 10 seconds to check if the contents of files have changed. Off topic: But are you aware of any garbage collection issues between 10.0 and 10.2 (standalone player)?
  3. First of all thanks for your reply. I am still experiencing this problem. Maybe you can see what I am doing wrong with my little example project? The zip file contains three projects: greensock_loader (loads the movies), the other two: failing_movie and failing_version2 are two simple projects which have a button 'force error' which just throws a runtime error. throw new Error('Unexpected error, oh no!'); If I click on the "load movie" button it loads the appropriate movie and if I then click on this "force error" button the error gets raised but without dispatching the LoaderEvent.UNCAUGHT_ERROR event. Because it doesn't dispatch the event I can't suppress the error dialogue. I am not sure what I am doing wrong I am targeting 10.2 using Flex SDK 4.5.1. All three projects are made with Flash Builder 4.5.1.
  4. Hmm, looks one bit of it ain't working as expected. For example I have the below code with the fluent interface where I am using onUncaughtError. Only this seems to be ignored. _movieLoader = new SWFLoader( 'greensock_failing_movie.swf', new SWFLoaderVars().autoDispose(true).width(1280).height(768).integrateProgress(false).name('module') .suppressUncaughtErrors(false) .autoPlay(false) .container(_moduleContainer) .onError(onMovieLoadError) .onComplete(onMovieLoadCompleted) .onUncaughtError(onMovieUncaughtErrors) ); Looks like the onUncaughtError is getting ignore in the SWFLoaderVars-class because when I add actual event listener via the normal way it all works fine: _movieLoader.addEventListener('uncaughtError', onMovieUncaughtErrors );
  5. Wow, this more then I asked. Really appreciated all the work you did! I will definitely try it out! Really cool. I just thought you could just give me show tips how to listen to the event Lucky me
  6. I am currently working on a project where I need to load SWF movies created by third parties. Now some third parties have the problem that they sometimes throw runtime errors which is not great. Now I would like to listen to the new 10.1 event called uncaughtErrorEvents . Only how can I listen to this evening when using the SWFLoader? I am currently using the following code: _movieLoader = new SWFLoader( contentURL, new SWFLoaderVars() .autoPlay(false) .onComplete(onContentLoaded) .onError(onContentError) .integrateProgress(false) .width(1280) .height(768) ); Based on this article http://labs.almerblank.com/2010/09/catc ... s3-errors/ I should be able to catch these runtimes of this external content to avoid that the error dialogue gets shown in the debug player or that it stops running in the release player.
  7. Aha, thanks. I didn't spotted that. Sorry. I will keep the code like this for now.
  8. Today, I started replacing the Loader class with the ImageLoader because of the nice scaling functionality. Only I am experienced an issue where ignores the loader variables. I used the following approach: Creating the ImageLoader class on demand when needed protected function get loader(): ImageLoader { if ( _loader == null ) { _loader = new ImageLoader( null ); } return _loader; } Now I am later the following in a method where I am loading the actual image using the following code: // load the image asset if ( _loader == null ) { loader.addEventListener( LoaderEvent.COMPLETE, onAssetLoaded ); loader.addEventListener( LoaderEvent.FAIL, onAssetError ); } loader.vars = {name:"assetImage", width:this.width, height: this.height, smoothing: true, scaleMode:ScaleMode.PROPORTIONAL_INSIDE}; loader.url = assetId; loader.load(); I am experiencing the issue that the vars-property I set just before I start loading the image is ignored. If I check the ContentDisplay-component and for a for ( var p in loader.vars ) statement in update()-method and some other method which calls the update()-method. The vars-empty is just empty. The _fitWidth and _fitHeight are not being set because the width/height properties don't exist. Now I change the code of the first block to the code below and removed the line where I set the property loader.vars it all works as expected. _loader = new ImageLoader( null, {name:"assetImage", width:this.width, height: this.height, smoothing: true, scaleMode:ScaleMode.PROPORTIONAL_INSIDE} ); I am just doing something wrong or I am hitting a bug?
  9. Aah, looks like it was caused by creating the document class twice. Once when the SWF itself got loaded and later in my createApplication-method. I have changed the code to: protected function createApplication(): void { // go to the next frame, just to be sure gotoAndStop(2); stage.addChild( DisplayObject( _contentLoader.rawContent ) ); if ( _contentLoader.rawContent is IPreloadable ) { _contentLoader.rawContent.onApplicationPreloaded( this ); } } After that I am not getting the error anymore. Oh well, it works.
  10. Yes, I really strange. If you check the two preloader and content swf with ASV they both are marked AS3-based SWFs. I will see if I can reproduce it. I understood that by default the content swf gets loaded in it's own new ApplicationDomain so shared classes can't be of issue here. After the application appears to work fine, though. I will keep hunting.
  11. I am getting the following error: In my preloader when I am loading my main content swf with LoaderMax. I am not understand what could cause this problem. All the assets get generated with mxmlc of Flex 3.5a. Only sound files get embedded via swc generated by Flash CS4. But this is also publishing to AS3. My code is the following after the content swf has been loaded: SWFLoader code _contentLoader = new SWFLoader( "game.swf", {name:"mainSWF", container:this, x:0, y:0} ); preloader = new CommonGamePreloader( this, _contentLoader ); preloader.completionDelay = 1; // time to show the preloader after movie fully loaded preloader.waitingFrames = 2; // time to display the branding Code after the file has been fully loaded or LoaderEvent.COMPLETE has dispatched and the out animation has finished // go to the next frame, the FrameFactory metadata adds the preloader-class to Frame 1 and document class to Frame 2 gotoAndStop(2); var appEntryClass: Class = _contentLoader.getClass("Application"); if ( appEntryClass ) { var app: Object = new appEntryClass(); stage.addChild( DisplayObject(app) ) if ( preloader ) { preloader.dispose(); preloader = null; } if ( app is IPreloadable ) { app.onApplicationPreloaded( this ); } }
  12. I am using this to create the textfield: private function createTextField(): TextField { var result: TextField = new TextField(); result.autoSize = TextFieldAutoSize.LEFT; result.selectable = false; result.border = false; result.antiAliasType = AntiAliasType.ADVANCED; result.gridFitType = GridFitType.SUBPIXEL; // result.embedFonts = true; result.wordWrap = false; result.multiline = true; return result; }
  13. I am trying to make a text effect for a count down animation only the problem I am having at the moment is that the text is shaking during the scale-tween. The objective is too have one of those common text effects where the text grows bigger and smaller again and then with a delay two shadow (with a lower alpha) start and disappear out of the screen because of the bigger scale value. Only the scaling tween keeps shaking a bit. How can I solve this? Basically I have the following code for the animation after I generated the text field: // initialize if ( _timeline == null ) { _timeline = new TimelineLite({onComplete:animationFinished, paused:true}); _timeline.prependMultiple([ new TweenLite( _mainTextField, 0.4, {transformAroundCenter:{scaleX:2.1, scaleY:2.1}, ease:Linear.easeNone} ), new TweenLite( _mainTextField, 1.0, {transformAroundCenter:{scaleX:2, scaleY:2}, delay: 0.4, ease:Linear.easeNone} ), new TweenLite( _shadowTextField1, 0.4, {transformAroundCenter:{scaleX:2.75, scaleY:2.75, alpha:0}, delay: 0.4, ease:Linear.easeNone} ), new TweenLite( _shadowTextField2, 0.4, {transformAroundCenter:{scaleX:3.3, scaleY:3.3, alpha:0}, delay: 0.5, ease:Linear.easeNone} ), new TweenLite( _mainTextField, 0.2, {transformAroundCenter:{scaleX:0, scaleY:0, alpha:0}, delay:2.4, ease:Linear.easeNone} ), ]); } _timeline.play(); I think it's some really stupid issue but I can't see it anymore after a week of 15 hour work days.
×
×
  • Create New...