Jump to content
Search Community

henrye4

Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • Location
    Milan

henrye4's Achievements

0

Reputation

  1. WOW, thank you!! This code version works very fine. My knowledge of LoaderMax is not so good to think a solution like this: name:"clip"+i, number:number. Now I understand why rawContent macthed only the last value. Very very good. Solved. Thank you again
  2. Thank you for reply, obiouvsly I prefer to use dynamic values, and for my app it's mandatory to load, before each clip, an swf containing a progressive number. If I put the "numbered.swf" before or after the loop, it's loaded only one time, not every time before each clip contained in "clip array". Imagine to load a certain number of animations (in my case are more than 2.000), and you want to show a progressive number, starting from 1, for each session. I cannot reopen 2.000 animations and insert a "numberclip.text" field. It's better to load, before each animation, another swf (numbered.swf) which contains the "numberclip.text" field. With rawContent I can access to numberclip.text variable and dynamically populate the progressive number, ever starting from 1. With static values (but producing 2.000 different swfs with static numbers (e.g. numbered01.swf, numbered02.swf, numbered03.swf, etc)the loop works fine. The problem is the rawContent access. It matches only the last numbered.swf. Before there is an 1010 error. I'm sorry if my descripton was not very clear for you. Please, test my source to understand my huge problem. Thanx
  3. In my example, I have 3 clips and the loop generates error only on first and second cycle, and correctly insert my number in the last item. The clip array is dynamically populated, so I don't know in advance how many items need to be numbered. If I add the numbered.swf outside the loop, it loads only after all clips, at the end of my queue. I don't love to use the workaround to produce a lot of fixed-numbered swfs and load them with a code like this, because the number may vary from 1 to n. queue.append( new SWFLoader("swf1/"+numbered[i], {name:"numbered", container:this, x:0, y:ynext}) ); Thanks again!
  4. I need to load the numbered.swf as separate item, containing a dynamic number, because clip.length may vary. Numbered.swf in only a blank swf containing the field, so is very little. Your solution is valid if clips.swf include the numberclip.text field. My dubt is that rawContent doesn't match che correct data if the entire queue is not loaded. Is it right?
  5. Hi, I want assign a number to a clip list by a text field called "numberclip" contained in a external swf. I call the onLoadSWF function in a "for" cycle to assign an incremental number, but I obtain an Error #1009 and rawContent assigns only the last number. I don't understand why. This is my simplified code: var number = 0; var ynext = 0; var clip = new Array("clip01.swf", "clip02.swf", "clip03.swf"); var queue:LoaderMax = new LoaderMax({name:"list"}); for (var i = 0; i < clip.length; i++) { queue.append( new SWFLoader("swf1/numbered.swf", {name:"numbered", container:this, x:200, y:ynext, visible:true, autoPlay:true, onComplete:onLoadSWF}) ); number = number +1; ynext = ynext +40; queue.append( new SWFLoader("swf1/"+clip[i], {name:"clips", container:this, x:0, y:ynext}) ); } queue.load(); queue.pause(); queue.resume(); function onLoadSWF(event:LoaderEvent):void { var A:MovieClip = LoaderMax.getLoader("numbered").rawContent; A.numberclip.text = number; } Can you help me about my error?
  6. That's right if every loader loads a single swf, but if you load an array, it's another issue. For example: queue.append( new SWFLoader("swf/d"+questionlist[i]+".swf", {name:"list1"}) ); you can activate an Mouse Event like greensock suggested: var question:ContentDisplay = LoaderMax.getContent("list1"); question.addEventListener(MouseEvent.CLICK, clickHandler); but if you want reload the clicked swf in a new SWFloader, what is the correct function?
  7. I appreciate your quickly answer, but the example is applicable only if you load a single swf (I think). I load an array like this: queue.append( new SWFLoader("swf/d"+questionlist[i]+".swf", {name:"question", estimatedBytes:126000, container:m, x:0, y:ynext, visible:true, autoPlay:false, requirewithroot:this.root}) ); ynext = ynext + h + 10; queue.append( new SWFLoader("row1.swf", {name:"row1", estimatedBytes:1000, container:m, x:0, y:ynext, visible:true, autoPlay:false, requirewithroot:this.root}) ); ynext = ynext + 10; queue.append( new SWFLoader("swf/r"+questionlist[i]+".swf", {name:"answer", estimatedBytes:126000, container:m, x:0, y:ynext, visible:true, autoPlay:false, requirewithroot:this.root}) ); ynext = ynext + hr + 10; queue.append( new SWFLoader("swf/row2.swf", {name:"row-final", estimatedBytes:126000, container:m, x:0, y:ynext, visible:true, autoPlay:false, requirewithroot:this.root}) ); The "h" and "hr" are attributes on my XML to set the question and answer's heights. The variable "ynext" is initially set to zero, and I add sequentially a question, a separation row, the answer, and a final row that separates one question to another. I want activate a MouseEvent only on the "question" loader. Sorry for my poor English.
  8. Hi, I'm using LoaderMax to dinamically load a lot of swfs for an educational project. The swfs are questions for the creation of school test. I would be able to clic on a single swf and activate a switch with another or delete it, so the teacher can choose the appropriate question and create a personalized test for each student. Can I activate a MouseEvent for loaded items by the queue?
×
×
  • Create New...