Jump to content
Search Community

failure13

Members
  • Posts

    183
  • Joined

  • Last visited

Everything posted by failure13

  1. Ah...It's too bad that there are no ways to stop this kind of lags Well anyway, thx! I think that dispose have problems, coz with my code i firstly need to define loader as a Loader object, at first for native it was like: var loaderVR:Loader = this["loaderVR" + v] as Loader; Now i have rewritten it ofr SWFLoader: var loaderVR:SWFLoader = this["loaderVR" + v] as SWFLoader; I don't got this error: But probably this is due to some differences between native Loader dispose() behaviour, and LoaderMax dispose() behaviour? Let me clear how i do it... You should find cleanUp function in 1st frame and completely replace it with this: Then for convinence you can create new frame, and give it a name mainMenu1, so that when you create .swf with new code, if you press mainMenu2 to load your LoaderMax code - you should be able to clean it by pressing mainMenu1. Sorry, probably it's very off for a simple example, but i can't really simplify it much! %) Please ignore filters / enterframe error, it's bad written sunray (if you load vr and turn left you'l see it) It have nothing to do with load / unload.
  2. Actually this is no tricky service, very reliable, and has no counters, just press Click here to start download from sendspace But since you asked... http://ge.tt/2H3sGGL/v/0?c For some reason i wasn't permited to attach file (probably coz i have just registered yesterday)
  3. I always got this exact kind of trouble with tweenMax, when i use delay...So i wanna know why, and how to prevent it. Here is simple example, it's easy to understand what is going on in there, and what i want to see... http://www.sendspace.com/file/qackjr Question is, why on just doing simple roll-overs roll-outs i can get locked result like this? http://s1.ipicture.ru/uploads/20120731/WAE3DsP6.png Surely i miss something!
  4. As i understood, with dispose() command, i won't need to do those: loaderVR.mouseChildren = false; Right? So in theory i should do all the cleanup processes, and then fire dispose, this should work: But it's not! Doesn't remove instance from stage + doesn't seem to uload anything according to my memory checker class... Sorry for putting this through you guys, it's really heavy stuff with this panorama...I can't hardly understand their logic myself... But at least, i see that even with LoaderMax menu button animation lags when you load pano (and this is just example, original is super heavy..) So i can't think nothing more than specifiy delay before load pano (so the animation would gone, and only then pano would load) Do you got something else in mind to offer about getting rid of such lags?
  5. haha, well, this exact error is not pano2vr realted, it's poorly written sunlight graphix So just ignore it... Thx, this code seem to work that way! Exactly, that's why they used enter frame in first place it seem... haha, well, about alpha i know ) It's just stupid mistake that i've done when simplifing code And now comes my most hardcore question... Inside 1st frame of my test file, please find a function called cleanUp! // cleanup of currently loaded elemnt function cleanUp(e:Event):void { // CLEAN VIRTUAL REALITY for (var v:int = 1; v <= 2; v++) { // create temp vars for vr and loaderVR instances var vr:MovieClip = this["vr" + v] as MovieClip; var loaderVR:Loader = this["loaderVR" + v] as Loader; // check if vr exist on stage if (vr != null && vr.pano != null && vr.stage) { // remove vr instance vr.pano.bmpTile[0].dispose(); vr.pano.bmpTile[0] = null; vr.pano.bmpTile[1].dispose(); vr.pano.bmpTile[1] = null; vr.pano.bmpTile[2].dispose(); vr.pano.bmpTile[2] = null; vr.pano.bmpTile[3].dispose(); vr.pano.bmpTile[3] = null; vr.pano.bmpTile[4].dispose(); vr.pano.bmpTile[4] = null; vr.pano.bmpTile[5].dispose(); vr.pano.bmpTile[5] = null; loaderVR.mouseChildren = false; vr.pano.cleanup(); loaderVR.unloadAndStop(); removeChild(loaderVR); vr.pano = null; trace ("vr" + v + " cleanup done"); // kill all sound SoundMixer.stopAll(); } } As you can see it is extremely hard to clean virtual reality, coz it have at least 6 heavy bitmaps (faces of cube), which need to be disposed and nullified...and only then i should unloadAndStop, and finally remove .swf, afterwords killing it's own sound %) Mess, ain't it? My question is of course - how should i unload such a crazy stuff with loaderMax, if i'll use code you've provided above to add it on stage? And the most interesting part i would like to know about loaderMax, is it's benefits of unloading content, compared to native flashes loader...I want to always clean all the loaded mess when it's not needed, memory is something i want to keep low with every project, but it's so hard sometimes...
  6. I extremely apologise for not reading manual in firstplace... I got a very very small time period to finish this, so totally got no time Thank you for an explanation about .content and .rawContent! They doesn't even trace at all! So somehow initPanorama3 ain't even ever executing with your code O_o That probably means, that vr3 or vr3.pano is still null at that point...But then why? Ahh...Well, i don't know even how to say. This pano2vr api where i create panoramas - is extremely tricky. It seem that it have to get some time to pass x / y / width / height , that's why they offer to use enterFrame on their site (which is huge and frustating waste of memory, even for a breath moment only) To be honest - right now i don't understand completely how it works. I have made super simple example for you, there are 2nd frame with your code, and 3rd with mine, to test and see difference - press main 3 to see how it should be placed (with my code), and press main 2 to see your example...But thing is, - once you remove enterFrame listener from my code - it's same result... Hell i'm stuck \ http://www.sendspace.com/file/qr3pec
  7. Well yeah, it's just a beginning for me... So i got problem with code you provided, it always placed at x = 0, y = 0, just as if you would remove enterFrame listener (which i of course would LOVE to remove, but once you remove it from original code - panorama places at x = 0, y = 0), it seem that's how it works. So right now i'm trying to adopt your rewritten code for enterFrame listening, and still get same results yet...hm P.S. what exactly .content and .rawContent means in this code?
  8. Sorry for really stupid question, but i'm new to LoaderMax, and i really don't understand how to do simple things... // create new loader for vr player var loaderVR3:Loader = new Loader(); // spceify URL of 1st vr .swf to start tour var vrURL3:String = "system/vr/1.2.swf"; // set vr request from vrURL var vrURLreq3:URLRequest = new URLRequest(vrURL3); // create container for vr var vr3:MovieClip; // start loading timeoutID = setTimeout(startIt3, loadDelay) function startIt3() { // call initPanorama every frame addEventListener(Event.ENTER_FRAME, initPanorama3); // Tell the loader to call 'initHandler' after the swf is initialized loaderVR3.contentLoaderInfo.addEventListener(Event.INIT, initHandler3); // load video content from vrURL string loaderVR3.load(vrURLreq3); } // function to cast 'DisplayObject' to 'MovieClip' function initHandler3(event:Event):void { vr3 = MovieClip(loaderVR3.content); // name and add vr to the stage loaderVR3.name = "loaderVR3" addChild(loaderVR3); // slowly change alpha of loader TweenMax.to(loaderVR3, 1.8,{alpha: 1, delay: 0.06, onStart: loaderVR3.alpha = 0}); } function initPanorama3(e:Event) { // check if the panorama object is available and initialize it if ((vr3 != null) && (vr3.pano != null)) { removeEventListener(Event.ENTER_FRAME, initPanorama3); vr3.x=260; vr3.y=50; onResize(null); } } How would i rewrite this code, for LoaderMax, to keep it as simple, or even more simple? Thx in advance!
×
×
  • Create New...