64 bits var

Hi,
in order to port the ogg lib under FLASCC, I need a 64 bits var.
I use int64_t but the g++ compiler say :
    error: integer constant is too large for ‘long’ type
my code is :
    int64_t granuleoff=0xffffffff;
    granuleoff<<=31;
    granuleoff|=0x7ffffffff;
g++ don't recognize int64_t or long long int type ?
Do you know what can I use to have a true 64 bits var ?
Thanks.
Regards,
Philippe

Hi,
in fact, just need to add LL at the end of values :
granuleoff|=0x7ffffffffLL;
Regards,
Philippe

Similar Messages

  • Problem with drag and drop

    Hi! I'm having a problem with getting this code working, basically I want to drag and drop two things onto another the things dissapear then it moves onto a new page, the first item works properly but then the second item wont dissapear and remains stuck to the cursor. Heres the code I'd be greatful of any help.
    import flash.events.MouseEvent;
    import fl.motion.MotionEvent;
    stop();
    Back6_btn.addEventListener(MouseEvent.CLICK, onBack6Click)
    function onBack6Click(event:MouseEvent):void{
        gotoAndPlay("Bedroom2");
        Forward6_btn.addEventListener(MouseEvent.CLICK, onForward6Click)
    function onForward6Click(event:MouseEvent):void{
        gotoAndPlay('Brother bit');
    var inGran:Number=0;
    Gin.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);
    Tonic.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);
    function dragOn(event:MouseEvent):void {
        event.target.startDrag(false);
        stage.addEventListener(MouseEvent.MOUSE_UP, dragOff);
    function dragOff(event:MouseEvent):void {
        event.target.stopDrag();
        if (event.target.dropTarget!=null&&event.target.dropTarget.parent==Gran) {
            event.target.visible=false;
            inGran++;
        stage.removeEventListener(MouseEvent.MOUSE_UP, dragOff);
    function checkPage(e:Event):void {
        if (inGran==2) {
            gotoAndPlay("Bedroom1");

    you have some mismatched brackets, change your target properties to currentTarget (and i'm not sure you're dropping onto the correct target) but, try:
    import flash.events.MouseEvent;
    import fl.motion.MotionEvent;
    stop();
    Back6_btn.addEventListener(MouseEvent.CLICK, onBack6Click)
    function onBack6Click(event:MouseEvent):void{
        gotoAndPlay("Bedroom2");
        Forward6_btn.addEventListener(MouseEvent.CLICK, onForward6Click)
    function onForward6Click(event:MouseEvent):void{
        gotoAndPlay('Brother bit');
    var inGran:Number=0;
    Gin.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);
    Tonic.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);
    function dragOn(event:MouseEvent):void {
    event.currentTarget.parent.addChild(event.currentTarget);
        event.target.startDrag(false);
        stage.addEventListener(MouseEvent.MOUSE_UP, dragOff);
    function dragOff(event:MouseEvent):void {
        event.target.stopDrag();
        if (event.target.dropTarget!=null&&event.target.dropTarget.parent==Gran) {
            event.target.visible=false;
            inGran++;
        stage.removeEventListener(MouseEvent.MOUSE_UP, dragOff);
    function checkPage(e:Event):void {
        if (inGran==2) {
            gotoAndPlay("Bedroom1");

  • [CS4/JS] Pnglib.jsx -- A PNG creator function

    After seeing Marc Autret's marvellous pngswatch script, I spent several hours creating PNGs with Photoshop, copying its hex data into Javascript compatible format, finding the relevant color bytes to change ... and all the while I was thinking, "there was an uncompressed PNG format, wasn't there?"
    That's not because I have a bad memory.
    Sure, Marc created his PNG in some other program, saved it as a compressed file, and 'only' changed the palette part in his script -- which involves delving quite deeply into the actual PNG format --, and that's a feasible way of doing the stuff he intended to: change jsut the color. But if you want to actually create a dropdown or listbox image on the fly -- say, for a line widths dropdown --, you have to be able to create an entire image a-new. And PNGs are notoriously difficult to create, because the image pixels themselves are compressed using the very advanced zlib compression.
    But (as I was thinking) ... zlib also allows a "non-compressed" format!
    With some sleuthing I found a couple of hints to get me started, and found a totally useful utility as well: pngcheck, which can take a PNG to bits and tell you what's wrong with it. So, here you have it: a lightweight PNGLIB Javascript, that can create any PNG right out of nothing!
    Any image, apart from the limitations, that is.
    Its main limitation is that you can only create 8-bit palettized PNGs with it. I see no reason to add umpteen functions to cater for the occasional 1-, 2-, or 4-bit or true color PNG, or to add total support for all the different types of transparency that PNG supports. But, hey, its main use is for icons, and you'll have to do with the limits of "just" 256 colors -- or even less than that, if you reserve one or more colors for transparency. On the plus side again, it's total real pixel alpha-level transparency we're talking about (overall that can make your graphics still better than the average '90s DOS game).
    Using the function is easy; at the bottom of the script is an example, but it boils down to:
    Create a string for the palette's colors. Each color is a triplet, in RGB order.
    Create a string for the transparency indexes. Each single entry determines the transparency of the full palette color at that index; the first entry applies to color index #0, the second to color index #1, and so on. The value [00] indicates zero opacity (fully transparent), the value [FF] full opacity. The transparency index string doesn't need to define all of your colors' transparencies; unlisted values are "normal", non-transparent, and if you only need to make color index #0 transparent, you are done right there and then. By the way, the transparency string may be omitted entirely if you don't need it.
    Create a string for the image itself -- wide x high color indexes. Make sure you fill the entire image, 'cause my function will refuse to work if this string length isn't correct.
    Then call my function: myImg = makePng (wide, high, palette, pixels [, transparency]);
    The returned string can be used immediately as a source for a ScriptUI dialog image, or -- less useful, but might come in handy -- be written to a file.
    Tips: hmm. I dunno. Don't use this function to create super-huge PNGs, I guess. The non-compression format uses a couple of checksums on its own, and they are sure to fail on very large images. But, come on, be realistic: it's not a Photoshop replacement we're talking about, it's for icons!
    And Be Kind to Your Users: it's rather overkill to include all of the data for a static PNG image, such as a logo or something. Just create that once, and include the binary data in your script! This function is designed to create PNGs on the fly, from variable rather than static data.
    Before I forget: here it is. Enjoy!
    /****** PngLib.jsx ******/
    /* A Jongware Product -- based *very* heavily, however, upon Marc Autret's pngswatch
    /* script (http://forums.adobe.com/thread/780105?tstart=0), and with further
    /* help from the pages of David "Code Monk" Jones (http://drj11.wordpress.com/2007/11/20/a-use-for-uncompressed-pngs/)
    /* and Christian Fröschlin (http://www.chrfr.de/software/midp_png.html)
    /* Any errors, of course, must have crept in while I wasn't paying attention.
    /* [Jw] 26-Jan-2010
    var makePng = (function()
         // Table of CRCs of 8-bit messages
         var CRC_256 = [0, 0x77073096, 0xee0e612c, 0x990951ba, 0x76dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0xedb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x9b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x1db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x6b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0xf00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x86d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x3b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x4db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0xd6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0xa00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x26d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x5005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0xcb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0xbdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d];
         // PNG Cyclic Redundancy Code algorithm -- http://www.w3.org/TR/PNG/#D-CRCAppendix
         var crc32s = function(/*uint[]*/buf)
              var c = 0xffffffff, i;
              for( i=0 ; i < buf.length; i++ )
                   c = CRC_256[(c ^ buf.charCodeAt(i)) & 0xff] ^ (c >>> 8);
              return (c ^ 0xffffffff);
         var header = function ()
              return "\x89PNG\x0D\x0A\x1A\x0A";
         var i2s = function (/*int32*/i)
              return String.fromCharCode(i>>>24) + String.fromCharCode(i>>>16) + String.fromCharCode(i>>>8) + String.fromCharCode(i);
         var chunk = function (/*4 Char PNG code*/chunkType, /*data*/data)
              var buf = chunkType + data;
              var crc = crc32s(buf);
              buf = i2s (data.length) + buf + i2s (crc);
              return buf;
         var adler32 = function (/*string*/buf)
              var i, a = 1, b = 0;
              for (i=0; i<buf.length; i++)
                   a += buf.charCodeAt(i); s1 %= 65521;
                   b += a; b %= 65521;
              return (b<<16)+a;
         return function(/*int*/wide, /*int*/high, /*string*/ pal, /*string*/image, /*string*/transpIndex)
              var t, bits;
              if (pal.length % 3)
                   alert ("Bad Palette length -- not a multiple of 3");
                   return null;
              if (image.length != high*wide)
                   alert ("Size error: expected "+(high*wide)+" bytes, got "+image.length);
                   return null;
              bits = '';
              for (t=0; t<high; t++)
                   bits += "\x00"+image.substr(t*wide, wide);
              t = bits.length;
              bits += i2s (adler32(bits));
              var r = header() + chunk ('IHDR', i2s (wide)+i2s(high)+"\x08\x03\x00\x00\x00");
              r += chunk ('PLTE', pal);
              if (transpIndex != null)
                   r += chunk ('tRNS', transpIndex);
              r += chunk ('IDAT', "\x78\x9c\x01"+ String.fromCharCode (t & 0xff)+String.fromCharCode((t>>>8) & 0xff)+String.fromCharCode ((~t) & 0xff)+String.fromCharCode(~(t>>>8) & 0xff)+bits);
              r += chunk ('IEND', '');
              return r;
    /* Sample usage. Remove when #including the above in _your_ script! */
    var pngPal  = "\x00\x00\x00"+"\xff\x00\x00"+"\x00\xff\x00"+"\x00\x00\xff"+"\xff\xff\x00"+"\x40\x40\x40";
    var pngData =     "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"+
                        "\x00\x01\x01\x02\x02\x03\x03\x04\x04\x00"+
                        "\x00\x01\x01\x02\x02\x03\x03\x04\x04\x00"+
                        "\x05\x01\x01\x02\x02\x03\x03\x04\x04\x05"+
                        "\x05\x01\x01\x02\x02\x03\x03\x04\x04\x05"+
                        "\x05\x01\x01\x02\x02\x03\x03\x04\x04\x05"+
                        "\x05\x01\x01\x02\x02\x03\x03\x04\x04\x05"+
                        "\x05\x01\x01\x02\x02\x03\x03\x04\x04\x05"+
                        "\x05\x01\x01\x02\x02\x03\x03\x04\x04\x05"+
                        "\x05\x01\x01\x02\x02\x03\x03\x04\x04\x05"+
                        "\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05";
    img = makePng (10,11, pngPal, pngData, "\x40");
    var w = new Window("dialog", "Image test");
    w.add ('image', undefined, img);
    var f = new File(Folder.myDocuments+"/test-me2.png");
    if (f.open('w'))
         f.encoding = "BINARY";
         f.write (img);
         f.close();
    } else
         alert ("eh -- couldn't write test file...");
    w.show();

    Here is a more complicated (and useful ) example. (--Its actual usefulness is not as, erm, useful as I hoped, because it seems you don't have access to the built-in stroke styles! If anyone knows a work-around that, let me know ...)
    First, create a few custom Striped and/or Dashed stroke styles; then call this Javascript to see them created "live" in the drop down. Make sure you removed the sample code from the end of "pnglib.jsx", otherwise that dialog with interfere and mess up my nice program.
    #include "pnglib.jsx"
    function createStripeImg (styleIndex)
         var pngPal  = "\x00\x00\x00"+"\xff\xff\xff";
         var pngData = '';
         var x,y, ystart;
         var stripes = [];
         var i;
         for (y=0; y<app.activeDocument.stripedStrokeStyles[styleIndex].stripeArray.length; y++)
              stripes.push (Math.round (11*app.activeDocument.stripedStrokeStyles[styleIndex].stripeArray[y]/100));
         i = 0;
         for (y=0; y<11; y++)
              if (y >= stripes[i])
                   if (y <= stripes[i+1])
                        for (x=0; x<48; x++)
                             pngData += "\x00";
                        continue;
                   i += 2;
              for (x=0; x<48; x++)
                   pngData += "\x01";
         return makePng (48,11, pngPal, pngData, "\xff\x00");
    function createDashImg (styleIndex)
         var pngPal  = "\x00\x00\x00"+"\xff\xff\xff";
         var pngData = '';
         var x,y, xstart;
         var dashes = [];
         var i, len;
         len = 0;
         for (y=0; y<app.activeDocument.dashedStrokeStyles[styleIndex].dashArray.length; y++)
              len += app.activeDocument.dashedStrokeStyles[styleIndex].dashArray[y];
         xstart = 0;
         for (y=0; y<app.activeDocument.dashedStrokeStyles[styleIndex].dashArray.length; y++)
              dashes.push (xstart);
              xstart += Math.round (48*app.activeDocument.dashedStrokeStyles[styleIndex].dashArray[y]/len);
         dashes.push (47);
         i = 0;
         for (y=0; y<11; y++)
              if (y < 3 || y > 8)
                   for (x=0; x<48; x++)
                        pngData += "\x01";
              } else
                   xstart = 0;
                   for (x=0; x<48; x++)
                        if (x >= dashes[xstart])
                             if (x >= dashes[xstart+1])
                                  xstart += 2;
                             pngData += "\x00";
                        } else
                             pngData += "\x01";
         return makePng (48,11, pngPal, pngData, "\xff\x00");
    if (app.activeDocument.stripedStrokeStyles.length+app.activeDocument.dashedStrokeStyles.length < 1)
         alert ("This example needs a few custom stripe or dash stroke styles to play with");
         exit (0);
    var w = new Window("dialog", "Select a stripe type");
    var ddl = w.add("dropdownlist");
    for( i=0; i < app.activeDocument.stripedStrokeStyles.length; i++)
         (ddl.add('item', " "+app.activeDocument.stripedStrokeStyles[i].name)).image = createStripeImg (i);
    for( i=0; i < app.activeDocument.dashedStrokeStyles.length; i++)
         (ddl.add('item', " "+app.activeDocument.dashedStrokeStyles[i].name)).image = createDashImg (i);
    ddl.selection = 0;
    g = w.add ("group");
    g.orientation = 'row';
    g.add ("button", undefined, "OK");
    g.add ("button", undefined, "Cancel");
    w.show();

  • Decode Base64 and save as binary file

    Hi there,
    I am using Adobe Air 1.5 with JavaScript and want to save a file to my hard
    drive. I get the data from a WebService via SOAP as a Base64 encoded string. A test-string is attached. When I try to decode it with
    the WebKit function "atob()" and try to save this bytes with following code, I can't open the file.
    this.writeFile = function(outputfile, content, append){
    var file =a ir.File.applicationStorageDirectory.resolvePath(outputfile);
    var stream = newa ir.FileStream();
    if (append) {
    stream.open(filea, ir.FileMode.APPEND);
    }else {
    stream.open(filea, ir.FileMode.WRITE);
    try{//Binärdaten
    stream.writeBytes(content0, , content.length);
    }catch(e){//Textdaten
    stream.writeUTFBytes(content);
    stream.close();
    The same happens when I try to open a file from my HDD and read in the bytes. When I decode it to base64, the string is not equal to the string, which is correct.
    I attached a working Base64 string, which I could convert back to a zip-file via a only encoder.
    So my question is, how can I decode a Base64 string and save the binary data to a file?
    Thank you for your help.

    I rewrote the Base64 decoder/encoder to use it with a ByteArray. Here ist the code:
    var byteArrayToBase64 = function(byteArr){
        var base64s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
         var encOut = "";
        var bits;
        var i = 0;
        while(byteArr.length >= i+3){
            bits = (byteArr[i++] & 0xff) << 16 | (byteArr[i++] & 0xff) << 8 | byteArr[i++] & 0xff;
              encOut += base64s.charAt((bits & 0x00fc0000) >> 18) + base64s.charAt((bits & 0x0003f000) >> 12) + base64s.charAt((bits & 0x00000fc0) >> 6) + base64s.charAt((bits & 0x0000003f));
        if(byteArr.length-i > 0 && byteArr.length-i < 3){
            var dual = Boolean(byteArr.length - i - 1);
            bits = ((byteArr[i++] & 0xff) << 16) | (dual ? (byteArr[i] & 0xff) << 8 : 0);
            encOut += base64s.charAt((bits & 0x00fc0000) >> 18) + base64s.charAt((bits & 0x0003f000) >> 12) + (dual ? base64s.charAt((bits & 0x00000fc0) >> 6) : '=') + '=';
        return encOut;
    var base64ToByteArray = function(encStr){
        var base64s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
         var decOut = new air.ByteArray(); 
        var bits;
        for(var i = 0, j = 0; i<encStr.length; i += 4, j += 3){
            bits = (base64s.indexOf(encStr.charAt(i)) & 0xff) <<18 | (base64s.indexOf(encStr.charAt(i +1)) & 0xff) <<12 | (base64s.indexOf(encStr.charAt(i +2)) & 0xff) << 6 | base64s.indexOf(encStr.charAt(i +3)) & 0xff;
            decOut[j+0] = ((bits & 0xff0000) >> 16);
              if(i+4 != encStr.length || encStr.charCodeAt(encStr.length - 2) != 61){
                   decOut[j+1] = ((bits & 0xff00) >> 8);
              if(i+4 != encStr.length || encStr.charCodeAt(encStr.length - 1) != 61){
                   decOut[j+2] = (bits & 0xff);
        return decOut;

  • Script to insert an existing Rich symbol throws error

    I have an existing Rich Symbol called RSymbol. Now I write a script to place RSymbol into a certain layer which create. The problem is, that everytime i import a symbol like this with
    fw.getDocumentDOM().importFile(fw.appSymbolLibrariesDir+"RSymbol.graphic.png", {left:136, top:108, right:136, bottom:108}, false, 0, false);
    Fw doesnt import the properties for this symbol and throws an error "Component graphic or script edited An error occured"
    I also tried to put the rich symbol in the appSwfCommandsDir but it didnt work either. I guess the problem could be that the RSymbol isnt in the Common Library folder. appSymbolLibrariesDir doesnt point to the common library folder but to some other folder (Adobe Fireworks CS5\Configuration\Libraries).
    I also tried to use fw.getDocumentDOM().importFile(fw.appSettingsDir+"/Common Library/... but it doesnt work either.
    I want to use this script in a panel so I cant hard code the absolute path.
    Any suggestions how to import a rich symbol and make the rich properties available?
    Thanks a lot!

    Sadly, I don't think there's any way to programmatically insert a rich symbol while maintaining its "richness".  I tried and failed to do that in my QuickFire extension: http://johndunning.com/fireworks/about/QuickFire
    The best I could do was to insert the symbol in a way that if you had already dragged that symbol from the common library into the document, the new instance would still show something in the symbol properties panel.  Here's the code that QuickFire uses to insert symbols:
    function insertSymbol(
         inSymbolName,
         inPath)
         var dom = fw.getDocumentDOM();
         var middleX = Math.round(dom.width / 2);
         var middleY = Math.round(dom.height / 2);
         try {
                   // first assume the symbol is already in the library and try to
                   // insert an instance.  there doesn't seem to be an API to list
                   // the symbols in the document, so we just have to try it.
              dom.insertSymbolAt(inSymbolName, {
                   x: middleX,
                   y: middleY
         } catch (exception) {
                   // replace the user or app JS directory path tokens with the
                   // actual path, so that importSymbol will find it below
              inPath = inPath.replace(/^:U:/, k.UserSymbolsPath).replace(/^:A:/, k.AppSymbolsPath);
                   // the symbol isn't in the document yet, so import it.  we use
                   // importFile instead of importSymbol because the former seems
                   // to preserve some magic that allows you to turn it back into a
                   // rich symbol if you later drag the same symbol from the Common
                   // Library into the doc and replace existing instances.
              dom.importFile(inPath, {
                   left: middleX,
                   right: middleX,
                   top: middleY,
                   bottom: middleY
              }, true);
    // this is a failed attempt to import a rich symbol.
                   // the jsf filename doesn't include the .graphic bit
              var jsfPath = inPath.replace(/\.(graphic|animation|button)\.png$/, ".jsf");
              if (Files.exists(jsfPath)) {
                        // to change the opCode, so that the rich symbol's jsf file
                        // will give it the default values, we need to create a proxy
                        // Widget object.  but first save off the actual Widget.
                   var _Widget = Widget;
                   Widget = {
                             // we want this to be opCode 1, which will set the symbol's
                             // default values
                        opCode: 1,
                             // the symbol we just imported is Widget.elem
                        elem: fw.selection[0],
                        propString: _Widget.propString,
                             // pass these method calls on to the real Widget
                        GetObjectByName: function()
                             return _Widget.GetObjectByName.apply(_Widget, Array.prototype.slice.call(arguments, 0));
                        isWidgetSelected: function()
                             return _Widget.isWidgetSelected.apply(_Widget, Array.prototype.slice.call(arguments, 0));
                        UpdateWidget: function()
                             return _Widget.isWidgetSelected.apply(_Widget, Array.prototype.slice.call(arguments, 0));
                   fw.runScript(jsfPath);
                        // reset the global to the real Widget object
                   Widget = _Widget;
    Hope that helps.

  • Passing Opaque Objects from Oracle to Java

    Hi all
    I am trying to write a stored procedure that needs to be called from different triggers. Each triggers needs to pass a different set of data to the stored procedure. Now the problem is that i need to pack the different set of data into one opaque object type that i can pass onto java. Is there any way of doing this. I am using Oracle 9i running on Linux 2.4.9. I tried using the Object datatype in Oracle 9i. But am not able to pass a object datatype to java directly.

    Didn't know that. Guess the way this API handles the struct is it puts it on the heap, since this idea (with passing a 32-bit var back and forth with a memory location) worked.
    My next problem - I can't figure out a way to destroy a jstring: whenever I do an env->GetStringUTF((char*)charBuff), it seems to simply copy the bytes from the buffer
    into the same String object up the length of the buff (so I get the extra bytes from the previous String if it was longer at the end).
    Here's how it works: I have a loop in C code that parses tags inside a file, then depending on what tag it is, I create a new jobject and call a Java method to do stuff
    to that object. As one of the parameters in the constructor I pass in a String that I create (as you can see above) from a character array, however I am getting
    massive artifacts when I print out that String inside the Java method.
    Thoughts? :(

  • DPM 2012 R2 agent update on Windows 2003 server x64

    Hi,
    I have an old windows 2003 server x64 protected by DPM 2012 Sp1. After DPM upgrade to 2012 R2 I cannot update DPM Agent on server. If I try to update agent manually error message is : agentsetup.exe is not a valid win32 application.
    Mihai

    command back,
    edit: it seems like a reboot is definitely needed to get it working 
    got it working like described here: http://support.microsoft.com/kb/2958100/en-us
    Install the Microsoft Visual C++ 2008 Redistributable on Windows Server 2003 servers if it is not already installed.
    Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)
    Microsoft Visual C++ 2008 Redistributable Package (x64)
    Note The following error occurs if the C++ redistributable is not installed:
    Data Protection Manager Setup
    Could not load the setup launch screen. Please contact Microsoft Product Support.
    Copy the Windows Server 2003 Agent installer that is located on in the DPM server to the Windows Server 2003 server, and then install the agent.
    64-bit: <var>DPM Installation Location</var>\DPM\agents\RA\4.2.1226.0\amd64\1033\DPMAgentInstaller_Win2K3_AMD64.exe
    32-bit: <var>DPM Installation Location</var>\DPM\agents\RA\4.2.1226.0\i386\1033\
    DPMAgentInstaller_Win2K3_i386.exe
    Run the following command at an administrative command prompt:
    cd DPM Agent Installation Location\DPM\bin\setdpmserver.exe –dpmservername DPM Server Name
    Run the following Windows Powershell cmdlet to establish a connection with the DPM server:
    Attach-ProductionServer.ps1 DPMServerNameProductionServerNameUserNamePasswordDomain
    regards
    Stefan

  • Changing script from CS2 to CS4

    Hi everyone!
    Having a bit of a problem (not to mention working against a deadline) with an old CS2 script created for a client. ESTK throws up an "Undefined is not an object" error.
    Below is the code that seems to be the culprit. ESTK stops on the line after the .place(), assuming here that it's because the .place() doesn't return a proper object or something like that (I hate when they change scripting around too much).
    Basically, what it does is placing an image into the first paragraph of a table cell. It then tries to set the dimensions to a "maximum" size and then fits the image proportionally to those dimensions.
    > tmpBild = "B0000843.jpg"; //temporary for testing
    newTable.rows[newTable.bodyRowCount-1].cells[4].contents = "\r";
    tmpPara = newTable.rows[newTable.bodyRowCount-1].cells[4].paragraphs.item(0);
    tmpPara.justification = Justification.centerAlign;
    tmpImg = tmpPara.place( PICBASE + tmpBild );
    tmpImg.parent.visibleBounds = ["0mm","0mm","38.236mm","38.236mm"];
    tmpImg.parent.geometricBounds = ["0mm","0mm","38.236mm","38.236mm"];
    tmpImg.fit( FitOptions.proportionally );
    tmpImg.parent.fit( FitOptions.frameToContent );
    tmpImg.parent.strokeColor = "Paper";
    tmpImg.parent.strokeAlignment = StrokeAlignment.centerAlignment;
    tmpImg.parent.strokeWeight = "5pt";
    tmpImg.parent.strokeType = app.strokeStyles.item("Thick - Thin");
    Can anybody help convert this so it works for InDesign CS4? In the meantime, I will try to take care of the rest of the script.
    Btw, I have/had a scripting
    b reference
    in PDF format for InDesign CS2, is there anywhere that I can download that for CS4, I know it was very helpful back then.

    What I ended up doing was create roughly enough pages in the document and create linked text frames on all pages, thus letting the table created in the first text frame flow as long as the document has enough pages. In the end processing, I then remove all the pages but the first one, effectively getting one page with one text frame containing all table contents.
    This was the only way I could find to get around this problem. No matter what I did, placing content into a table cell that was overflowing a text frame just didn't work.
    Here's the part where I create the pages (variable myMaxPages contains your estimated maximum number of pages). Please note in app.documents.add() that it is set to false to NOT open a window (speeds it up very slightly if you have a huge number of pages). You can remove the false and the myDocument.windows.add() statement if you don't want this or for debug purposes. The formatting mechanism on these forums seem broken, but the following code should be ok/readable once properly formatted.
    >myDocument = app.documents.add( false );
    with(myDocument) {
    for( i = 0; i < myMaxPages; i++ ) {
    myPage = pages.item(i);
    with(myPage) {
    if( i > 0 ) { myPrevFrame = myTextFrame; }
    myTextFrame = textFrames.add();
    with( myTextFrame ) {
    if( i == 0 ) {
    myTable = tables.add();
    with( myTable ) {
    bodyRowCount = 1;
    columnCount = 5;
    } else {
    if( i > 0 ) { previousTextFrame = myPrevFrame; }
    if( i < myMaxPages - 1 ) {
    pages.add();
    myDocument.windows.add();
    While fiddling with it, I also updated my image placement code a bit:
    > var myCell = myTable.rows[myTable.bodyRowCount-1].cells[4];
    myCell.contents = "\r";
    myCell.paragraphs.item(0).justification = Justification.centerAlign;
    var myRect = myCell.insertionPoints[0].textFrames.add();
    myRect.contentType = ContentType.unassigned;
    myRect.visibleBounds = ["0mm","0mm","38.236mm","38.236mm"];
    myRect.geometricBounds = ["0mm","0mm","38.236mm","38.236mm"];
    var myFile = File(PICBASE + tmpBild);
    if( myFile.exists ) {
    var myImage = myRect.place( myFile );
    myRect.fit( FitOptions.proportionally );
    myRect.fit( FitOptions.frameToContent );
    Maybe this helps someone, maybe it doesn't. Can't say that I'm happy with the behaviour of getting errors and being unable to place content in table cells that is overflowing out of a text frame, but I needed to solve it, and this is how I did it.
    Of course, if anyone else has a better solution to placing images into table cells that may be in the overflowing part of a text frame, go ahead and share with the rest of us, please.

  • Layer Comps To Files with no number count in the middle

    I have tried to find it and // it out with no success. I would like to have it when I "Layer Comps To Files" the it won't put the _0000_,_0001_, Etc.. in the middle of every file the comps are named acording ly so that when i do "Layer Comps To Files" i can add a bit to the front and the remainder of the comp name is enough i don't need count in the middle of the file.
    I had asked in a different post how to "Load Files to Stack..." could i instead have the "Layer Comps To Files" disreguard .png or .jpg in the end of the layer comp?
    SO in looking in to the script my self i know it has to be in this bit
                for ( compsIndex = 0; compsIndex < compsCount; compsIndex++ ) {                 var compRef = docRef.layerComps[ compsIndex ];                 if (exportInfo.selectionOnly && !compRef.selected) continue; // selected only                 compRef.apply();                 var duppedDocument = app.activeDocument.duplicate();                 var fileNameBody = exportInfo.fileNamePrefix;                 fileNameBody += "_" + zeroSuppress(compsIndex, 4);                 fileNameBody += "_" + compRef.name;                 if (null != compRef.comment)    fileNameBody += "_" + compRef.comment;                 fileNameBody = fileNameBody.replace(/[:\/\\*\?\"\<\>\|\\\r\\\n]/g, "_");  // '/\:*?"<>|\r\n' -> '_'                 if (fileNameBody.length > 120) fileNameBody = fileNameBody.substring(0,120);                 saveFile(duppedDocument, fileNameBody, exportInfo);                 duppedDocument.close(SaveOptions.DONOTSAVECHANGES);             }
    this little bit
    var fileNameBody = exportInfo.fileNamePrefix;
    fileNameBody += "_" + zeroSuppress(compsIndex, 4);
    fileNameBody += "_" + compRef.name;
    stood out but i'm no scripter so help

    I took a quick look at that script. for Windows it may not be too big of a deal, but for Macs, there is something in there that requires the file names. It's easy to break those scripts, so it might be better to write a script that removes the file name later. something like this, which assumes that there are no groups and the layer names only have one "." in them before the extension. I haven't tried this, as I'm don't have PS loaded on the computer I'm using.
    #target photoshop
    var doc = activeDocument;
    for(var i=0;i<doc.layers.length){
        doc.activeLayer = doc.layers[0];
        doc.activeLayer.name = doc.activeLayer.name.split('.')[0];

  • Set XML-Attributes for multiply objects

    Hi everybody,
    this is my situation. I have a document with several pages and several objects on each page.
    now I want to get the coordinates and the dimensions of a object and write down the datas as a XML-attribute.
    The script should do this for every object in my document.
    That's what i got so far:
    function creatAtt(){
        for (var i = 0; i < app.selection.length; i++){
        var myObject     = app.selection[i];
        var myXMLobject = myObject.associatedXMLElement;
        var ycoords     = myObject.geometricBounds[0];
        var xcoords     = myObject.geometricBounds[1];
        var width         = myObject.geometricBounds[3] - myObject.geometricBounds[1];
        var height         = myObject.geometricBounds[2] - myObject.geometricBounds[0];
        myXMLobject.xmlAttributes.add ("Y-Koordinate", ycoords.toString() + " px");
        myXMLobject.xmlAttributes.add ("X-Koordinate", xcoords.toString() + " px");
        myXMLobject.xmlAttributes.add ("Width", width.toString() + " px");
        myXMLobject.xmlAttributes.add ("Height", height.toString() + " px");
    creatAtt();
    When I select a object and run the script it only writes the data for the selected object, not for all objects. Somebody a tip how to fix it???

    Hi,
    I have tried the script. And it only writes down the attributes for one object. Directly in the root. I have attached a screenshot. But i want to write the attributes in the hotspot Tags of the selected object.
    I hope you know what I mean .
    I dont know where he gets the datas bot that are not the datas of one of my three objects.
    I changed the scrip a little bit:
    var myDoc     = app.activeDocument; 
    var myPages = myDoc.pages;
    for (var i = 0; i < myPages.length; i++){
        var myActualPage = myPages[i].pageItems;
        for (var j = 0; j < myActualPage.length; j++){
            var myObject     = myActualPage[j];
            var myXMLobject = myObject.associatedXMLElement;
            var ycoords     = myObject.geometricBounds[0];
            var xcoords     = myObject.geometricBounds[1];
            var width         = myObject.geometricBounds[3] - myObject.geometricBounds[1];
            var height         = myObject.geometricBounds[2] - myObject.geometricBounds[0];
            myXMLobject.xmlAttributes.add ("Y-Koordinate", ycoords.toString() + " px");
            myXMLobject.xmlAttributes.add ("X-Koordinate", xcoords.toString() + " px");
            myXMLobject.xmlAttributes.add ("Width", width.toString() + " px");
            myXMLobject.xmlAttributes.add ("Height", height.toString() + " px");
    But then I get a error message:
    Errornumber: 21
    null is not an object.
    Row 60 --> He means this part of the script: myXMLobject.xmlAttributes.add ("Y-Koordinate", ycoords.toString() + " px");

  • CSS Issues , HTML text not rendering properly

    I've loaded and parsed some xhtml in my DataManager class that is validated against the W3C strict dtd.I'm pushing certian bits of this into public arrays in my DataManager. My ContentManager, calls to the DataManager, and is returned a corresponding data set ,  instantiates a new GenericSection , and passes in the array as an argument in the constructor.
    var targetData : Array = new Array();
    targetData = DataManager.getInstance().returnAboutData();
    var targ : String = targetData[0].toString();
    var targFormat : String = targ.slice( ( targ.indexOf( '">' , 0 ) + 2 ) , ( targ.lastIndexOf( '/p>' , 0 ) - 3 ) );
    var newSection : GenericContent = new GenericContent( targFormat );                   
    newSection.publicId = ind;
    contentContainer.addChild( newSection );
    The output of formatTarg is :
    The purpose of this site is to serve as an online portfolio and work reference. I am a 28 year old WEB/INTERACTIVE developer who has worked in the Los Angeles and Greater Orlando areas since 2004. I specialize in
      <span class="bulletText">ADOBE FLASH</span>
      <span class="bulletText">FLASH ANIMATION</span>
      <span class="bulletText">ACTIONSCRIPT 2.0/3.0</span>
      , and
      <span class="bulletText">ACTIONSCRIPT PROJECTS IN FLEX</span>
      . The client links listed above will provide several examples of media that I developed for the web. Please select the ACTIVE TEXT to the right of the PROJECT LINK heading in each section , if available ,  to view the site.
    My GenericContent class i linked to a movieclip in the library , with one dynamic textfield, with the following settings :
    instanceName : sectionText;
    anti-aliasing : for readability;
    embed : uppercase , lowercase , numerals , and puncutation
    behavior : muliline
    render as html : selected( true );
    sectionText is declared as a public var in the GenericContent instance.
    I have tried applying styles as such :
    private var css                    :            StyleSheet;
    private var cssDeclarations            :            String;
    css = new StyleSheet();
    var bulletText : Object = new Object(); 
    bulletText .fontSize = 20; 
    bulletText .fontWeight = "bold"; 
    bulletText .color = "#336699"; 
    bulletText .leading = 12;
    css.setStyle( ".bulletText ", bulletText  );
    sectionText.wordWrap = true;
    sectionText.embedFonts = true;
    sectionText.styleSheet = css;
    sectionText.htmlText = contentText;
    and
    css = new StyleSheet();
    cssDeclarations = ".bulletText{font-size:12px;color:#FFFF00"};
    css.parseCSS(cssDeclarations);
    sectionText.wordWrap = true;
    sectionText.embedFonts = true;
    sectionText.styleSheet = css;
    sectionText.htmlText = contentText;
    The html is not being rendered properly , the tags themselves do not show up , but no style is being applied. Any ideas , or perhaps a better approach ? thanks !

    Upon further investigation i figured out what was wrong.
    This property :
    bulletText .fontWeight = "bold";
    was causing my text to not render because bold character weren't used within the symbol associated with the class. By removing that and cleaning up the code a bit ,
    var span : Object = new Object(); 
    span.fontSize = 12; 
    span.color = "#336699";
    css = new StyleSheet();
    css.setStyle( ".bulletText", span );
    sectionText.styleSheet = css;           
    sectionText.htmlText = contentText;
    it rendered semi correctly , except with erronious line breaks , the solution for that was to , remove any instances of "/n" from the contentText string before setting the sectionText , done like this :
    var pattern : RegExp = /\n/g;
    contentText = contentText.replace( pattern , "" );
    now it looks great !

  • GetBitmap - PHP - huh ? help !

    Ok, for those of you who read my last post (Need information)  I'm still working on that customization module.  Thing is,
    I was requested new things during the developement process and I'm totally lost now.
    Not only I need to create the 'login' PHP files and test them on the server, I also need to create a module that will capture the image of the 'customized product' that the customer made and with a click, send it to us.
    I've found (from our earliest versions of our website (made by another developper)) a module in which I can have the customer upload a jpeg, png or bmp to the PHP and use this image over the initial image (contained in an empty MC), stretch and rotation tools included.
    Some forum told me I should create a byteArray and send the uploaded picture to the array then place it in a temporary MC over the product image.  I've found a module on the internet that captures the listed MCs at the 'press' event, in a pre-established frame.  But so far, all module sends the captured image to my printer.  I need to change that part.
    So, if ANYONE could just suggest something simpler....   like I said, I'm not developer yet, but I got some skills.  I can manage to get my things to work most of the time but this is totally new to me.  Never touched PHP before.
    Here's the code I've found for the upload of the image over the product :
    System.security.allowDomain("http://localhost/");
    import flash.net.FileReference;
    var listener:Object = new Object();
    listener.onSelect = function(selectedFile:FileReference):Void {
      statusArea.text = details.text = ""
      statusArea.text += "Attempting to upload " + selectedFile.name + "\n";
      selectedFile.upload("upload.php");
    listener.onOpen = function(selectedFile:FileReference):Void {
      statusArea.text += "Uploading " + selectedFile.name + "\n";
    listener.onHTTPError = function(file:FileReference, httpError:Number):Void {
    imagePane.contentPath = "error";
    imagePane.content.errorMSG.text = "HTTPError number: "+httpError +"\nFile: "+ file.name;
    listener.onIOError = function(file:FileReference):Void {
    imagePane.contentPath = "error";
    imagePane.content.errorMSG.text = "IOError: "+ file.name;
    listener.onSecurityError = function(file:FileReference, errorString:String):Void {
    imagePane.contentPath = "error";
    imagePane.content.errorMSG.text = "SecurityError: "+SecurityError+"\nFile: "+ file.name;
    listener.onComplete = function(selectedFile:FileReference):Void {
        statusArea.text += "Upload finished.\nNow downloading " + selectedFile.name + " to player\n";
        details.text = ""
      for(i in selectedFile) details.text +="<b>"+i+":</b> "+selectedFile[i]+"\n"
      downloadImage(selectedFile.name);
    var imageFile:FileReference = new FileReference();
    imageFile.addListener(listener);
    uploadBtn.onPress = uploadImage;
    imagePane.addEventListener("complete", imageDownloaded);
    function uploadImage(event:Object):Void {
      imageFile.browse([{description: "Image Files", extension: "*.jpg;*.gif;*.png"}]);
    function imageDownloaded(event:Object):Void {
      if(event.total == -1) {
        imagePane.contentPath = "error";
    function downloadImage(file:Object):Void {
      imagePane.contentPath =  "./files/" + file;
    stop();
    This is the code for the jpeg to php:
    import flash.display.BitmapData;
    import flash.geom.Rectangle;
    import flash.geom.ColorTransform;
    import flash.geom.Matrix;
    class it.simontest.PrintScreen {
        public var addListener:Function
        public var broadcastMessage:Function
        private var id:   Number;
        public  var record:LoadVars;
        function PrintScreen(){
            AsBroadcaster.initialize( this );
        public function print(mc:MovieClip, x:Number, y:Number, w:Number, h:Number){
            broadcastMessage("onStart", mc);
            if(x == undefined) x = 0;
            if(y == undefined) y = 0;
            if(w == undefined) w = mc._width;
            if(h == undefined) h = mc._height;
            var bmp:BitmapData = new BitmapData(w, h, false);
            record = new LoadVars();
            record.width  = w
            record.height = h
            record.cols   = 0
            record.rows   = 0
            var matrix = new Matrix();
            matrix.translate(-x, -y)
            bmp.draw(mc, matrix, new ColorTransform(), 1, new Rectangle(0, 0, w, h));
            id = setInterval(copysource, 5, this, mc, bmp);
        private function copysource(scope, movie, bit){
            var pixel:Number
            var str_pixel:String
            scope.record["px" + scope.record.rows] = new Array();
            for(var a = 0; a < bit.width; a++){
                pixel     = bit.getPixel(a, scope.record.rows)
                str_pixel = pixel.toString(16)
                if(pixel == 0xFFFFFF) str_pixel = ""; 
                scope.record["px" + scope.record.rows].push(str_pixel)
            scope.broadcastMessage("onProgress", movie, scope.record.rows, bit.height) 
            scope.record.rows += 1
            if(scope.record.rows >= bit.height){
                clearInterval(scope.id)
                scope.broadcastMessage("onComplete", movie, scope.record) 
                bit.dispose();
    and this is the code for the FLA :
    import it.simontest.mloaderWindow
    import it.simontest.PrintScreen
    var loader:mloaderWindow = this.createClassObject(mloaderWindow, "loader", 10, {_x:-1000, _y:-1000})
    loader.setStyle("borderColor", 0xFFFFFF)
    var listener:Object = new Object();
    listener.onProgress = function(target:MovieClip, loaded:Number, total:Number){
        var perc = Math.round((loaded/total)*100)
        loader.label = "loading" + perc + "%"
        loader.value = perc
    listener.onComplete = function(target:MovieClip, load_var:LoadVars){
        loader.label = "sending to php..."
        load_var.send("files/pixels.php", "_blank", "POST")
        loader.close()
    function print_me(){
        video_mc.pause()  
        pn = new PrintScreen();
        pn.addListener( listener );
        pn.print(_root, 733, 9, 377, 469)
        loader.label = "computing... 0%"
        loader.open(true, true, true);
    I won't place all of the codes I'm using I think you get the idea.  The print_me function needs to be replaced my 'send_me'  so we ask the PHP to send to our services the preview the customer has prepared for us on our email.  Then, we take care of building a nice looking preview image for them since we ask that they send us the logo itself in a PNG format or AI (to PDF).
    Anyway.... If ANYONE has an idea... a little guidance would be appreciated.  I can work these parts one by one.... but I don't have the knowledge YET to make all of them work together.
    Also, I'm downloaded active Perl and Strawberry Perl, hoping to emulate a PHP server.  I don't know which one to use...  any suggestions ?
    Thanks

    So there is an icon for the Uno and an icon that you created for your MIDI keyboard, correct? Then you connect the two units to each other. If you are only going to be sending MIDI info from your keyboard (not receiving) then you need to make a connection from the OUT arrow on your controller icon going to the IN arrow on the Uno.

  • ClearInterval not clearing from function

    Ok
    I have a flash script that sets one Interval to run at
    startup. after a button is clicked I want to clear the first
    Interval and set a new Interval at a faster rate. Then after a
    boolean condition I want to clear the second Interval and go back
    and set the first Interval that runs at a slower rate. I feel
    pretty confident that it is a scope issue but I cant find it. I can
    clear the first Interval and set the second fine but after the
    boolean condition clearInterval() will not clear. The function
    keeps running. Here is the code.
    =================main=====================================
    var con1:String = "OFF";
    var con2:String = "ON";
    var con3:String = "OFF";
    con_1.ID = con1;//PointID; // Readback status
    con_2.ID = con2;//PointID2; // Start button write bit
    con_3.ID = con3;//PointID3; // Stop button write bit
    var myNum:Number;
    myNum = setInterval(this, "evaluateOutput", 5000); // Set
    timer to display updated values
    trace(this);
    //********************* Main body functions ***************
    function sendCommand()
    trace(myNum);
    trace(this);
    trace(this.myNum);
    if(con2 == "ON")
    if(con1 == "ON")
    con_2.sendOverride(PointID2,"OFF");
    btn_start.enabled = false;
    btn_stop.enabled = true;
    btn_start.selected = false;
    btn_stop.selected = true;
    clearInterval(_parent.myNumb);
    //this.myNum = setInterval(this, "evaluateOutput", 5000);
    if(con3 == "ON")
    if(con1 == "OFF")
    con_3.sendOverride(PointID3,"OFF");
    btn_start.enabled = true;
    btn_stop.enabled = false;
    btn_start.selected = true;
    btn_stop.selected = false;
    clearInterval(myNumb);
    myNum = setInterval(evaluateOutput, 5000);
    function evaluateOutput() {//When function is called:
    if (con1 == "ON" || con1 > 0)
    btn_start.enabled = false;
    btn_stop.enabled = true;
    btn_stop.selected = true;
    else
    btn_stop.enabled = false;
    btn_start.enabled = true;
    btn_start.selected = true;
    ========================Button==============================
    on (click){//when button is mouse clicked:
    trace(this);
    _parent.con_2.sendOverride(_parent.PointID2,"ON");//send and
    override with the current point ID and the text in the input box
    clearInterval(_parent.myNum);
    _parent.myNum = setInterval(_parent.sendCommand, 1000);
    trace(this._parent);
    btn_start.enabled = false;
    btn_stop.enabled = false;
    }

    You code looks like you are Comparing NULLS?
    see difference between these two
    with p as(
    select 1 col1,2 col2 ,3 col3 from dual
    union all
    select 4 ,5 ,6  from dual
    union all
    select 7,8,9  from dual
    union all
    select null,8,9  from dual
    select * from p where col1=1
    with p as(
    select 1 col1,2 col2 ,3 col3 from dual
    union all
    select 4 ,5 ,6  from dual
    union all
    select 7,8,9  from dual
    union all
    select null,8,9  from dual
    select * from p where col1=nullEdited by: user5495111 on Aug 11, 2009 1:54 PM

  • C# Query-Add 'where'

    Hi there!
    I have some code that I am using:
    class XPlayerVsPlayerEvent : XEvent
    public XPlayerVsPlayerEvent(PlayerVsPlayerEvent evt)
    : base(evt, "PlayerVsPlayerEvent")
    bool finished = (evt.PublicEventStatus == PublicEventStatus.Finished
    ||
    evt.FeedHasEarlyResults == true && evt.EventStatus == EventStatus.Run);
    Add(
    new XAttribute("PlayerAID", evt.PlayerA_ID),
    new XAttribute("PlayerAName", evt.PlayerA_Name),
    new XAttribute("PlayerBID", evt.PlayerB_ID),
    new XAttribute("PlayerBName", evt.PlayerB_Name)
    if (finished)
    Add(new XElement("Result",
    new XAttribute("PlayerAScore", evt.PlayerA_Score),
    new XAttribute("PlayerBScore", evt.PlayerB_Score))
    var markets = from market in evt.Markets.Values
    select new XElement("Market",
    new XAttribute("ID", market.ID),
    new XAttribute("Description", market.Description),
    finished ? new XAttribute("WinningSelectionIDs", market.WinningSelectionIDs) : null,
    from selection in market.Selections.Values
    select new XElement("Selection",
    new XAttribute("ID", selection.ID),
    new XAttribute("Description", selection.Description),
    new XAttribute("OddsDecimal", selection.Odds)
    Add(markets);
    What I would like to know is how can I filter market.ID to only add the ID's that I want (for example XXX) in this bit:
    var markets = from market in evt.Markets.Values
    select new XElement("Market",
    new XAttribute("ID", market.ID),
    new XAttribute("Description", market.Description),
    finished ? new XAttribute("WinningSelectionIDs", market.WinningSelectionIDs) : null,
    from selection in market.Selections.Values
    select new XElement("Selection",
    new XAttribute("ID", selection.ID),
    new XAttribute("Description", selection.Description),
    new XAttribute("OddsDecimal", selection.Odds)
    Add(markets);
    I have tried adding it a few different ways and was unsuccessful, not sure if it was my syntax
    If I do this for example 
    var markets = from market in evt.Markets.Values
    where market.ID = "xxx"
    select new XElement("Market",
    I get an error 
    Error 108
    Cannot implicitly convert type 'string' to 'bool'. But ID is a string
    I would also like to filter by multiple ID's for exampe XXX, YYY, ZZZ
    I am not sure if I should be using a "where" or if  I should rather be using an if statement or something?
    Thanks in Advance

    Okay, here is an example, but I can not change the structure at all, its an existing data feed which is used by other parties and changing the structure is out of the question 
    <Market ID="CS" Description="Correct Score">
    <Selection ID="7-0" Description="7-0" OddsDecimal="14"/>
    <Selection ID="7-1" Description="7-1" OddsDecimal="14.25"/>
    <Selection ID="7-2" Description="7-2" OddsDecimal="14.11"/>
    <Selection ID="7-3" Description="7-3" OddsDecimal="14.18"/>
    <Selection ID="7-4" Description="7-4" OddsDecimal="14.25"/>
    <Selection ID="7-5" Description="7-5" OddsDecimal="14.04"/>
    <Selection ID="8-6" Description="8-6" OddsDecimal="15.1"/>
    <Selection ID="9-7" Description="9-7" OddsDecimal="14.25"/>
    <Selection ID="0-7" Description="0-7" OddsDecimal="14.21"/>
    <Selection ID="1-7" Description="1-7" OddsDecimal="14.04"/>
    <Selection ID="2-7" Description="2-7" OddsDecimal="14.23"/>
    <Selection ID="3-7" Description="3-7" OddsDecimal="14.01"/>
    <Selection ID="4-7" Description="4-7" OddsDecimal="13.95"/>
    <Selection ID="5-7" Description="5-7" OddsDecimal="14.06"/>
    <Selection ID="6-8" Description="6-8" OddsDecimal="14.01"/>
    <Selection ID="7-9" Description="7-9" OddsDecimal="15.29"/>
    </Market>

  • HTML emails not rendering properly - letters bunched up

    Weirdest thing happening in the last few days.... Most of the HTML emails I receive have not been rendering properly within Mail - the letters appear all bunched up in strange little groups... This only started about a week and a half ago....
    Anyone else seen this phenomenon? If so, is there an easy way to fix it, as it is quite annoying?

    Upon further investigation i figured out what was wrong.
    This property :
    bulletText .fontWeight = "bold";
    was causing my text to not render because bold character weren't used within the symbol associated with the class. By removing that and cleaning up the code a bit ,
    var span : Object = new Object(); 
    span.fontSize = 12; 
    span.color = "#336699";
    css = new StyleSheet();
    css.setStyle( ".bulletText", span );
    sectionText.styleSheet = css;           
    sectionText.htmlText = contentText;
    it rendered semi correctly , except with erronious line breaks , the solution for that was to , remove any instances of "/n" from the contentText string before setting the sectionText , done like this :
    var pattern : RegExp = /\n/g;
    contentText = contentText.replace( pattern , "" );
    now it looks great !

Maybe you are looking for