Jump to content
Search Community

funk247

Members
  • Posts

    10
  • Joined

  • Last visited

funk247's Achievements

0

Reputation

  1. Nah I am being a noob! docDesc[i] = loadedThumbs[i].vars.rawXML.docDesc.toString(); // docDesc being the node I want to read from in the XML file. Works perfectly. I didn't think it would be that simple.
  2. When I try to traverse the contents of docDesc like this it returns the full contents of the imageLoader node: docDesc[i] = loadedThumbs[i].vars.rawXML.toString(); But accessing any sub-node of rawXML just returns an empty set. The annoying thing is I can see the data I want to access! Excuse the massive pic. docDesc[i] = loadedThumbs[i].vars.rawXML.i.i.toString(); Would evaluate to docDesc[i] = loadedThumbs[i].vars.rawXML.0.0.toString(); So why are the contents returning as empty? Not even a null object reference, just as empty. Sorry if I'm being a noob.
  3. I'm loading an XML file that follows this format, s'all working perfectly. <?xml version="1.0" encoding="UTF-8"?> <data> <LoaderMax name="PEDThumbs" load="true"> <ImageLoader docTitle="Candidate Registration Form" url="data/images/pre/thumbs/Candidate Registration Form.png" file="data/files/pre/Candidate Registration Form.pdf"> <docDesc><![CDATA[<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec rhoncus nisi. Quisque nec augue eu dui vestibulum blandit. Proin viverra turpis suscipit, vestibulum velit consectetur, ullamcorper dolor. Donec ornare facilisis nulla non elementum. Phasellus mattis nunc nisl. Nam elementum fermentum commodo. Cras et metus faucibus, cursus odio vel, sodales ante. Donec non odio vitae urna sodales blandit quis ac magna. Vivamus viverra laoreet ligula, nec fermentum augue condimentum eu.</p> <p>In vel congue mauris. Maecenas consequat tempor eros a scelerisque. Nulla facilisi. Donec id nisi vel odio iaculis eleifend in in lorem. Aliquam lorem tortor, commodo a pretium quis, laoreet nec odio. Phasellus posuere bibendum dolor vitae elementum. Vestibulum quis bibendum eros. Nulla et lacinia est.</p> <p><a href="www.google.com">This is a hyperlink, it takes the user to external websites</a></p>]]></docDesc> </ImageLoader> <ImageLoader docTitle="Example ID Verification Procedure" url="data/images/pre/thumbs/Example ID Verification Procedure.png" file="data/files/pre/Example ID Verification Procedure.pdf"> <docDesc><![CDATA[<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec rhoncus nisi. Quisque nec augue eu dui vestibulum blandit. Proin viverra turpis suscipit, vestibulum velit consectetur, ullamcorper dolor. Donec ornare facilisis nulla non elementum. Phasellus mattis nunc nisl. Nam elementum fermentum commodo. Cras et metus faucibus, cursus odio vel, sodales ante. Donec non odio vitae urna sodales blandit quis ac magna. Vivamus viverra laoreet ligula, nec fermentum augue condimentum eu.</p> <p>In vel congue mauris. Maecenas consequat tempor eros a scelerisque. Nulla facilisi. Donec id nisi vel odio iaculis eleifend in in lorem. Aliquam lorem tortor, commodo a pretium quis, laoreet nec odio. Phasellus posuere bibendum dolor vitae elementum. Vestibulum quis bibendum eros. Nulla et lacinia est.</p> <p><a href="www.google.com">This is a hyperlink, it takes the user to external websites</a></p>]]></docDesc> </ImageLoader> </LoaderMax> <LoaderMax name="PEDImages" load="true"> <ImageLoader url="data/images/pre/Candidate Registration Form.png"> </ImageLoader> <ImageLoader url="data/images/pre/Example ID Verification Procedure.png"> </ImageLoader> </LoaderMax> </data> I'm trying to access the data held in docDesc in preperation for parsing it as HTML (hyperlinks are important), so I created an array called docDesc and attempt to fill it like so: docDesc[i] = loadedThumbs[i].vars.rawXML.i.i; and I instance it like this: currentTitle = event.target.name; // equates to a numeric index that can be used to pick items out of an array txt2.docIntro.text = String(docDesc[currentTitle]); When I trace the array it returns as ' , '. Checking the contents of vars.rawXML.i.i in the debugger shows that loaderMax has picked up the content, so why has it not cast it to the array? Is there a limitation on the number of characters I can place into the array or have I made some other error?
  4. It does throw out an error: Scene 1, Layer 'Layer 1', Frame 1, Line 56 1061: Call to a possibly undefined method fromTo through a reference with static type Class. But what you've shown me is fantastically helpful, the link between the small and large images is working and I'm sure I can put what you've set out to good use. Thanks so much for the assist!
  5. Sorry for not including the file, my 3 month old was screeching like a banshee whilst I was setting up the demo! Thanks for the code, I'll try it out now and let you know. Nice to find a component with such friendly, helpful forums.
  6. Sorry, server security, forgot about that, try again please
  7. Heres a quick demo file of my code so far, I can load the images in with no issues at all, but no matter what I do I can't seem to setup the link. Am supposed to be demo-ing on Monday - which is now looking unlikely - so any help would be GREATLY appreciated! Linky
  8. Hi thanks for offering to help, I've been stuck with this for 2 days now! I agree that I've not setup a link between the thumbs and large images, I tried implementing the code you sent over but it's failing on the line where we create the property bigImage Error #1056: Cannot create property bigImage on com.greensock.loading.display.ContentDisplay. I'll setup a quick example file and post it shortly.
  9. I edited my code to this and now the thumbnail tweens instead of the intended image - but at least it's not kicking out errors function callFull(event:MouseEvent):void { var clicked:ContentDisplay = ContentDisplay(event.target); // Targets object under mouse if (isUp == true) { // Do some stuff fadeOut.addEventListener(TweenEvent.MOTION_FINISH, end); function end(event:TweenEvent) { // Some more stuff // Animate large image in mcDocIn = new Tween (clicked, "y", Strong.easeOut, clicked.y, -650, 1, true); } } }
  10. I'm using LoaderMax to parse an XML file and load images and information for a document library, I've got the images being loaded in and added to movieclips but am having issues working with them now they are on stage. Basically I have an array of thumbnails and an array of Images, what I want to happen is when a thumbnail is clicked the full-size image tweens into place. I'm currently using the bog standard flash tweens rather than tweenlite, which might be the issue? Heres my import code. function completeHandler(event:LoaderEvent):void { // Set vars // var mcthumb:Array = new Array; // var mcImg:MovieClip = new MovieClip(); // Grab thumbnails var loadedThumbs = event.target.getChildren()[0].getChildren(); var noThumbs:uint = loadedThumbs.length; // Display Thumbs for (i = 0; i < noThumbs; i++){ loadedThumbs[i].content.name = i; loadedThumbs[i].content.x = 210*i; mc2.addChild(loadedThumbs[i].content); } // trace(loadedThumbs); // Grab images var loadedImg = event.target.getChildren()[1].getChildren(); var noImages:uint = loadedImg.length; // Display images for (j = 0; j < noImages; j++){ loadedImg[j].content.name = j; bigDocWrap.addChild(loadedImg[j].content); } } And this is a edited version of the code I'm using to handle the tweens function callFull(event:MouseEvent):void { var clicked:MovielClip = MovielClip(event.target); //This is the problem line if (isUp == true) { // Do some stuff fadeOut.addEventListener(TweenEvent.MOTION_FINISH, end); function end(event:TweenEvent) { // Some more stuff // Animate large image in mcDocIn = new Tween (clicked, "y", Strong.easeOut, clicked.y, -650, 1, true); } } } And here is the error message Type Coercion failed: cannot convert com.greensock.loading.display::ContentDisplay@39bc1241 to flash.display.MovieClip.at MethodInfo-312() I'm probably missing something elementary, do I need to convert my loaded content to a movieclip in order to be able to get it tweening.
×
×
  • Create New...