• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

Actionscript Code - Splitting a string

I need help with the following code.

Here is what I am trying to do. There is a variable called Arr_movieDetailHolder[myCounter][3] which is a xml node.

An example would be

intertisehelp.swf or weather.exe as far as what the node contains

If based on the split command, it is a swf, play the movie, if it is exe, execute the fscommand.

This looks right, but doesnt seem to work, can you help please ?

Appreciated.

var stringts = Arr_movieDetailHolder[myCounter][3].split(".");
if (stringts[1] = "exe")
{
fscommand("exec",Arr_movieDetailHolder[myCounter][3]);
}
else
{
loadMovie(Arr_movieDetailHolder[myCounter][3], "movietarget");
}
0
intertise
Asked:
intertise
  • 3
  • 2
1 Solution
 
negatyveCommented:
var stringts = Arr_movieDetailHolder[myCounter][3].split(".");
if (stringts[1] == "exe")
{
fscommand("exec",Arr_movieDetailHolder[myCounter][3]);
}
else
{
loadMovie(Arr_movieDetailHolder[myCounter][3], "movietarget");
}

but if it is a text node:

var stringts = Arr_movieDetailHolder[myCounter][3].split(".");
if (stringts[1].firstChild.nodeValue == "exe")
{
fscommand("exec",Arr_movieDetailHolder[myCounter][3]);
}
else
{
loadMovie(Arr_movieDetailHolder[myCounter][3], "movietarget");
}
0
 
intertiseAuthor Commented:
 <clip name="AllPetdentistA_VVN_G_A_20.swf" id="37364">
      <description></description>
      <timestamp></timestamp>
      <customer></customer>
      <file>weather.exe</file>
  </clip>


 that's an example of a node.

would your above code still work ?
0
 
intertiseAuthor Commented:
it worked, much obliged.
0
 
negatyveCommented:
You mean that "stringts" is that node?
0
 
negatyveCommented:
oh, ok, it was the file node. bye! :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now