Problem converting array string back to numeric

Ask a Question related to Macromedia Flash, Design and Development.

  1. #1

    Default Re: Problem converting array string back to numeric

    I'm afraid I don't know enough about your situation to help. How are you
    sending your values to ASP? It sounds to me like this is more like an ASP
    thing than Flash. Give me some more information on how you're sending data
    to ASP and how you're using it there.

    --
    Shane Elliott
    [url]www.timberfish.com[/url]


    "Chris Watt" <eyeworks@ozemail.com.au> wrote in message
    news:C5wTa.169$0h6.12151@nnrp1.ozemail.com.au...
    > I am loading a series of picture dimensions from an XML file into an
    array.
    > I then want to place the appropriate image dimension in an .asp header. As
    > the array stores the number as a string I need to convert back to a
    numeric.
    > Using the Number function works fine in "Test Movie" and even on personal
    > web server but testing proper over the internet the function returns
    nothing
    > and I get a zero sized img tag!
    >
    > What am I doing wrong?
    > TIA
    > Chris.
    >
    >

    S. Elliott \(timberfish.com\) Guest

  2. Similar Questions and Discussions

    1. string becomes numeric?
      Hi, I am trying to dump a query out into an excel. I found that a varchar datatype column will be converted to numeric in the Excel. For...
    2. Problem back converting files from CS
      We have an issue with CS not being able to save files in earlier Ill formats, specifically version 5.5. CS does not appear offer anything between v3...
    3. Byte array to string and back - newbie question
      Hi, I am trying to implement DES algorithm as described in the Microsoft article at...
    4. Converting a Byte Value to its Numeric Value
      How do I do that? This is for some bit-diddling, but the logical functions like AND require numeric expressions, per the book. AS
    5. php array problem string to integer
      I have something like the following : $text = "<HIDDEN>0</HIDDEN><HIDDEN>1</HIDDEN>"; //Suppose that the array $hidden contains a list of...
  3. #2

    Default Re: Problem converting array string back to numeric

    I have the following script for a button to enlarge a thumbnail picture on
    view in the flash movie to open up a new pop up window:

    on (release) {
    //customize the window that gets opened
    // get full size image dimensions stored in array
    var a = Number(_global.hpxValue[_global.index]);
    var b = Number(_global.vpxValue[_global.index]);
    // width of new window
    var w = a + 50;
    // height of new window
    var h = b + 90;
    // values for img tag of new window
    var picW = a;
    var picH = b;
    // location of image for img tag
    var link = _global.imageLinks[_global.index];
    // text for picture caption and alt text
    var desc = _global.imageDescription[_global.index];
    //convert array index to picture number for new window title
    var index = _global.index +1;
    //build asp header
    var target = "gallery.asp?link=" +link+ "&hpx=" +picW+ "&vpx=" +picH+
    "&desc=" +desc+ "&ind=" +index;
    //create new window
    getURL ("javascript:NewWindow=window.open('"+target+"','p opWin','width=" +
    w + ",height=" + h + ",left= '+((screen.width/2)-(" + w/2 + "))+',top=
    '+((screen.height/2)-(" + h/2 +
    "))+',toolbar=No,location=No,scrollbars=No,status= No,resizable=No,fullscreen
    =No'); NewWindow.focus();void(0);");
    }

    The gallery.asp grabs the information using the QueryString object:
    <%
    Dim imageTarget, hor, ver, caption, index
    imageTarget = Request.QueryString("link")
    hor = Request.QueryString("hpx")
    ver = Request.QueryString("vpx")
    description = Request.QueryString("desc")
    index = Request.QueryString("ind")
    %>

    Viewing the new window source the information for image alt text and image
    file location are supplied correctly but ( as I can also see as the new
    window briefly displays the full asp header) that the hpx and vpx values are
    "".

    What do you reckon?
    Chris.

    "S. Elliott (timberfish.com)" <myemail@isprivate.com> wrote in message
    news:S6FTa.180$2U.25579775@newssvr21.news.prodigy. com...
    > I'm afraid I don't know enough about your situation to help. How are you
    > sending your values to ASP? It sounds to me like this is more like an ASP
    > thing than Flash. Give me some more information on how you're sending
    data
    > to ASP and how you're using it there.
    >
    > --
    > Shane Elliott
    > [url]www.timberfish.com[/url]
    >
    >
    > "Chris Watt" <eyeworks@ozemail.com.au> wrote in message
    > news:C5wTa.169$0h6.12151@nnrp1.ozemail.com.au...
    > > I am loading a series of picture dimensions from an XML file into an
    > array.
    > > I then want to place the appropriate image dimension in an .asp header.
    As
    > > the array stores the number as a string I need to convert back to a
    > numeric.
    > > Using the Number function works fine in "Test Movie" and even on
    personal
    > > web server but testing proper over the internet the function returns
    > nothing
    > > and I get a zero sized img tag!
    > >
    > > What am I doing wrong?
    > > TIA
    > > Chris.
    > >
    > >
    >
    >

    Chris Watt Guest

  4. #3

    Default Re: Problem converting array string back to numeric

    Do a test to see that the Flash data is correct. So you can trace the value
    of target to make sure that it's what it should be (including all of the
    values like hpx and vpx). At least then you'll know whether the problem is
    in your Flash code or your ASP page evaluating what it receives. Everything
    you have looks okay, but without knowing what your global values actually
    are evaluating to, I can't say for sure what could be wrong.

    Also, try enabling the address bar in the pop-up window so you can see the
    query values that are actually being passed. This will help you identify
    the problem too. Or at least where the breakdown occurs. Also, in your
    getURL there's no need to return a window name, so instead of this...

    javascript:NewWindow=window.open(

    You'd have...

    javascript:window.open(

    That may be causing problems. I think you're trying to do too much in the
    getURL. I would just call a JS function you have defined on the HTML page
    that accepts a bunch of parameters and you can setFocus in that function.
    I've never tried to do it the way you are and am not sure if it will even
    work. Building your own function and calling it is better practice and will
    help you identify the problem. You could then call that function from HTML
    and see if it works without Flash involved. If it does not, then you know
    Flash isn't at fault.

    --
    Shane Elliott
    [url]www.timberfish.com[/url]


    "Chris Watt" <eyeworks@ozemail.com.au> wrote in message
    news:CcGTa.19$Rd7.1330@nnrp1.ozemail.com.au...
    > I have the following script for a button to enlarge a thumbnail picture on
    > view in the flash movie to open up a new pop up window:
    >
    > on (release) {
    > //customize the window that gets opened
    > // get full size image dimensions stored in array
    > var a = Number(_global.hpxValue[_global.index]);
    > var b = Number(_global.vpxValue[_global.index]);
    > // width of new window
    > var w = a + 50;
    > // height of new window
    > var h = b + 90;
    > // values for img tag of new window
    > var picW = a;
    > var picH = b;
    > // location of image for img tag
    > var link = _global.imageLinks[_global.index];
    > // text for picture caption and alt text
    > var desc = _global.imageDescription[_global.index];
    > //convert array index to picture number for new window title
    > var index = _global.index +1;
    > //build asp header
    > var target = "gallery.asp?link=" +link+ "&hpx=" +picW+ "&vpx=" +picH+
    > "&desc=" +desc+ "&ind=" +index;
    > //create new window
    > getURL ("javascript:NewWindow=window.open('"+target+"','p opWin','width="
    +
    > w + ",height=" + h + ",left= '+((screen.width/2)-(" + w/2 + "))+',top=
    > '+((screen.height/2)-(" + h/2 +
    >
    "))+',toolbar=No,location=No,scrollbars=No,status= No,resizable=No,fullscreen
    > =No'); NewWindow.focus();void(0);");
    > }
    >
    > The gallery.asp grabs the information using the QueryString object:
    > <%
    > Dim imageTarget, hor, ver, caption, index
    > imageTarget = Request.QueryString("link")
    > hor = Request.QueryString("hpx")
    > ver = Request.QueryString("vpx")
    > description = Request.QueryString("desc")
    > index = Request.QueryString("ind")
    > %>
    >
    > Viewing the new window source the information for image alt text and image
    > file location are supplied correctly but ( as I can also see as the new
    > window briefly displays the full asp header) that the hpx and vpx values
    are
    > "".
    >
    > What do you reckon?
    > Chris.
    >
    > "S. Elliott (timberfish.com)" <myemail@isprivate.com> wrote in message
    > news:S6FTa.180$2U.25579775@newssvr21.news.prodigy. com...
    > > I'm afraid I don't know enough about your situation to help. How are
    you
    > > sending your values to ASP? It sounds to me like this is more like an
    ASP
    > > thing than Flash. Give me some more information on how you're sending
    > data
    > > to ASP and how you're using it there.
    > >
    > > --
    > > Shane Elliott
    > > [url]www.timberfish.com[/url]
    > >
    > >
    > > "Chris Watt" <eyeworks@ozemail.com.au> wrote in message
    > > news:C5wTa.169$0h6.12151@nnrp1.ozemail.com.au...
    > > > I am loading a series of picture dimensions from an XML file into an
    > > array.
    > > > I then want to place the appropriate image dimension in an .asp
    header.
    > As
    > > > the array stores the number as a string I need to convert back to a
    > > numeric.
    > > > Using the Number function works fine in "Test Movie" and even on
    > personal
    > > > web server but testing proper over the internet the function returns
    > > nothing
    > > > and I get a zero sized img tag!
    > > >
    > > > What am I doing wrong?
    > > > TIA
    > > > Chris.
    > > >
    > > >
    > >
    > >
    >
    >

    S. Elliott \(timberfish.com\) Guest

  5. #4

    Default Re: Solution

    Glad to help

    --
    Shane Elliott
    [url]www.timberfish.com[/url]


    "Chris Watt" <eyeworks@ozemail.com.au> wrote in message
    news:ijrUa.305$gS.20996@nnrp1.ozemail.com.au...
    > When the xml file is read and values placed into the array they are read
    as
    > text values. Originally I was trying to convert the string array value to
    a
    > new numeric variable at the time of needing to put it in the getUrl
    > statement.
    > I used the Number function at time of storage of the xml value in the
    array
    > so storing numerics. This solved the problem and the pop up works
    perfectly
    > now.
    >
    > Thanks again Shane for having a look my problem.
    >
    > Chris.
    >
    >

    S. Elliott \(timberfish.com\) Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139