Jump to content
Search Community

Mr Pablo

Members
  • Posts

    132
  • Joined

  • Last visited

Everything posted by Mr Pablo

  1. something I've just encountered... I am able to play one vidoe asset, then another. But when the second video ends and the function to play the first video again kicks in, the original video appears, but it's paused at the end of the video. How do I make sure the videos are "reset"? Should I use removeChild() on the VIDEO_COMPLETE? If I do use removeChild(), will the video get added again to the stage properly? Thanks!
  2. Cheers, I'll look into it! It's not a big issue, I could still tack the variables onto the end of the URL, as the XML Loader file is likely to be generated via an API, so it isn't out of the question, would have just made it neater if I could have simply used the XML style variables Thanks once again for all your help! Oh, is there a simple way to remove a loader from the stage? I noticed that if i clicked my button, the assets got laid over the top of each other, as it is simply saying "addChild(asset)" and more importantly, using LoaderMax like this, going round in circles with the assets, I shouldn't encounter a memory leak?
  3. Content is loading fine now As for the URL Variables, what I was trying to ask is, can I used the additional XML node info, e.g. <links><link1/></links2> as the URL Variable? Or do I have to use them as I do now, and as you just explained, with the parameter added to the url? Ideally, I'd like to use the XML data to pass them along. Does that make sense?
  4. That's fantastic! Didn't spot the dynamicLoader in the docs, oops! As for these loader variables, I understand calling them inside the current project, with theSWFLoader.vars.foo But how would I call them inside the SWF being loaded? Do they act the same as URLVariables? Can I use var foo = loaderInfo.parameters['foo']; Thanks EDIT - I tried using currentAsset = dynamicLoaderMax.getChildAt(0); and it didn't work. "dynamicLoaderMax" is the name of the LoaderMax in the XML, but the XMLLoader is called xmlDoc, does that matter? I was able to get something with var currentAsset = LoaderMax.getContent("dynamicLoaderMax"); but even whilst being able to grab the assets with an index number, the functions like playVideo() are not working e.g. currentAsset[2].playVideo(); should play the VideoLoader at node 3 (o starting index), but it doesnt. Video loads, but doesnt play.
  5. Once again, thank you for your input! The image, swf and video loader stuff kind of makes sense, with detecting the start and end of the asset. I started to set up the XMLLoader and was wondering, how do I grab each Loader, in order, automatically from the XML file? My XML looks like this: <data> <LoaderMax name="dynamicLoaderMax" load="true"> <VideoLoader name="video1" url="video1.mp4" autoPlay="false" height="720" width="1280" /> <ImageLoader name="crab" url="crab.png" /> <SWFLoader name="module" url="module.swf" autoPlay="false" /> <VideoLoader name="video2" url="video2.mp4" autoPlay="false" height="720" width="1280" /> </LoaderMax> </data> And I am able to grab a single Loader using: var currentAsset = LoaderMax.getLoader("video2"); But in order to have them all play one after another, I need to be able to reference the Loaders by an index or such, but the only thing I can find in the API docs is to grab the Loaders by name or URL - hardly dynamic! Another quick question - am I able to use URL Variables with a SWF Loader? I need to be able to pass along various bits of data to the child SWF (which house a snippet of code to grab the LoaderInfo.Parameters) Cheers
  6. This is excellent, thank you! I am looking to have the clips play autonomously, where can I add an onComplete event for the child Loaders? Do I add it to the LoaderMax object, and that knows to add it to each child and listen for the event? How easy would it be to convert this to read from the XmlLoader? (the XMLLoader is my best option, as the content is going to be picked by a user via a website) Cheers once again! EDIT - hmm, tried adding a onChildComplete event listener, and it kind of works, but it plays the clips in order of them finishing loading. I want the first asset to show, play and then fire an event on complete to activate the next asset loader. Also, is there a way to show the image for X number of seconds?
  7. I am having some trouble with LoaderMax when trying to create a "slideshow" of various asset types. I am using parse() to load an array of SWFs and mp4 files. Now, I can add everything to an array and I can seem to play the first SWF using content.rawContent.play(); but then I'm totaly stuck on how to play the next file which is an mp4 video. I'm not even sure if I should add the loader content to an array? In the end, I want to be able to loop through a handful of files saved locally without causing a memory leak. I can do this without LoaderMax, but the assets stay in memory and eventually all the RAM is eaten up. The website makes LoaderMax seem the best solution, but I simply do not know how to implement what I want it to do. I have searched and no one has tried loading different asset types in a loop, so I am stuck. Below is my current code, but I'm stuck on how to advance and make the files play one after another, ideally from an array or the loader itself (does the loader store the file data?) so as to not load the file afresh each time. function loadAssets(playListXml):void { LoaderMax.activate([ImageLoader, SWFLoader, VideoLoader]); var urls:Array = new Array(); for each(var i in playlistXml.playlist.file_path) { var file:File = File.userDirectory.resolvePath("test/"+i); var filePath = file.nativePath; urls.push("file://"+filePath); } queue = LoaderMax.parse(urls, {maxConnections: 2, onError: _onErrorHandler, onComplete: _onCompleteHandler, onChildComplete: _onChildCompleteHandler, onProgress: _progressHandler}, {autoPlay: false, container: container, width: 1280, height: 720, scaleMode: "stretch", y: 0, x: 0}); queue.load(); } function _onErrorHandler(e:LoaderEvent):void { trace(e.text); } function _progressHandler(e:LoaderEvent):void { trace(e.target.progress); } function _onChildCompleteHandler(e:LoaderEvent):void { trace(e.target + " loaded"); e.target.content.visible = false; } function _onCompleteHandler(e:LoaderEvent):void { trace("all swfs loaded"); } Hope you can help! EDIT: Would it be best to use a LoaderMax XML file to achieve this? I am interacting with an API on a server to get the playlist order, so I could easily get a XML file that LoaderMAx can read (listing the proper loaders etc) Will LoaderMax be able to play the files in sequence and order if i feed it the XML?
×
×
  • Create New...