Jump to content
Search Community

baldscone

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by baldscone

  1. Hi, I am developing a flash piece with two views of the same video (one large, one smaller with a caption overlay). Im just wondering if anyone has any ideas on how to program it so I can switch seamlessly between the two views and have the same video at the same time, playback state etc. Ive tried using two separate video streams and keeping track of currentTime etc but its a bit of a hack and doesn't work that well. Is there a cleaner way I can add the same video loader container to multiple display containers and just code the controls once? i.e. videoLoaderVars.container(this); videoLoaderVars.container(another clip);
  2. Thanks for your help again - its working beautifully now with just: loaderQueue = LoaderMax.parse(assetURLs, loaderVars, imageLoaderVars); for (var i:int = 0, index:int = loaderQueue.numChildren; i < index; i++) { var loader:* = loaderQueue.getChildAt(i); if(loader is ImageLoader){ ImageLoader(loader).name = ImageLoader(loader).url; } }
  3. Thanks for the prompt reply and explanation - I actually just found the same solution but wasn't quite sure why it worked by just naming the ImageLoader with the URL as you suggest: imageLoaderVars.name("idontexist.jpg"); I suppose I just figured that if it was an alternateURL it wouldn't matter if I called it with the bad URL and it would return something if there had been an alternate image supplied. Thanks for the help. Cheers P.S. Any idea how I can integrate this solution when using parse?
  4. Hi there, Thanks for your reply. Ive put together a simplified example to demonstrate the problem. Ive used Carls' simplified code from earlier in this post. Basically it narrows down the problem being that it all works fine if you use a container to load the image into ie. imageLoaderVars.container(this); but if you want to put this code in a non view class and then call LoaderMax.getContent("idontexist.jpg"); it throws a stream error. Im pretty sure its not because it can't find the alternateURL image as you suggest, unless Im mis-understanding how this function should work in LoaderMax? Ive attached the simple FlashBuilder project to demonstrate. Ive also tried calling the loader but still no luck. trace(LoaderMax.getLoader("idontexist.jpg"));//traces null AlternateURLTest.zip
  5. I still haven't managed to solve this and Ive tried everything I can think of. Ive triple checked the path and tried different image paths. Can you suggest anything else I can try? Ive included the full trace below and code again. Any help would be greatly appreciated. Im stumped! Ive implemented a workaround but I would prefer to use alternateURL for flexibility. public function load(assetURLs:Array):void { trace("AssetLoaderService.load(assetURLs) - " + assetURLs); var loaderVars:LoaderMaxVars = new LoaderMaxVars(); loaderVars.onComplete(onComplete); loaderVars.onError(onError); loaderVars.onIOError(onError); loaderVars.onFail(onError); loaderVars.onProgress(onProgress); //For images add missing icon var imageLoaderVars:ImageLoaderVars = new ImageLoaderVars(); imageLoaderVars.alternateURL("http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/256/Status-image-missing-icon.png"); imageLoaderVars.noCache(true);//appends cache (helps with multiple images - but only from a server) imageLoaderVars.smoothing(true); LoaderMax.activate([imageLoader, SWFLoader]);//Can also use VideoLoader and Mp3Loader loaderQueue = LoaderMax.parse(assetURLs, loaderVars, imageLoaderVars);//one of these URLS is "thumbnails/Idontexist.png" loaderQueue.load(); } /* AND LATER IN ANOTHER VIEW CLASS */ for each (var videoCollectionData:VideoCollectionData in event.playlistData.videoCollections) { trace(LoaderMax.getContent("thumbnails/Idontexist.png")); var thumbNail:ContentDisplay = LoaderMax.getContent(videoCollectionData.thumbnail); view.addPlaylistItem(videoCollectionData, thumbNail); } /*TRACE IS*/ AssetLoaderService.load(assetURLs) - background.jpg,logo.png,thumbnails/Idontexist.png,thumbnails/synthesis.png,thumbnails/key_commands.png LoadAssetsCommand.onError() - Error #2032: Stream Error. URL: file:///Volumes/BaldsconeHD/Dropbox/Dropbox/Current_Projects/Deepbase Jobs 2012/Multitech USB Cloud Key/development/bin-debug/thumbnails/Idontexist.png ---- Error on ImageLoader 'loader4' (thumbnails/Idontexist.png): Error #2032: Stream Error. URL: file:///Volumes/BaldsconeHD/Dropbox/Dropbox/Current_Projects/Deepbase Jobs 2012/Multitech USB Cloud Key/development/bin-debug/thumbnails/Idontexist.png ---- LoadAssetsCommand.onError() - ImageLoader 'loader4' (thumbnails/Idontexist.png) > Error #2032: Stream Error. URL: file:///Volumes/BaldsconeHD/Dropbox/Dropbox/Current_Projects/Deepbase Jobs 2012/Multitech USB Cloud Key/development/bin-debug/thumbnails/Idontexist.png
  6. Firstly it throws an error: Error on ImageLoader 'loader4' (thumbnails/quickstart_tips.png): Error #2032: Stream Error. URL: file:///Volumes/BaldsconeHD/Current Projects/USB/images/bin-debug/thumbnails/quickstart_tips.png and when I try: trace("LoaderMax.getContent: " +LoaderMax.getContent(videoCollectionData.thumbnail)); //returns LoaderMax.getContent: null No cross domain or security errors. Error 2032 is an IOError right? Stumped.
  7. Mmm - strange - I passed in a reference to the main view just to see what happens. The default (alternateURL) image is displayed, but when I call var thumbNail:ContentDisplay = LoaderMax.getContent("idontexist.jpg"); trace(thumbNail);//traces null It traces null? So it sort of works but not how I need it to. I would like to be able to get a default missing image for the thumbnail image if it is missing, but later on in the application's life cycle (i.e. not straight away into a view object) So back to scratching my head... My work around could be to save the ContentDisplay somewhere and use that later if thumbnail returns null.
  8. Hi Carl, Thanks for your post. I have this class as a service class (so no container/view class) which looks like what is my problem. Any idea if alternateURL will work with a separated MVC pattern? I was hoping I could later try LoaderMax.getContent(my url) and get back my default image...but not sure i can? Any ideas?
  9. So - just to be clear - I have tried this method also but no luck either: for each (var assetURL:String in assetURLs) { //What type of asset is it? var type:String = StringUtils.getFileExtension(assetURL); switch (type) { case "swf": loaderQueue.append(new SWFLoader(assetURL)); break; case "png": loaderQueue.append(new ImageLoader(assetURL,imageLoaderVars)); break; case "jpg": loaderQueue.append(new ImageLoader(assetURL,imageLoaderVars)); break; default: var errorEvent:AppEvent = new AppEvent(AppEvent.APP_ERROR); errorEvent.errorStr = "AssetLoaderService.load unknown file type: " + type; dispatch(errorEvent); break; } }
  10. Hi - Ive been trying to get alternateURL along with LoaderMax's parse method to work locally but I still get a stream error when I try to use alternateURL to provide an alternate image. I am referencing a local file in my build directory - does it only work online maybe? Ive also tried separating it out and building up the loaders by extension type but that still doesn't seem to work. I know some users have had problems in the past using audit size - Ive tried turning that off and on - no luck. I have also updated from my account with the latest SWC (v11) and this is the code I am using. //assetURLs is passed into this method with a mixture of .pngs, .jpgs and .swfs var loaderVars:LoaderMaxVars = new LoaderMaxVars(); loaderVars.onComplete(onComplete); loaderVars.onError(onError); loaderVars.onIOError(onError); loaderVars.onFail(onError); loaderVars.onProgress(onProgress); //loaderVars.auditSize(false);//Ive tried this but it doesn't make a difference //For images add missing icon var imageLoaderVars:ImageLoaderVars = new ImageLoaderVars(); imageLoaderVars.noCache(true); imageLoaderVars.smoothing(true); imageLoaderVars.alternateURL("missing/default.jpg"); LoaderMax.activate([imageLoader, SWFLoader]); loaderQueue = LoaderMax.parse(assetURLs, loaderVars, imageLoaderVars); loaderQueue.load();
  11. Hi just as an update. I re-coded this from scratch and now it's working much better. Still a bit of an occasional bottle neck stutter when scrolling but no y axis jitter. I am using bitmaps and transformMatrix in a sprite but then rotating the parent clip 2 degrees and it is way better. Any insights on combo of rotation and nested sub pixel rendering?
  12. Yeah - I tried the rotation tween in the transform matrix but then I run in to problems working out the vertical offset - i.e. the rotation is fixed and the graphic just scrolls right to left at an angle. Hard to explain so as you suggested Ive stripped out a lot of code and bundled it up into a fla example. You may need to embed a different font in the Library "TickerFont" to get it to work, Ive used VAG. As you will see in the timeline Ive set the rotation on the whole clip. I did notice that the animation is a bit choppy anyway if I leave it with no rotation - and if I take off filters etc which are on there. Anyway - any help would be great fully appreciated. For the record Im using the club build from 2011-10-06 of your awesome libraries - which of course Ive left out! ticker problem.zip
  13. Hi, I've been trying to find a solution to a problem I've been having with a dynamic scrolling ticker which has to be rotated by two degrees. I have tried using transformMatrix which I then discovered (after reading the API more thoroughly) shouldn't be combined with a normal tween or I assume rotation. I also tried scrollRect and using cached bitmaps but no love. I can get the image to rotate and look crisp using transformMatrix to apply the rotation but because it is also scrolling from left to right I then need to add in the vertical shift and as soon as I start scrolling it from left to right it jumps up and down and is jittery as it scrolls from left to right. For the record I am using TimelineMax with fromTo Tweens for each ticker item. I have pasted the code that i use for tweening all the message clips below but I think it's more of a "how can I achieve this in theory" type question at the moment! Do you have any suggestions as to how I can achieve this rotated ticker animation? { trace("start"); if(!messageSprites) return; //Tween all clips to offscreen location which is stored in them timeline = new TimelineMax({repeat:-1, yoyo:false, repeatDelay:0}); for(var i:int = 0; i var msg:TickerMessage = messageSprites[i]; //Normal scrolling //timeline.append( TweenMax.fromTo(msg, _scrollDuration, { x:msg.initX, ease:Linear.easeNone }, { x:msg.endX, delay:_messageDelay, ease:Linear.easeNone } ) ); //Updated to use transform matrix timeline.append( TweenMax.fromTo(msg, _scrollDuration, { transformMatrix:{x:msg.initX}, ease:Linear.easeNone }, { transformMatrix:{x:msg.endX}, delay:_messageDelay, ease:Linear.easeNone} ) ); } } timeline.play(); _hasStarted = true; }
  14. P.S. Richard - I do get this trace from my SWF debug when I load an flv from MyDeo: Warning: Ignoring 'secure' attribute in policy file from
  15. Thanks Richard for your help - very nice support! I will get my client who has an account with you to request to add the domains for the site on to your crossdomain file. I might also add my dev server so I know it all works. Greensock - brilliant work on the Loader stuff (and the rest of the Tweening APIs) - saving me heaps of time and I am happy to say I have been a club member for over a year now. Maybe we might see some papervision3D specific Tween stuff for Club members one day perhaps? Like a camera follow tween with easing or a 3D layout assistant for 3D objects? Maybe not Thanks, baldscone
  16. Hi - Im doing a project at the moment where I am trying to play a video from mydeo.net using VideoLoader. I am loading the video and setting the container of the loaded video to a movieclip instance which is then used to make a Papervision MovieMaterial. It worked fine locally with an flv but then when I hooked it up to use a mydeo flv it throws the following error: [Fault] exception, information=SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///Z|/Dropbox/Current%20Projects/MyCompany/development/bin/MyCompany.swf cannot access unknown URL. No policy files granted access. This also happens when I host it online. I have tried with and without checking Security files etc, The code I am using is: //Make up container for texture container_clip = new MovieClip(); Security.loadPolicyFile("http://ht.cdn.mydeo.net/o1/u1/m3/crossdomain.xml"); Security.allowDomain("http://ht.cdn.mydeo.net"); var videoLoadVars:VideoLoaderVars = new VideoLoaderVars(); videoLoadVars.onComplete(videoLoaded); videoLoadVars.container(frontVideoSpr.video_holder_mc); videoLoadVars.width(frontVideoSpr.video_holder_mc.width); videoLoadVars.height(frontVideoSpr.video_holder_mc.height); videoLoadVars.scaleMode("stretch"); videoLoadVars.bgColor(0x000000); videoLoadVars.autoPlay(false); videoLoadVars.volume(1); videoLoadVars.checkPolicyFile(true); videoLoadVars.autoAdjustBuffer(true); videoLoadVars.bufferTime(5); videoLoadVars.centerRegistration(false); videoLoadVars.onCancel(onLoadCancel); videoLoadVars.onError(onLoadError); videoLoadVars.onFail(onLoadError); videoLoadVars.onIOError(onLoadError); videoLoadVars.onSecurityError(onLoadError); videoLoadVars.autoDispose(false); videoLoader = new VideoLoader(_data.videoURL,videoLoadVars); videoLoader.load(); Then later on... container_clip.addChild(frontVideoSpr); var maskrect:Rectangle = new Rectangle(0, 0, container_clip.width * TEXTURE_QUALITY, container_clip.height * TEXTURE_QUALITY); //Set up MovieClip var frontMaterial:MovieMaterial = new MovieMaterial(container_clip, true, true, true, maskrect); frontMaterial.doubleSided = false; frontMaterial.interactive = true; frontMaterial.smooth = true;//BUG - could we set this later??? frontMaterial.precise = false; frontMaterial.movieTransparent = false;//cleans up text but at big performance hit! frontMaterial.tiled = true;//to clear up locks upat high angles etc... then I make a cube with this texture as the front material. This bug happens intermittently and I thought it may be the old progressive flash player bug but I noticed in the VideoLoader.as class that you have included a fix for that. Any ideas what I can try next??? Im not 100% sure whether the mydeo is progressive or streaming but Im pretty sure its streaming - maybe I should be using Papervisions VideoStreamMaterial? Or am I just using the VideoLoader wrongly? Any help would be great tracking this down. Cheers, baldscone
  17. Hi - thanks for the reply. I didn't set the estimatedBytes in the code but I did in my XML file - this is the correct syntax below right? I thought that it might be because of that - is there anyway I can stop the progress event dispatching until it knows how big it is? i.e. is there an event like LoaderEvent.AUDIT_COMPLETE which I can listen for and then start displaying the progress information? Ceiling 0,0,0 Ive added this too - is it right to define both in XML and code? var totalImageBytes:uint = 683391;//<--- UPDATE THESE FIGURES var xmlSettingsFileBytes:uint = 3235; var settingsBytes:uint = totalImageBytes + xmlSettingsFileBytes; var jobFeedBytes:uint = 1342; var contentBytes:uint = 5072; _loadQueue.append( new XMLLoader(Settings.SETTINGS_URL, { name:"settingsXML", prependURLs:_basePath, estimatedBytes:settingsBytes } ) ); _loadQueue.append( new XMLLoader(Settings.JOB_FEED_URL, { name:"jobfeedXML", prependURLs:_basePath, estimatedBytes:jobFeedBytes } ) ); _loadQueue.append( new XMLLoader(Settings.CONTENT_URL, { name:"contentXML", prependURLs:_basePath, estimatedBytes:contentBytes } ) );
  18. Hi - Im trying to load a few XML files and images plus the main SWF in a FlashDevelop project but I keep getting some strange behaviour where the progress reports this (please note this is running from harddrive but same behaviour occurs online) progress: 0.5724668064290706 progress: 0.2862334032145353 progress: 0.1908222688096902 progress: 0.1908222688096902 progress: 0.23852783601211275 progress: 0.25 progress: 0.49743709226467847 progress: 0.498564015053027 progress: 0.5011720627430418 progress: 0.525034226125457 progress: 0.5410815455644398 progress: 0.5649437089468549 progress: 0.8124299076850252 progress: 0.8149437089468549 progress: 0.829905623279591 progress: 0.8537677866620061 progress: 0.8742335532543948 progress: 0.8980957166368099 progress: 0.9219578800192249 progress: 0.9255115713432662 progress: 0.9493737347256812 progress: 0.9579881592170227 progress: 0.9818503225994378 progress: 1 LoaderMax 'mainQueue' is complete! I can only think that the initial 57% reading is the SWF file and then it somehow excludes that when loading the rest - really not sure - have tried disabling defaultAuditSize but doesnt help. Any ideas? Here is my code - its inside a class file so I pass through a reference to the main preloader displayObject to use SelfLoader: _loadQueue = new LoaderMax(config); _loadQueue.append( new SelfLoader(targetDispObj) ); //Include the root swf in the progress calculations (this) //Prepend path to content _loadQueue.prependURLs(_basePath, false); //we know the XML contains ImageLoader, so we need to activate those classes once in the swf so that the XMLLoader can recognize them. LoaderMax.activate([imageLoader]); //append two XML loaders necessary _loadQueue.append( new XMLLoader(Settings.SETTINGS_URL, { name:"settingsXML", prependURLs:_basePath } ) ); _loadQueue.append( new XMLLoader(Settings.JOB_FEED_URL, { name:"jobfeedXML", prependURLs:_basePath } ) ); _loadQueue.append( new XMLLoader(Settings.CONTENT_URL, { name:"contentXML", prependURLs:_basePath } ) ); //prioritize the XML settings load so we get images asap LoaderMax.prioritize("settings"); _loadQueue.load(); private function progressHandler(event:LoaderEvent):void { //Get percentage as 0-1.0 _percentLoaded = event.target.progress; }
×
×
  • Create New...