locked
function help RRS feed

  • Question

  • I have this function. 

    function
    showQuestion(sender, args)

    {

    var n = sender.Name.toString();

     

    var nArray = n.split("_");

     

    //document.write(nArray[0] + " " + nArray[1] + " " + nArray[2]);

     

    var nOne = nArray[1];

     

    var nTwo = nArray[2];

     

    nTwo++;

     

    var qShow = "q_" + nOne.toString() + "_" + nTwo.toString();

     

    //document.write(qShow);

     

    sender.findName(
    "ShowQuestionX")["Storyboard.TargetName"]=qShow.toString();

     

    sender.findName(
    "ShowQuestionY")["Storyboard.TargetName"]=qShow.toString();

     

    //document.write(sender.findName("ShowQuestion")["Storyboard.TargetName"].toString());

     

    sender.findName(
    "ShowQuestion").begin();

     

    //sender.findName("ShowQuestion").begin();

    }

    qShow ends up being a valid Canvas object and I have used the same kind of code elsewhere to dynamically change the targetname for a storyboard. Here is the storyboard Code.

    <Storyboard x:Name="ShowQuestion">

    <DoubleAnimation x:Name="ShowQuestionX" Storyboard.TargetProperty="ScaleX" To="1.0" Duration="00:00:01"/>

    <DoubleAnimation x:Name="ShowQuestionY" Storyboard.TargetProperty="ScaleY" To="1.0" Duration="00:00:01"/>

    </Storyboard>

    I keep getting the error on the .begin() line of the function and I dont know why.

     

     

     

    Wednesday, January 16, 2008 7:00 PM

Answers

  • NEVER MIND

    Me silly

    I forgot I need to use the scale transform as the targetname.

     

    Off topic. I am having a blast learning this. SOOO much easier than Flash. Hope I'm not annoying the crap out of you other forum goers.

    Wednesday, January 16, 2008 7:25 PM