Jump to content
Search Community

alflasy

Members
  • Posts

    72
  • Joined

  • Last visited

Everything posted by alflasy

  1. Hi, Is there any better way to reload the swf which already displayed. So why I want to that? Let me explain, if the user is on slide 5 which is a child SWF with animation and I have a refresh button on parent Menu. So when the user clicks the refresh button I want to reload that same child SWF with new variables that user have set on its parent. Any idea? Thanks
  2. Alright, I have to add container:getParentMovie to get the image progress. Thanks
  3. ok the stage issue is been solved by adding addEventListener(Event.ADDED_TO_STAGE, loadModuleAssets); But two questions remains unanswered 1. Why stage get null only when I add requireWithRoot:this.root. Else works fine. 2. Still can't can't the progress of child SWF images to sibling. below are code code on sibling that telling SWF to load on parent function loadNewModuleAndSlide(ids) { getNewModuleXML = getModuleXmlUrl[ids]; if (LoaderMax.getContent("module")) { var getModuleAsDisplay:ContentDisplay = LoaderMax.getContent("module"); getModuleAsDisplay.dispose(true); var myChildLoaderName:String = getParentMovie.getModuleName; var newModuleLoader:SWFLoader; var newModuleSwf; newModuleLoader = new SWFLoader(myChildLoaderName,{ name:"module", maxConnections:1, requireWithRoot:this.root, estimatedBytes:5000, onComplete:newModuleLoaderComplete, onprogress:newModuleLoaderProgress, onChildProgress:newModuleChildProgress, onChildComplete:newModuleChildComplete }); newModuleLoader.load(); } Then code inside the SWF thats being loaded on parent var moduleXMLLoader:XMLLoader; LoaderMax.activate([ImageLoader,SWFLoader]); moduleXMLLoader = new XMLLoader("modules/xmls/"+ moduleXmlUrl, { alternateURL:"xmls/working.xml", name:"slides", maxConnections:1, estimatedBytes:5000, requireWithRoot:this.root, onComplete:moduleXMLLoaderComplete, onProgress:moduleXMLLoaderProgress, onChildProgress:imageLoadProgress, onChildComplete:imageLoadComplete }); XML.ignoreWhitespace = true; moduleXMLLoader.load(); Thanks
  4. its the stage which is tracing null. So, do I have to remove all the instances of stage from that child movie. What are my options? Thanks
  5. Got this but it gave me bunch of error as requireWithRoot:root.this messed up all my stage.stageWidth. Any Idea?
  6. Hi, This time I am trying to dispose a SWF and then reloading it again with new XML works fine with below code but onChildComplete is not called. function loadNewModuleAndSlide(ids) { getNewModuleXML = getModuleXmlUrl[ids];//Setting the name for new XML file which is picked up by the SWF when it reload. if (LoaderMax.getContent("module")) { var getModuleAsDisplay:ContentDisplay = LoaderMax.getContent("module"); getModuleAsDisplay.dispose(true); var myChildLoaderName:String = getParentMovie.getModuleName; var newModuleLoader:SWFLoader; var newModuleSwf; newModuleLoader = new SWFLoader(myChildLoaderName,{ name:"module", maxConnections:1, estimatedBytes:5000, onComplete:newModuleLoaderComplete, onprogress:newModuleLoaderProgress, onChildProgress:newModuleChildProgress, onChildComplete:newModuleChildComplete }); newModuleLoader.load(); } //; function newModuleLoaderProgress(event:LoaderEvent) { ExternalInterface.call("console.log", 'MENU____Module PROGESS'); } function newModuleLoaderComplete(event:LoaderEvent) { //trace(event.target.progress); ExternalInterface.call("console.log", 'MENU____Module COMPLETE'); newModuleSwf = event.target.content as ContentDisplay; getParentMovie.addChild(newModuleSwf); getParentMovie.setChildIndex(newModuleSwf, 0); } function newModuleChildProgress(event:LoaderEvent) { ExternalInterface.call("console.log", 'MENU____Module PROGESS'); } function newModuleChildComplete(event:LoaderEvent) { trace("SWF Complete Loading_____________"); ExternalInterface.call("console.log", 'MENU____CHILD COMPLETE'); event.target.rawContent.nextSlides(null); }
  7. Sorry for confusion. I tried diffrerent method that we discussed in other thread but didn't worked. Let me explain again. I have parent SWF and that is loading two swf child. Now I want to get the raw xml of one child to another. trace(LoaderMax.getLoader("module").rawContent);// [object movieclip] trace(LoaderMax.getLoader("module").rawXML);// undefined trace(LoaderMax.getContent("module").rawXML);// undefined trace(LoaderMax.getLoader("module"),vars.rawXML);// undefined So the above code get me the sibling SWF but when I try to get the xml of sibling it failed. May be I can set xml in variable in one child and then get it. Not sure but will try. Thanks
  8. First of all thanks again for all your help. Down the path of accessing siblings I have two new roadblocks and I am sure LoaderMax can easily handle that. All the above example shows to trace the sibling SWFs but now I want to get XML from sibling SWFs Like how can I get controller xml from module.swf. and then I also want to switch the indexes of of siblings. I am guessing that can be simple setChildIndex() from parent.
  9. Trying to set the y position with variables. It works without tweenlite but not while using tweenlite. below is the code for (var mb=0; mb<setAllMenuBtnNumArray.length; mb++) { var getAllMenus = setAllMenuBtnNumArray[mb]; if (mb > 0) { var getAllMenusPos = Math.round(setAllMenuBtnNumArray[mb - 1].y + setAllMenuBtnNumArray[mb - 1].height); //TweenLite.to(getAllMenus, .5, {y:getAllMenusPos,ease:Circ.easeOut}); // THE ABOVE LINE NOT WORKING BUT BLOW WORKS getAllMenus.y = getAllMenusPos; } Thanks
  10. Thanks again Carl, But still don't understand that how the onprogress and Oncomplete event will be triggered when the user click to open that SWF. We already have two seperate onComplete Event. One for LoaderMax onComplete and other for ImageLoader onChildComplete then the SWF is the GrandChild of LoaderMax. How to get the onprogress and onComplete event for GrandChild
  11. So, here I am back with another task which I can do it with URLLoader but want to if LoaderMax can handle it. I have series of imageLoader in LoaderMax and some ImageLoader may have related swf that can be loaded on demand. I thinking of XML like below. <LoaderMax load=true> <ImageLoader prependURL='media/'></ImageLoader> <ImageLoader> <SWFLoader load=false url='mySWF.swf'></SWFLoader> </ImageLoader> <ImageLoader></ImageLoader> <ImageLoader></ImageLoader> </LoaderMax> Is that possibel?
  12. Thanks Carls for all your quick responses.
  13. Alright, so Carl you are right. calling load true both on LoaderMax node and Imageloader node makes ImageLoader runs two times but whats I notice that when I remove the load true from ImageLoader Node then ImageLoader Load Images in alternate sequences like the image 2 loades first then them Image 1, Image 4 load then Image 3 and so on. Now when I remove load true from LoaderMax and keep the load true on images loader then it worked fine. Not sure why its doing it. Either way the problem of prependURLs worked. Question - So, if the LoaderMax node have no load true then still its going to load the images? Thanks for all your help.
  14. Thanks Carl for wonderful response. Yes, I am calling load true on both loaderMax load and imageLoader Node like this <LoaderMaxs name='moduleSlides' load="true" prependURLs="modules/" > <ImageLoader name="img_1" url="images/img_0.jpg" estimatedBytes="60000" load="true" x="0" y="0" > <newTxtBox txtX="auto" txtY='auto' txtWidth='700' txtHeight='auto' txtAlign='center' textBorder='no'><![CDATA[my text]]> </newTxtBox> </ImageLoader> </LoaderMaxs > And Answer to your Quoted question is below <LoaderMaxs name='moduleSlides' load="true" prependURLs="modules/" > <ImageLoader.... <ImageLoader.... </LoaderMaxs > Prepend works with above xml but doesn't work with below xml <data name='moduleSlides' load="true" prependURLs="modules/" > <dataNode.... <dataNode.... </data>
  15. That's my bad. I should have tried the basic s first. Thank Carl.
  16. So, this didn't ended here. Now what if I want to get the attributes value in description node. All my below attemped failed event.target.vars.rawXML.description.vars.txtX event.target.vars.rawXML.description.txtX event.target.vars.rawXML.description.rawXML.vars.txtX Thank you
  17. Alright, here another one. But first thanks to Carl for all your help. My Slide show was working great till I tried to prepend url in xml file. As soon as I tried below code it prepend the URL but it runs the onChildComplete handler two times so all the images and its related text were loaded two times. Like 5 image movie turn in 10 image movie. Also notice that the prependURLs only works when the xml node is LoaderMax it doesn't work if its DATA of something else. <LoaderMax name='moduleSlides' load="true" prependURLs="images/" > <imageLoader....> <imageLoader....> <imageLoader....> </LoaderMax> Thanks
  18. Thanks Carl it really helped.
  19. Hi, I am not sure if this question is specific to loaderMax but I am sure loaderMax will have better way to handle it so posting it here. I have loaded two external swf. like this <config> <swfloader name="module" url="module/module.swf" estimatedBytes="66000" load="true" x="0" y="0" /> <swfloader name="control" url="skin/controller.swf" estimatedBytes="78000" load="true" x="0" y="0" /> </config> Now the swf are loaded in parent and I want to dispatch event from controller to module SWF. I tried different ways but can't efficiently target the swfs on its parent as it doesn't have any instance name. something like trace(controllerTimeline.parent.module) or trace(controllerTimeline.parent.getLoader('module')) or trace(controllerTimeline.parent.loaderMax.getContent('module')) or trace(controllerTimeline.parent.configLoader.getContent('module')) All those throw error. Thanks
  20. Thanks Carl, I'll try that and will let you know.
  21. Hi, I am looking for something like having more than one image in single image node. Like I want two images on each slide. something like adding another attribute in imageLoader Node url2='images/image_1a.jpg' <ImageLoader name="img_1" url="images/img_1.jpg" url2='images/image_1a.jpg' estimatedBytes="94000" load="true" /> <ImageLoader name="img_1" url="images/img_2.jpg" url2='images/image_2a.jpg' estimatedBytes="94000" load="true" /> <ImageLoader name="img_1" url="images/img_3.jpg" url2='images/image_3a.jpg' estimatedBytes="94000" load="true" /> Thanks
  22. Thank you Carl/Zync, I have to little modify your code as I was trying to get the description in child complete listener. function imageLoadComplete(event:LoaderEvent):void { trace(event.target.vars.rawXML.description) }
  23. Thanks, but it gives error. Here my scenario XML <slides> <ImageLoader name="img_0" url="images/img_0.jpg" estimatedBytes="60000" load="true" x="0" y="0" ><![CDATA[<b>Image 1</b> Description 1]]></ImageLoader> <ImageLoader name="img_1" url="images/img_1.jpg" estimatedBytes="94000" load="true" x="320" y="0"><![CDATA[<b>Image 2</b> Description 2]]></ImageLoader> <ImageLoader name="img_2" url="images/img_2.jpg" estimatedBytes="94000" load="true" x="0" y="200"><![CDATA[<b>Image 3</b> Description 3]]></ImageLoader> <ImageLoader name="img_3" url="images/img_3.jpg" estimatedBytes="60000" load="true" x="320" y="200" ><![CDATA[<b>Image 4</b> Description 4]]></ImageLoader> </slides> and i am tracing it in onChildComplete. I get to the name by event.target.name BUt can get to cdata
  24. How to access CDATA in loaderMax. Something like function completeHandler(event:LoaderEvent):void { trace("load complete. XML content: "+loader.content.children().children(); } I am not trying to load and images or swf just xml data that I want to display in rows and columns with some html attributes like color change and bold text. Thanks
×
×
  • Create New...