UILoader and TileList not loading

Reply

Join Date: Aug 2007
Posts: 238
Reputation: ceyesuma is an unknown quantity at this point 
Solved Threads: 0
ceyesuma ceyesuma is offline Offline
Posting Whiz in Training

UILoader and TileList not loading

 
0
  #1
Nov 16th, 2008
Would someone have time to look at some classes and an XML to try to tell me why nothing is loading?

I have:

A simple interface with two combo boxes (that do load) and they are linked to two separate classes. One cb class should load an UILoader class and the other cb class initiates a TileList (linked) class. each of the 4 classes are linked to there components.
additionally I have two seperate classes to handle the XML and the URLRequest?
Thanks
Steve
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 238
Reputation: ceyesuma is an unknown quantity at this point 
Solved Threads: 0
ceyesuma ceyesuma is offline Offline
Posting Whiz in Training

uiloader and Tilelist loading but not displaying

 
0
  #2
Nov 16th, 2008
my uiloader
partial code
Graphics and Multimedia Syntax (Toggle Plain Text)
  1. sourceValue=theXML.key[key].swfFile;
  2. trace("///// ui key "+sourceValue+" //////////////////");
  3. uiImage.source=sourceValue;

If my url is correct and it is in sourcValue which it is. Shouldn't uiImage.source=sourcValue display the file?


likewise

tilelist partial code
Graphics and Multimedia Syntax (Toggle Plain Text)
  1. var imageImage:String=theXML.key[tImage].swfFile;
  2. trace("////////////////// "+imageImage+" //////////////////");
  3. arrayImage.push({source:imageImage});
  4.  
  5. }
  6. dp=new DataProvider(arrayImage);
  7. tlImage.dataProvider=dp;


all the correct URL are in the arrayImage[] and the only thing I have left is frame one(action) in the .fla which is:



the tilelist


Graphics and Multimedia Syntax (Toggle Plain Text)
  1. var cbMajorComponent:CBMajorComponent=new CBMajorComponent();
  2.  
  3. cbMajorComponent.cbMajor.setSize(200, 22);
  4. cbMajorComponent.cbMajor.prompt = "Select a Major Key";
  5. cbMajorComponent.cbMajor.editable=false;
  6. cbMajorComponent.cbMajor.rowCount=15;
  7. cbMajorComponent.cbMajor.width=110;
  8. cbMajorComponent.cbMajor.move(0,0);
  9. cbMajorComponent.cbMajor.x=10;
  10. cbMajorComponent.cbMajor.y=20;
  11.  
  12. this.addChild(cbMajorComponent.cbMajor);
  13.  
  14.  
  15.  
  16. var cbMinorComponent:CBMinorComponent=new CBMinorComponent();
  17.  
  18. cbMinorComponent.cbMinor.setSize(200, 22);
  19. cbMinorComponent.cbMinor.prompt = "Select a Minor Key";
  20. cbMinorComponent.cbMinor.editable=false;
  21. cbMinorComponent.cbMinor.rowCount=15;
  22. cbMinorComponent.cbMinor.width=110;
  23. cbMinorComponent.cbMinor.move(0,0);
  24. cbMinorComponent.cbMinor.x=10;
  25. cbMinorComponent.cbMinor.y=50;
  26.  
  27. this.addChild(cbMinorComponent.cbMinor);
  28.  
  29.  
  30.  
  31.  
  32. var uiImageComponent:UIImageComponent=new UIImageComponent();
  33.  
  34. uiImageComponent.uiImage.setSize(50,50);
  35. uiImageComponent.uiImage.x=135;
  36. uiImageComponent.uiImage.y=13;
  37. //uiImageComponent.uiImage.width=110;
  38. //uiImageComponent.uiImage.height=50;
  39.  
  40. this.addChild(uiImageComponent.uiImage);
  41.  
  42.  
  43. var tlImageComponent:TLImageComponent=new TLImageComponent();
  44.  
  45. tlImageComponent.tlImage.move(135,185);
  46. tlImageComponent.tlImage.width=375;
  47. tlImageComponent.tlImage.height=120;
  48. tlImageComponent.tlImage.columnWidth=160;
  49. tlImageComponent.tlImage.rowHeight=185;
  50.  
  51. this.addChild(tlImageComponent.tlImage);
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 238
Reputation: ceyesuma is an unknown quantity at this point 
Solved Threads: 0
ceyesuma ceyesuma is offline Offline
Posting Whiz in Training

UIloader not dispalying

 
0
  #3
Nov 18th, 2008
I am having a problem with dispalying the UILoader on the mcContainer I have on my main

timeline;

I wrote a class (below) that loads fine
meaning:
Graphics and Multimedia Syntax (Toggle Plain Text)
  1. sourceValue=theXML.key[key].swfFile;
this code when traced outputs all the correct URL's from the XML.



Graphics and Multimedia Syntax (Toggle Plain Text)
  1. package chromatic.load_files{
  2. import fl.containers.UILoader;
  3. import flash.display.MovieClip;
  4. import flash.events.Event;
  5. import fl.data.DataProvider;
  6. import flash.net.URLLoader;
  7. import flash.net.URLRequest;
  8. import flash.net.*;
  9.  
  10. public class UIImageComponent extends MovieClip {
  11.  
  12. public var uiImage:UILoader=new UILoader();
  13. public var dp:DataProvider=new DataProvider();
  14. private var dataLoader:URLLoader=new URLLoader();
  15. private var theXML:XML=new XML();
  16. private var listURL:URLRequest=new URLRequest();
  17.  
  18. private var arrayImage:Array=new Array();
  19.  
  20. private var singleImage:String;
  21. private var key:String;
  22. private var fileName:String;
  23. private var sourceValue:String=null;
  24. private var evtIndex:int;
  25. private var evtName:String;
  26. private var sel:Number=-1;
  27. private var xmlList:XMLList;
  28.  
  29. public function UIImageComponent():void {
  30.  
  31.  
  32. }
  33. public function init(fileName,key):void {
  34. this.fileName=fileName;
  35. this.key=key;
  36. setfileName(fileName);
  37. setKey(key);
  38. setupComponent(fileName,key);
  39. }
  40. private function setupComponent(fileName,key):void {
  41. this.fileName=fileName;
  42. this.key=key;
  43. uiImage=new UILoader();
  44. uiImage.setSize(50,50);
  45. uiImage.x=135;
  46. uiImage.y=13;
  47. //uiImage.width=110;
  48. //uiImage.height=50;
  49. theXML=new XML(fileName);
  50. theXML.ignoreWhitespace=true;
  51. listURL=new URLRequest(theXML);
  52. dataLoader=new URLLoader(listURL);
  53. try {
  54. dataLoader.load(listURL);
  55. } catch (error:Error) {
  56. trace("Unable to load requested document");
  57. }
  58.  
  59. dataLoader.addEventListener(Event.COMPLETE,dataLoaded);
  60. //uiImage.addEventListener(Event.CHANGE, selectedName);
  61. //uiImage.addEventListener(Event.CHANGE,changeEvent);
  62. //uiImage.addEventListener(Event.COMPLETE,doTrace);
  63. //uiImage.addEventListener(Event.RESIZE,doTrace);
  64. }
  65. private function dataLoaded(evt:Event):void {
  66. theXML=XML(dataLoader.data);
  67. //trace("////////////////// UI "+theXML);
  68. key=getKey();
  69.  
  70. sourceValue=theXML.key[key].swfFile;
  71. trace("///// ui key "+sourceValue+" //////////////////");
  72. uiImage.source=sourceValue;
  73. }
  74. /*
  75. private function selectedName():void {
  76. /*Combobox evt.target.setupComponent cannot have spaces (as we have).So
  77.  
  78. until
  79. * I learn how to rid a string of spaces thus the var key
  80. */
  81.  
  82.  
  83. /*this bloct to be replaced by an hotspot event
  84. uiImageComponent=new UIImageComponent
  85.  
  86. key=concatArray[evtIndex];
  87. uiImageComponent.setfileName(this.fileName);
  88. uiImageComponent.setkey(this.key);
  89. uiImageComponent();
  90.  
  91. }
  92. private function doTrace(evt:Event):void {
  93. trace(uiImage.width);
  94. uiImage.scaleContent=true;
  95. uiImage.maintainAspectRatio=false;
  96. }
  97. */
  98. private function changeEvent(evt:Event):void {
  99. trace(" You selected a key");
  100. }
  101. public function setfileName(fileName):void {
  102.  
  103. this.fileName=fileName;
  104.  
  105. }
  106. public function getfileName():String {
  107. return fileName;
  108. }
  109. public function setKey(key):void {
  110.  
  111. this.key=key;
  112.  
  113. }
  114. public function getKey():String {
  115. return key;
  116. }
  117. }
  118. }


Now when I go to the actions layer keyframe of the timeline I have:

Graphics and Multimedia Syntax (Toggle Plain Text)
  1. /*
  2. import chromatic.load_files.Main;
  3. var main:Main=new Main();
  4. main;
  5. */
  6.  
  7. var cbMajorComponent:CBMajorComponent=new CBMajorComponent();
  8. var cbMinorComponent:CBMinorComponent=new CBMinorComponent();
  9. var uiImageComponent:UIImageComponent=new UIImageComponent();
  10. var tlImageComponent:TLImageComponent=new TLImageComponent();
  11.  
  12.  
  13. stage.addChild(cbMajorComponent.cbMajor);
  14. stage.addChild(cbMinorComponent.cbMinor);
  15. mcContainer.addChild(uiImageComponent.uiImage);
  16. mcContainer.addChild(tlImageComponent.tlImage);


Here the combobox's function fine yet they have listeners and selectedItem() traces

the above mentioned URLS but nothing appears in the mcContainer.

Could someone help me to learn how to an image to dispay here?


Thanks
ceyesuma
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 238
Reputation: ceyesuma is an unknown quantity at this point 
Solved Threads: 0
ceyesuma ceyesuma is offline Offline
Posting Whiz in Training

uiloader

 
0
  #4
Nov 19th, 2008
Can I get some help dispaying a loaded uiloader?
Thanks
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Graphics and Multimedia Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC