Load XML nextChild dynamicaly in flash

Posted on 2009-05-26
Medium Priority
Last Modified: 2012-05-07
hi guys,

I have a small flash that has to load XML data and transform it to a slide by slide presentation.
I cannot call the next firstChild dynamically, i don't know how.
I have attached the flash and xml

What I'm doing wrong?
Question by:sealview
  • 3
  • 2
LVL 39

Expert Comment

ID: 24480480
Hi, what you're doing seems correct.
you'll access each next slide as you have

var imageImage = myImage[_root.s].childNodes[0].childNodes[0].nodeValue;

where myImage[0] will be the first slide
myImage[1] will be the second etc.

so - i don't know where or how you're incrementing your s value - but if you're using a next/back button and incrementing that value with each slide it should be fine.

Author Comment

ID: 24480775
I, probably, wasn't coherent, I need to make the slides go auto each after the other, but in the same time if a user interact and needs to go to a specific Node to interrupt the automation and proceed to the user Node call.
I was thinking of something like declaring _root.s default value to 0 goes to the first note, and after first slide reach the 10 seconds of exposure, this first slide call the nest slide by incrementing the default value of _root.s plus 1 value, this making the value of the next slide/Node in the XML.
 My issue is that I don't know where to declare the NEXT value of "s", counting the fact that each slide load in a _mc that has the equivalent of 10 seconds frames, I tried to put it at the end of the slide_mc : onEnterFrame { _root.s = _root.s +1;}, but it didn't loads the value.

Thank you very much!
LVL 39

Accepted Solution

blue-genie earned 150 total points
ID: 24483696
you'll need something to handle the "auto slide" - so when the slide changes your s value will change accordingly.
alternatively if the user interacts - they'll click the next or previous button so you'll either increment by 1 for next or subtract 1 for previous.

so then based on that value you pass it to your xml.

Author Comment

ID: 24483814
Thank you very much!
I have asked the AS to duplicate the slide container in a single _mc so each slide reside by the previous one and I have used the move.prototype to automate the sliding by passing a new _x coordinate to the _mc for each next slide. And the user interaction will use the move.prototype too, only that will have just a button for each slide to go to it coordinate, no Next/Prev buttons.
The result can be seen in action here http://alphamd.ro/x/cl/ 

Thank you again blue-genie!
LVL 39

Expert Comment

ID: 24490408
so you're sorted. if so pls close the question.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

619 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question