Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

XML and AS2.0

Guest
Jul 24, 2007 Jul 24, 2007
OK I have been going down one road for this and have taken a few wrong turns.

A few things about what we are looking at:
I am using Flash CS3 but I am using Action Script 1.0/2.0 for compatability purposes.

What I have been able to do so far is create random instances of a movie clip to appear over a set amount of time but I need to go a bit further. The web application needs to be updated regularly and the best way I can think of doing that is with keeping all the variables in an XML. The problem is I am not sure how to format the XML properly to get Flash to read it and load the variables.

I am creating an online version of a vision screening tool we use. The test is graphically simple just a collection of a few primitives on a dark background. There are basically two objects a fixation point and a stimulus. What I need to be able to do is this.

Display either movieclip at (x,y) for (z)ms where x,y,& z are all variables loaded from an xml. I have asked questions along this line before but this is a different scope in case anyone wants to claim I double posted, this is quite different than they way I was doing it before.

Any help with the XML or even any actionscript suggestions would be greatly appreciated.

Thanks
TOPICS
ActionScript
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 26, 2007 Jul 26, 2007
Ok I see your point, I commented out the other trace statements and only left the following two trace statements

trace ('Data loaded: '+success);
and
trace (_root[oValue]);

and the output file now looks like this:

Data loaded: true
_level0.stimuli
_level0.stimuli
_level0.stimuli
_level0.stimuli
_level0.fixation

so it looks like it is grabbing the right variable from the XML
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 26, 2007 Jul 26, 2007
LATEST
Okay, that looks good. So, in this case _root and _level0 are the same
thing (this isn't always the case but here it is).

So, the only two things I can see, as per my previous post, are:

1. Your enterFrame loop is hard-setting the position. Whatever you set
it to outside of this, this loop simply resets it next time the frame
loop hits. So...comment it out or get rid of it.

2. Your X and Y values may not be numbers. You should try something like:

_root[ovalue]=Number(xValue);
_root[ovalue]=Number(yValue);

If they are numbers, no problem. If they're not, this should convert it.
Like I said, this is a 2-inch view of the whole canvas so this is the
best I can do without seeing everything you've written.

Good luck!

Patrick

shurleynova wrote:
> Ok I see your point, I commented out the other trace statements and only left
> the following two trace statements
>
> trace ('Data loaded: '+success);
> and
> trace (_root[oValue]);
>
> and the output file now looks like this:
>
> Data loaded: true
> _level0.stimuli
> _level0.stimuli
> _level0.stimuli
> _level0.stimuli
> _level0.fixation
>
> so it looks like it is grabbing the right variable from the XML
>

--
http://www.baynewmedia.com
Faster, easier, better...ActionScript development taken to new heights.
Download the BNMAPI today. You'll wonder how you ever did without it!
Available for ActionScript 2.0/3.0.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines