Repeat code

Hello.  So I have this code that loads an xml file

var urlRequest:URLRequest = new URLRequest("pics.xml");
var urlLoader:URLLoader = new URLLoader();
var xml:XML;
var xmlList:XMLList;urlLoader.load(urlRequest);
urlLoader.addEventListener(Event.COMPLETE,urlLoaded);

function urlLoaded(event:Event):void {
     xml = XML(event.target.data);
     xmlList = xml.children();
     trace(xmlList.length());
     for (var i:int=0; i<xmlList.length(); i++) {
          var thumb:Thumbnail = new Thumbnail(xmlList[i].url);
          arrayThumb.push(thumb);
          arrayThumb[i].y = 67.5;
          arrayThumb[i].x = i*100+55;
          photoContainer.addChild(thumb);
     }
}

I want to have several buttons however charge a different xml file, not only use a single file.  Would this mean I have to recreate the above code for each button, or is anyway that I could reuse?

see you soon

use:

var xml:XML;

var xmlList:XMLList

function loadXML(xmlS:String):void{var urlRequest:URLRequest = new URLRequest(xmlS);var urlLoader:URLLoader = new URLLoader();urlLoader.load(urlRequest);urlLoader.addEventListener(Event.COMPLETE,urlLoaded);}

 function urlLoaded(event:Event):void {     xml = XML(event.target.data);     xmlList = xml.children();     trace(xmlList.length());     for (var i:int=0; i

Tags: Adobe Animate

Similar Questions

  • Repeat code or what?

    Here's my problem, I made a gallery using an on-line tutorial and it works in treating the xml file. What I want to do is to repeat this code on a different image, but referencing a different xml - so receive different images. I tried just copy - paste it but of course it did not work.

    I tried to separated variable string in which I will put the name of my xml file, then from the Gallery code, I reference just this variable. But it does not work either. It's like when the code runs once it won't run more although even its tru "spread" several images, not copied on different keyframes.

    Is there an easy way to do what im triing to do?

    The Gallery code:

    Import fl.controls.ProgressBar;

    Import fl.transitions.Tween;

    Fl.transitions.easing import. *;

    Import fl.transitions.TweenEvent;

    columns: number var;

    var my_x:Number;

    var my_y:Number;

    var my_thumb_width:Number;

    var my_thumb_height:Number;

    var my_images:XMLList;

    var my_total:Number;

    var container_mc:MovieClip;

    var preloaders_mc:MovieClip;

    var full_mc:MovieClip;

    var x_counter:Number = 0;

    var y_counter:Number = 0;

    var my_tweens:Array = [];

    var container_mc_tween:Tween;

    var full_tween:Tween;

    var myXMLLoader:URLLoader = new URLLoader();

    myXMLLoader.load (new URLRequest (xml));

    myXMLLoader.addEventListener (Event.COMPLETE, processXML);

    function processXML(e:Event):void {}

    var myXML:XML = new XML (e.target.data);

    columns = myXML.@COLUMNS;

    my_x = myXML.@XPOSITION;

    my_y = myXML.@YPOSITION;

    my_thumb_width = myXML.@WIDTH;

    my_thumb_height = myXML.@HEIGHT;

    my_images = myXML.IMAGE;

    my_total = my_images.length ();

    createContainer();

    callThumbs();

    myXMLLoader.removeEventListener (Event.COMPLETE, processXML);

    myXMLLoader = null;

    }

    function createContainer (): void {}

    container_mc = new MovieClip();

    container_mc.x = my_x;

    container_mc.y = my_y;

    addChild (container_mc);

    container_mc.addEventListener (MouseEvent.CLICK, callFull);

    container_mc.addEventListener (MouseEvent.MOUSE_OVER, onOver);

    container_mc.addEventListener (MouseEvent.MOUSE_OUT, procedure);

    container_mc.buttonMode = true;

    preloaders_mc = new MovieClip();

    preloaders_mc.x = container_mc.x;

    preloaders_mc.y = container_mc.y;

    addChild (preloaders_mc);

    }

    function callThumbs (): void {}

    for (var i: Number = 0; i < my_total; i ++) {}

    var thumb_url = my_images[i].@THUMB;

    var thumb_loader = new Loader();

    thumb_loader. Load (new URLRequest (thumb_url));

    thumb_loader.contentLoaderInfo.addEventListener (Event.COMPLETE, thumbLoaded);

    thumb_loader. Name = i;

    thumb_loader.x = (my_thumb_width + 10) * x_counter;

    thumb_loader.y = (my_thumb_height + 10) * y_counter;

    If (x_counter + 1 < columns) {}

    x_counter ++;

    } else {}

    x_counter = 0;

    y_counter ++;

    }

    var preloader_pb:ProgressBar = new ProgressBar();

    preloader_pb.source = thumb_loader.contentLoaderInfo;

    preloader_pb.x = thumb_loader.x;

    preloader_pb.y = thumb_loader.y;

    preloader_pb. Width = my_thumb_width;

    preloader_pb. Height = my_thumb_height;

    preloaders_mc. AddChild (preloader_pb);

    preloader_pb.addEventListener (Event.COMPLETE, donePb);

    }

    }

    function thumbLoaded(e:Event):void {}

    var my_thumb:Loader = Loader (e.target.loader);

    container_mc. AddChild (my_thumb);

    my_tweens [Number (my_thumb. (Name)] = new Tween (Strong.easeIn, 0,1,0.5, my_thumb, "alpha", true);

    my_thumb.contentLoaderInfo.removeEventListener (Event.COMPLETE, thumbLoaded);

    }

    function callFull(e:MouseEvent):void {}

    var full_loader:Loader = new Loader();

    var full_url = my_images[e.target.name].@FULL;

    full_loader. Load (new URLRequest (full_url));

    full_loader.contentLoaderInfo.addEventListener (Event.INIT, fullLoaded);

    var full_pb:ProgressBar = new ProgressBar();

    full_pb.source = full_loader.contentLoaderInfo;

    full_pb.x = (stage.stageWidth - full_pb.width) / 2;

    full_pb.y = (stage.stageHeight - full_pb.height) / 2;

    preloaders_mc. AddChild (full_pb);

    full_pb.addEventListener (Event.COMPLETE, donePb);

    container_mc. RemoveEventListener (MouseEvent.CLICK, callFull);

    container_mc.buttonMode = false;

    container_mc. RemoveEventListener (MouseEvent.MOUSE_OVER, onOver);

    container_mc. RemoveEventListener (MouseEvent.MOUSE_OUT, procedure);

    container_mc_tween = new Tween (container_mc, "alpha", Strong.easeIn, 1,0.5,0.5, true);

    }

    function fullLoaded(e:Event):void {}

    full_mc = new MovieClip();

    full_mc.buttonMode = true;

    addChild (full_mc);

    var my_loader:Loader = Loader (e.target.loader);

    full_mc. AddChild (my_loader);

    full_tween = new Tween (Strong.easeIn, 0,1,0.5, my_loader, "alpha", true);

    my_loader.x = (stage.stageWidth - my_loader.width) / 2;

    my_loader.y = (stage.stageHeight - my_loader.height) / 2;

    my_loader.addEventListener (MouseEvent.Click, removeFull);

    my_loader.contentLoaderInfo.removeEventListener (Event.COMPLETE, fullLoaded);

    }

    function removeFull(e:MouseEvent):void {}

    var my_loader:Loader = Loader (e.currentTarget);

    full_tween = new Tween (Strong.easeOut, 1,0,0.5, my_loader, "alpha", true);

    full_tween.addEventListener (TweenEvent.MOTION_FINISH, tweenFinished);

    container_mc_tween = new Tween (container_mc, "alpha", Strong.easeOut, 0.5,1,0.5, true);

    }

    function donePb(e:Event):void {}

    var my_pb:ProgressBar = ProgressBar (e.target);

    preloaders_mc.removeChild (my_pb);

    my_pb. RemoveEventListener (Event.COMPLETE, donePb);

    }

    function tweenFinished(e:TweenEvent):void {}

    var my_loader:Loader = Loader (e.target.obj);

    my_loader. Unload();

    full_mc.removeChild (my_loader); / / This line was removeChid (my_loader), simply add full_mc in front of him.

    removeChild (full_mc);

    full_mc = null;

    container_mc.addEventListener (MouseEvent.CLICK, callFull);

    container_mc.buttonMode = true;

    container_mc.addEventListener (MouseEvent.MOUSE_OVER, onOver);

    container_mc.addEventListener (MouseEvent.MOUSE_OUT, procedure);

    var my_tween:Tween = Tween (e.target);

    my_tween. RemoveEventListener (TweenEvent.MOTION_FINISH, tweenFinished);

    }

    function onOver(e:MouseEvent):void {}

    var my_thumb:Loader = Loader (e.target);

    my_thumb.Alpha = 0.5;

    }

    function onOut(e:MouseEvent):void {}

    var my_thumb:Loader = Loader (e.target);

    my_thumb.Alpha = 1;

    }

    Code Gallery of buttons:

    G1.addEventListener (MouseEvent.CLICK, g1g);

    function g1g(event:MouseEvent):void {}

    removeChild (container_mc)

    }

    G1.addEventListener (MouseEvent.CLICK, gg1);

    function gg1(event:MouseEvent):void {}

    gotoAndPlay (108)

    }

    G2.addEventListener (MouseEvent.CLICK, gg2);

    function gg2(event:MouseEvent):void {}

    removeChild (container_mc)

    }

    G2.addEventListener (MouseEvent.CLICK, g2g);

    function g2g(event:MouseEvent):void {}

    gotoAndPlay (109)

    }

    G3.addEventListener (MouseEvent.CLICK, gg3);

    function gg3(event:MouseEvent):void {}

    removeChild (container_mc)

    }

    G3.addEventListener (MouseEvent.CLICK, g3g);

    function g3g(event:MouseEvent):void {}

    gotoAndPlay (110)

    }

    G4.addEventListener (MouseEvent.CLICK, gg4);

    function gg4(event:MouseEvent):void {}

    removeChild (container_mc)

    }

    G4.addEventListener (MouseEvent.CLICK, g4g);

    function g4g(event:MouseEvent):void {}

    gotoAndPlay (111)

    }

    G5.addEventListener (MouseEvent.CLICK, gg5);

    function gg5(event:MouseEvent):void {}

    removeChild (container_mc)

    }

    G5.addEventListener (MouseEvent.CLICK, g5g);

    function g5g(event:MouseEvent):void {}

    gotoAndPlay (112)

    }

    Now, we just need to create an interface through which we pass the XML URL for each gallery. Look for this piece of code in your gallery:

    var myXMLLoader:URLLoader = new URLLoader();
    myXMLLoader.load(new URLRequest(xml));
    myXMLLoader.addEventListener(Event.COMPLETE, processXML);
    

    Replace it with this:

    var myXMLLoader:URLLoader;
    
    function loadGallery(xml:String):void {
         myXMLLoader = new URLLoader();
         myXMLLoader.load(new URLRequest(xml));
         myXMLLoader.addEventListener(Event.COMPLETE, processXML);
    }
    

    In the main timeline to the frame with mc_gallery1, put this code:

    mc_gallery1.loadGallery("http://www.mydomain.com/mygallery.xml"); // whatever url to your XML file
    

    I think, you good to go.

  • How to simplify the code to generate custom error codes and messages

    I designed a vi that generates the error when any data entry is missing, it works correctly, but the problem is that I want to simplify, because it is part of the main program and its block diagram is great to use as such (I tried to use this vi as a Subvi in the main program, but that does not work correctly) so I need help to simplify the code or if there is no other better medium to generate the error message.

    Hello

    As shown in the previous example, to a different question of yours, it is always good to reduce with diagrams of huge block with repeated code.

    When you overwrite functionality even repeated several times, put it in a loop and run it to have recurrences of 4 or 5 of the same code.

    It will be evolving in the future.

    joined the vi changed for you.

    Note: when you want to simplify your program, isolate your code in functions, put each function inside a under vi.

    in your case, you can have the control to an empty string for all channels within a Subvi. build an array of strings and go through the subvi. Control in the sub that VI is that strings are empty.

    an array of Boolean output error. build your error string in another under vi. the wires together.

  • 8E5E0147 error code appears whenever I try to load updates

    There are 4, apparently important microsoft updates which I can't load error repeated, code 8E5E0147. How can this be overcome?

    Hello

    1. have you done any software or hardware changes on your computer before this problem?
    2. What is the number of KB updates that fail to install?

    To work on the issue, refer to these methods.
     
    Method 1:
     
    Run the troubleshooter from the following link.

    The problem with Microsoft Windows Update is not working
     
    See also:
     
    Method 2:
     
    Run the fixit from following link.
     
    I also suggest you to check all services: windows update services, cryptography and Services (BITS) Background Intelligent Transfer Service.

    You can see the article for more information:

    You cannot install some programs or updates
    http://support.Microsoft.com/kb/822798

     
    Method 3:

    If the update fails to install, see the following link.

    Cannot install updates in Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2

    http://support.Microsoft.com/kb/2509997

    Try to reinstall the update.

    Registry warning

    To do: Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    322756 (http://support.microsoft.com/kb/322756/ )

    Back up the registry
    http://Windows.Microsoft.com/en-us/Windows-Vista/back-up-the-registry

    CHKDSK warning:

    Important: Running chkdsk on the drive if bad sectors are found on the disk hard when chkdsk attempts to repair this area if all available on which data can be lost.

    Method 4:
     
    Temporarily disable the antivirus software and check if you are able to install the updates.

    Caution:
    Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.
     

    Hope the information is useful.

  • Menu buttons appears only on my site

    FireFox 4 will not display the Menu buttons on my site (they should be contained in the image on the left of the page)

    FireFox 3.6.
    Internet Exlorer, 8 and 9
    Safari 4 and 5

    The foregoing all display this site correctly

    This page could use some cleanup code. There is an endless sequences with a lot of useless repeating code. It seems that the HTML parser is unable to deal with this code and that it is renouncing sometime. I do not see images in the Source view selection and in tools > Page Info > Media. Shows HTTP headers, it is retrieved from the server.

  • What is the best way to keep the block diagram / cleaning of façade?

    Hello

    I'm relatively new to Labview so I'm not able to say if I'm overloading my programs or make my too crowded block diagram. I was wondering if there was some ways to tell if I can simplify my programming just by looking (perhaps only experience contributes to these things)?

    I enclose my VI here. Currently, she is able to monitor the voltage and current of two engines. On the screen, you can see an indicator with the voltage and current values and there are cards that can display signals of different engines with a menu drop-down.

    The façade is pretty clean, in my opinion of novice, but the block schema seems messy to me, just at the first glance. I foresee a problem occurring in the future however. In the future, I will have the VI to monitor 50 engines globally. All of the programming will be the same as the one I have now, but it will have 50 indicators and unfortunately 50 times just about everything. I would like to avoid this, but I don't know how I did.

    I use a USB-6009. I use its four differential inputs to monitor the voltage and current of the two engines. In the future, I will get more units DAQ (25 in total because 2 motors can be monitored for each data acquisition). The new Renault will help will help with more resource space, but I think things complicate with the added option of 24 more Assistants of data acquisition (as used in my code).

    Thanks for any help you might be able to provide!

    Usually, it is above all the experience that will teach you the best methods for making your code to do pretty. I don't know anyone who is proud of his first application of claws. There are some resources out there to help with best practices, as that group on ni.com, but you will learn most of your own development.

    Your façade is superb. FPs in general really are to you. You can do it as ugly or pretty as you want. When you have a few controls in duplicate and the Group of indicators, you should use clusters and berries to simplify. You can use a bit of cleanup in this regard, but not much. In addition, I personally hate read red text unless it is a warning any.

    Your block diagram could use a little cleaning in a sense of modularity. You have a lot of repeated code, which you might consolidate in to a Subvi, which is used in multiple locations, or in a loop For. A general rule is to keep your block diagram within a single monitor. You should not scroll. Your application is quite simple, so it is difficult to BUMBLE

    Here are a few details on your block diagram:

    • Click with the right button on your devices on the block diagram and uncheck the "display as icon". You are welcome.
    • Operations on each waveform "(x*2-4)" / 16 in double ": create a Subvi and/or run the waveforms through a loop."
    • You do a lot of 2-element arrays and then indexing. Just replace the ones that have a Select node based on digital.
    • All your code runs every time, including the knots of your property at the bottom, which is not necessary. As you learn LabVIEW architectures, you will learn how to get around this with the initialization and the output of code, but for now, you should put a case around those structure for only when the engine numbers change.
    • I don't know how you're timing your main loop, but you should put a delay in there because you don't need the DAQmx node shoot as fast as your CPU will allow.

    There are videos of intro free that you can watch to learn what OR think in terms of coding and teach you some of the basic features and such. Here's a three-hour course, and here's a six-hour course.

  • myRIO Brightness LED

    Hi all

    I did a way to control not only the brightness of the embedded myRIO LEDs, but their brightness using PWM and control.

    I have attached the FPGA VI for the myRIO-it may need to be compiled.

    Suggestions are welcome!

    I think your VI could be considerably simplified! I suppose that it was an exercise for you and you are looking for some comments?

    (1) you can delete local variables (using FPGA fabric) and just the brightness adjustment of thread to Wait (uSec) directly - plug the wire in each of them.

    (2) having a button 'stop' on the FPGA code really makes no sense... you can always code to continue to operate... otherwise you would need to reset the FPGA (which is in contrast with the programming in windows where you still want to stop the loop gracefully rather than abandoning it--don't forget not what a FPGA essentially an electronic circuit when compiling)

    (3) why you have additional sequences with an expectation of 1uSec to? You might just have ' turn on '-> 'wait'-> 'disable'-> 'wait '.

    (4) having 4 loops for the variation of some LEDs seems unnecessarily repeated code... If you wanted to get really smart I don't know that you could simplify the code down to a single loop!

  • Problem led to keep

    Hello

    I'm on it, I'm like 2 months when I started learning on my own account, by now, I create a software in Labview to move 3 engines, just that I had a problem, I tried using 2 round LEDs for each axis (a when the engine is moving in the positive direction) and the other on the negative.

    So I have like 6 LEDs, now, the real problem started when I need to keep the LEDs on, I mean for example I push on the positive X the light and in a few milliseconds, it turns off. But what I need, is that if I press a button the corresponding LED should keep on until I pushed the other.

    I added the part of the game when I try to add this feature, can hope someone can explain to me a little or even help me to what I do.

    Thanks for any help

    Your query is really a matter of LabVIEW and would get more response if validated for the jury of LabVIEW. It is not a matter of circuit design and this advice gets much less activity than the LV Board.

    The key is the shift register to keep the values of one iteration to another.

    You will need a change of register for each LED. If you don't want 6 registers at offset, you could combine the data in a table or a cluster so that a shift register would be sufficient. Since you are a beginner with LabVIEW, I suggest that the separate passage records until you are more comfortable with LV

    Since the two entries (buttons) and outputs (LEDs) are boolean, it makes sense to keep the data as boolean overall.

    The labels on the block diagram display makes it much easier to keep track of what terminal is connected to what button or LED.

    Connecting to the switch case structure you should use integer data types rather than floats. In your VI it does not matter, but if you were to calculate the result with a division or other functions round forced to integers internally in the structure of the case could cause problems.

    Consider the use of the Structure of the event to meet the changes in the buttons. According to me, which was introduced to LV before your version 7.1.

    Here's a way to do what I think you want. I post a picture because I can't save in version 7.1. Note that I suggest do a Subvi repeated code. By making a Subvi, you just change it one place if you find a bug, or changing requirements. The code has 6 copies, which would need to be changed.  I did not remove your code so that I can compare the results.

    Lynn

  • 1021: duplicate function definition.

    Well, I'm trying to generate a random number and send users to this keyframe in flash but I get errors

    Symbol "WholeFile", layer 'actions', frame 3, line 3-1151: there is a conflict with speed of definition in the internal namespace.

    Symbol "WholeFile", layer 'actions', frame 3, line 4 1021: duplicate function definition.

    on each of the key frames for the random number.

    Here is the code:

    On the main generator

    var top: Number = 13;

    var low: Number = 1;

    var district = (Match.floor (Math.random () *(1+high-low)) + low) m:System.NET.SocketAddress.ToString ();

    if(district == 1)

    {

    gotoAndStop ("district1");

    }

    Another yew (district == 2)

    {

    gotoAndStop ("district2");

    }

    Another yew (district is 3)

    {

    gotoAndStop ("district3");

    }

    Another yew (district is 4)

    {

    gotoAndStop ("district4");

    }

    Another yew (district == 5)

    {

    gotoAndStop ("district5");

    }

    Another yew (district is 6)

    {

    gotoAndStop ("district6");

    }

    Another yew (district is 7)

    {

    gotoAndStop ("district7");

    }

    Another yew (district is 8)

    {

    gotoAndStop ("district8");

    }

    Another yew (district is 9)

    {

    gotoAndStop ("district9");

    }

    Another yew (district is 10)

    {

    gotoAndStop ("district10");

    }

    Another yew (district is 11)

    {

    gotoAndStop ("district11");

    }

    Another yew (district is 12)

    {

    gotoAndStop ("district12");

    }

    ElseIf (District == 13)

    {

    gotoAndStop ("capitol");

    }

    on the chassis number generated

    Fl.transitions import. *;

    Fl.transitions.easing import. *;

    var speed: number = 3;

    function comeToMe(event:MouseEvent) {}

    var obj:Object = event.target;

    var tweenX:Tween = new Tween (plyr, 'x', None.easeNone, plyr.x, obj.x, speed, true);

    var tweenY:Tween = new Tween (plyr, "y", None.easeNone, plyr.y, obj.y, speed, true);

    addEventListener (Event.ENTER_FRAME, loopFunction);

    var obj_clip:MovieClip = obj as MovieClip;

    function loopFunction(event:Event):void {}

    {if (plyr.hitTestObject (obj_clip))}

    status_txt. Text = "Welcome" + obj_clip.name + "have fun!";

    tweenX.stop ();

    tweenY.stop ();

    removeEventListener (Event.ENTER_FRAME, loopFunction);

    }

    }

    }

    bank.addEventListener (MouseEvent.CLICK, comeToMe);

    home.addEventListener (MouseEvent.CLICK, comeToMe);

    business.addEventListener (MouseEvent.CLICK, comeToMe);

    Please help and tell me what's wrong with my code!

    Repeating code in different settings?

  • I need gray on the field at 2 locations?

    Hello

    I have page 1 and page 3 of my_form. Page 1 a field with legend 'COUNTRIES', Page3 also has the same field (legend is the NAME of THE COUNTRY) and BINDed with the same data source, as well as the NAME is the same in the BINDING tab, in the two fields NAME is UR_COUNTRY in the BINDING tab, very well.

    Must be gray outside (2 locations, its Page 1 and Page 3) and thusReadOnly, so I'm wrung the Java Script in the docReady of my_form below event

    my_form. Page1.address.country.access = "readOnly".

    xfa.resolveNode "(my_form. ("Page1.Address.Country.UI. #textEdit.Border.Fill.Color ') .value = '192,192,192."

    His aging out in the COUNTRY field, but NOT greyinh Page1 pages 3 NAME of THE COUNTRY field. don't know why?

    Pls let me know how can I do WITH THE redenncy code (code redenency does not accept against them standards here)?  I don't want to repeat code new Page3 NAME field of initialization event of the COUNTRY

    Thank you

    Hello

    In your script, you are only referencing the object on page 1. If you also want to change the appearance of the object on page 3, then you need duplicate lines and specifically refer to this object.

    In addition, you can make the script a little skinny/generic fill color:

    COUNTRY.ui.oneOfChild.border.fill.color.value = "192,192,192";
    

    Hope that helps,

    Niall

  • Use of the model, but not on all pages

    Hello - new user DW CS5.   I have a built site where I created my first page with banner, header, footer menu sidebar graphic using the DIVs.  There is a #content box (editable) where my variable text/graphics to send in.  I then turned this skeleton in a backup model and built the rest of the pages out of the model.  I can't believe how easy it was and it works.

    But how to establish a "selective model area.  What does this mean?  OK, I have a subsection (who are we) where we give a little bio and photo on the staff members each on their own sub-sub-page.  This DIV I need to define an area of model where I provide links to the other members of the staff member - < a href... >, but I don't want this box on every page of the site, just the subpages describing members of the staff.  Of course - I could copy and paste from one page to many but I know good design, you do not want to enter in repeat code this way because it's 'dirty' and difficult to follow in the future.  In my studies, I ran across this so I know to avoid.

    And so, because I have little training, I'll ask if anyone has a couple of pointers to allow this kind of behavior - have a text/chart area (model?) that may apply to the selective pages I want?

    Thank you.

    Hoib

    Please do!

  • How to make repeated calls to the reader in the AcqVoltageSamples_IntClkAnalogRef code sample.

    I want to make repeated calls to the reader in the AcqVoltageSamples_IntClkAnalogRef code sample.  A comment in the code says I can do simply by calling the reader. BeginReadMultiSample method of the callback function. I tried this without success using the same settings for the player. Is it possible for the callback function? If Yes, how should I call the reader? I'm programming in c#.

    Thank you

    John

    Doug,

    No problem.  I found the class to which the timeout without much property in safely.  I now have a solution to repeated calls.  The two keys were the infinite time-out setting and the elimination of all the DAQmx objects in the finally section of the callback function before calling the AcquireData() method for the next cycle of reading and processing of data.  The user sets blQuit to false and call AcquireData() by clicking on the Start button.  Repeated calls are then made to 'automatically' until the user clicks the button exit.

    Thanks for your help,

    John

    Private Sub AcquireData()

    This code creates all the objects needed to acquire and store the data of a "sweep."

    {

    slaveTask = new Task();  Double sampleRate = Convert.ToDouble (this.cbxSampleRate.Text);

    Double minVolts = Convert.ToDouble (this.cbxMinVolts.Text);

    Double maxVolts = Convert.ToDouble (this.cbxMaxVolts.Text); int samplesPerChannel = Convert.ToInt32 (this.cbxSamplesPerChannel.Text); slaveTask.AIChannels.CreateVoltageChannel ("Dev1/ai0", "", (AITerminalConfiguration)(-1), minVolts, maxVolts, AIVoltageUnits.Volts);

    Set up sync Specs

    slaveTask.Timing.ConfigureSampleClock ("", sampleRate, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, samplesPerChannel);

    Set up the reference trigger. US fires with a level of 1 volt and will record 2 samples of trigger before (the minimum)

    slaveTask.Triggers.ReferenceTrigger.ConfigureAnalogEdgeTrigger ("APFI0", AnalogEdgeReferenceTriggerSlope.Rising, 1.0, 2);

    slaveTask.Stream.Timeout = - 1;

    slaveTask.WaitUntilDone ();

    Check the task

    slaveTask.Control (TaskAction.Verify); InitializeDataTable (slaveTask.AIChannels, ref dataTable);

    acquisitionDataGrid.DataSource = dataTable;

    Reader = new AnalogMultiChannelReader (slaveTask.Stream); drive. SynchronizeCallbacks = true; drive. BeginReadMultiSample (Convert.ToInt32 (cbxSamplesPerChannel.Text), New AsyncCallback (slaveCallBack), null);

    }

    catch (System.exception DaqException)

    {

    MessageBox.Show (exception. (Message);

    slaveTask.Dispose ();

    }

    }

    private void slaveCallBack (IAsyncResult ar)

    {

    Try

    {

    read data from the channel

    data = reader. EndReadMultiSample (ar);

    dataToDataTable (data, Ref dataTable);

    plot the data here, if blKeep also write it to file

    }

    catch (System.exception DaqException)

    {

    MessageBox.Show (exception. (Message);

    }

    Finally

    {

    This. Refresh();

    slaveTask.Dispose ();

    If (! blQuit)

    {

    AcquireData();

    }

    }

    }

  • My Webcam has problems detected by Skype and repeat myself there is another program that uses the webcam. Skype device code 43 usb video.

    My Webcam has problems detected by Skype and repeat myself there is another program that uses the webcam.

    Also got the guests when using Skype as a video device usb was not detected and that it is a code 43.

    Have tried several way sto resolve this problem. CyberLink YouCam HP's running came preloaded on the laptop. The webcam is running when this program is being used separately.

    Inappropriate Feedback Forum of Windows hardware and drivers Forum.

    My Webcam has problems detected by Skype and repeat myself there is another program that uses the webcam.

    Also got the guests when using Skype as a video device usb was not detected and that it is a code 43.

    Have tried several way sto resolve this problem. CyberLink YouCam HP's running came preloaded on the laptop. The webcam is running when this program is being used separately.

    Inappropriate Feedback Forum of Windows hardware and drivers Forum.

    Hello, Aadi467,

    A device driver has notified the operating system that the device failed.

    Run the diagnostic tool of hardware devices do not work or are not detected in Windows on the Microsoft Fix it Center.

    You can also uninstall the software from Cyberlink.  There is a found here download link to reinstall the software after restarting the computer.

    http://h30434.www3.HP.com/T5/notebook-operating-systems-and/lost-my-CyberLink-and-UCAM/TD-p/760367

  • KB2183416 Windows Update for IE8 repeatedly fails with the error code "WindowsUpdate_8007371C" "WindowsUpdate_dt000"

    KB2183416 Windows Update for IE8 repeatedly fails with the error code "WindowsUpdate_8007371C" "WindowsUpdate_dt000"

    Whenever I run this update, it seems that it installs about 90% of the way but then stops and breaks down about 20 seconds later.  If someone else sees this problem and is at - it a solution?  I'm running Vista Home Premium SP2 and KB2183461 is listed as a critical update for my system.  Help?

    Preliminary stage: If the Tea Timer of Spybot is enabled, please disabled until we finished this thread. Seehttp://aumha.net/viewtopic.php?f=26&t=32409

    Tip: If you don't fully understand what Tea Timer does and how it does, leave it disabled permanently.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    McAfee applications (and Norton) are known for not not upgrade (or uninstall) "clean". If you have McAfee Security Center installed since you bought the computer, he is been updated (automatically) several times. Try the following:

    1. run this triple McAfee fix: http://service.mcafee.com/FAQDocument.aspx?id=TS100507

    2. after reinstallation of McAfee Security Center to step #3 patch triple, manually & repeatedly updated McAfee Security Center until you get one invite "no updates more".

    3. OPTIONAL: If you have had problems with IE8, open IE8 (only) to http://support.microsoft.com/kb/923737 & run the difficulty.

    4. OPTIONAL STEP: Open IE8 (only) to http://support.microsoft.com/kb/971058 & run the difficulty by DEFAULT inside and modes and AGGRESSIVE. [1]

    5 restart and test by launching a manual check of updates & see if KB2183461 now installs. See...

    How will I know if my computer is up to date?
    http://Windows.Microsoft.com/en-us/Windows-Vista/how-can-I-tell-if-my-computer-is-up-to-date

    ~~~~~~~~~~~~~~~~~~~~~~~~
    [1] full Disclosure: the difficulty operating in AGGRESSIVE mode will remove your update history but not list the updates installed in Add/Remove Programs (Windows XP) or updates installed (Vista & Win7).

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Error code: 646 (same updates repeatedly offered)

    code646.This error applies to download Ko Ko 2277947 Ko 2251419 2279264.the downloads keep repeat every day for the last month or two. What should I do? Smiley

    Smiley,

    A KB was created for 646 error code that appears during the installation of the updates of Microsoft Office. The KB includes a TI automatedFix, which corrects the problem. Look at the following KB:http://support.microsoft.com/kb/2258121>

    Please let us know if that helps.

Maybe you are looking for