change the Boolean variable on the stage
Hello! This is my first post here! so I've been playing for a while with the Adobe Edge animate for a while and it's pretty cool and I am trying to create a super basic layout with a video loop, and when the user press the button, the video plays until ongoing and then starts a new. the button it simply changes the variable state of false to true, pretty simple, but for some reason, it does not. I'm an artist, so I don't know much about code in addition to if/else haha
Here is the code on the stage (it is put on the CompositionReady):
var loop1 = sym.$("loop")[0]; var nextLoop = new Boolean(); console.log(nextLoop); //false loop1.onended = function(e){ if (nextLoop == true){ // Show an element sym.$("loop2").show(); // Play a video track sym.$("loop2")[0].play(); } else{ loop1.play() } };
and here is the code for the button:
sym.getSymbol("next_btn").play(); //fade out //change nextLoop state sym.getComposition().getStage().nextLoop = true;
I'm pretty sure it's a syntax error, but I don't really know how to fix it
any ideas?
Thanks in advance!
Hi rbencz
You will need to create a global variable so that it works properly, I commented on 2 lines I added:
sym.setVariable ("nextLoop", false); Create a new global variable called 'nextLoop' and set the value to false
loop1 var = sym.$("loop") [0];
loop1.onended = {Function
nextLoop = sym.getComposition () .getStage () .getVariable ("nextLoop"); Get the Global Variable and assign a local variable
If (nextLoop == true) {}
Display an item
SYM.$("loop2"). Show();
A video track
SYM.$("loop2") [0]. Play();
} else {}
loop1. Play()
}
};
And then the button, place the following code:
sym.getComposition () .getStage () .setVariable ("nextLoop", true); Change the value of the variable global "nextLoop" true
Tags: Edge Animate
Similar Questions
-
How to change the stage width and height at run time?
stage.stageWidth = 700;
but it doesn't work.
Thank you
You must also change your html code. That is to say use externalinterface and javascript.
-
How to change the privileges of NDP to default to a custom
Hi all
I changed the stage name of the NDP by using the extension of functionality and of all the stage name well reflected in these scene 5 UI
But the State of the project not in sync with the new stage name, that they are still the default.
But I want to change the default state as
Stage1-Pre-prerequisite
Sateg2 - Concept of Qualification
a new name
Please let me how can know I change this?
Hello
I changed it to database and its works well. Thank you
-
PROBLEM changing the value of a variable in my scene movieclip
Hello
I have a problem changing the value of a variable in my scene movieclip. I explain: I combobox on my stage containing the categories, and in the scene that I load an xml file containing links to php files that work with the combobox control.
On the stage I have a movieclip "camera roll" inside this movieclip on the first image I have a php script file selected in the scene of loading. I use a function with a variable load() "theUrl" inside like this: T.load (theUrl);
In my scene, I want to change the value of "theUrl" within the film of movieClip. I tried filmstrip.theUrl = url; But it does not workthe xml file <?xml version="1.0" encoding="ISO-8859-1"?> <slideshow> <area title1="10 Last updated" link1="link1.php"/> <area title1="special" link1="link2.php"/> </slideshow>
Here is the code on my stage:
var link1:Array = new Array(); var LINK:String; var url:String; var whoOn:Number; whoOn=0; var x:XML = new XML(); x.ignoreWhite = true; x.onLoad = function(success) { var photos:Array = this.firstChild.childNodes; for (i=0; i<photos.length; i++) { _root.link1.push(photos[i].attributes.link1); } url=link1[whoOn]; filmstrip.theUrl=url;//<<--HERE }; x.load("category.xml"); var cbListener:Object = new Object(); cbListener.change = function(event_obj:Object) { trace(select.selectedItem.label); if (select.selectedItem.label == "Last updated") { whoOn=0; } else if (select.selectedItem.label == "Special") { whoOn=1; } url=link1[whoOn]; filmstrip.theUrl=url; //<<-----HERE }; select.addEventListener("change",cbListener);
Here is the code inside the clip "film".
var T:XML = new XML(); T.ignoreWhite = true; T.onLoad = function(xml) { etc etc etc } T.load(theUrl); //<<---HERE it still undefined
the code on the timeline of the film should be placed in a function() (or better, move all your code to the main timeline). but, if you leave the code on the timeline of the film strip, call the function that contains this code whenever the url changes.
-
How to change the Boolean flag rectangle into 2 triangles.
The notation for a valve is two triangles whose ends are touching. I want to show images of the valve as indicators Boolean - red = closed and green = open. Is it possible to change the standard indicators normally rectangular or circular shape to match the double triangle. I know you can get this result using the triangular shapes and blocking part of the rectangular Boolean value which does not resemble the double triangle shape. I don't want that since I find it difficult to group the shapes.
You have controls and indicators already available in the similar DSC Toolkit.
Or a solution, you can try is to use custom controls, check your two images in software such as paint.
Select the control that you want to customize (in you case a Boolean value) and with the right click make Type Def then Open Type def.
Copy your image to that of the State in the Clipboard, and then select the picture to import from the Clipboard and the State associated with your image in the right click menu
Do the same again for the other State.
You can also find more information about the controls customized using LabView
I hope that answers your question
-
Change the order of the variable by number
Working in 2013 Teststand on equipment that is shared by several developers. It seems that something has changed with the way in which the variables are classified in the Variables pane, but cannot identify how to change back, or who may have changed.
I have a list of FileGlobals which are numbered sequentially, (Test0, Test1, Test2, etc.). Previously, they have been displayed in the pane in the same sequential order. Now, the variables are classified based on the first digit (Test0, Test100, Test10, Test11... Test18 Test19, Test1, Test20...). It is more difficult to go through the list in the order during debugging, especially since there are more than 100 of them. Any ideas of how this could have been changed and how to change it back? Thank you.
GSinMN
Not sure if it of right or not, but at the top of your variable component for each column, you can click on the column header. It will change the order. There are 3 modes. If an arrow appears that means that the column is sorted from A to Z. If an arrow appears it means that the column is sorted Z.-a. If you do not see an arrow, it means that the column is sorted according to the index in which the variable exists in the file. You can click on the column heading to change to each mode.
Hope this helps,
-
Can I change the values of the variables in the variables view control?
I want to use the variables view control in Labview. I see only the values, but I can't change the values or create new Variables. Will there be a chance to do?
I use Labview 8.6.1 and Teststand 4.1.1.You must activate the edit mode for the ApplicationMgr, by setting ApplicationMgr.IsEditor to true. Note that you must have at least the license of the custom editor for teststand so that it works (otherwise it will prompt the user to activate a license with these privileges).
Hope this helps,
-Doug
-
How to change the number of items in number to Boolean, function VI table
Hi, I'm working on using the digital output of data acquisition to control the digital input of a DAC, and I used the Number function in Boolean table. VI to convert the number to a Boolean array. The maximum number is 4096, so it must be composed of 12 elements.
For the description of the VI, it is said that Boolean matrix returns a table of 8, 16, 32 or 64 elements, according to the number of bytes in the whole. Therefore, I change the number of channels in the task to 16, but it still does not work. The suggesitions are greatly appreciated.
Thank you!
Possible reasons:
Scripture cannot be performed because the number of data channels does not match number of channels in the task.
When writing, provide data for all channels in the task. You can also change the task so that it contains the same number of channels as the written data.
Number of job channels: 12
Number of data channels : 32Task name: _unnamedTask<1B>
Once you have the array of Boolean, you can resize using table tools. For example you can use the "new range" with a length of 12 to pad the table of 12 elements of Boolean values (you can also use a subset of table).
1B> -
Change the target of the library Variable shared by program
I have a project in real time with the code that runs on a host PC and a cRIO who communicate using a library of shared on the cRIO variables. I am hosting the variables on the cRIO because who has worked much better than the accommodation on the host PC. For normal operation, this structure works perfectly.
However, I'm now trying to implement a system that will allow the user to choose if they want to actually run the code on the cRIO or run a simulated system. The simulated system would occur on the host PC, so it is logical for this application for variables to be located on the host PC.
To account for these two cases, I would change the target of the variable shared library depending on whether the real-time system is running or if the simuation is executed. I can do easily manually simply by dragging the library in the Project Explorer, but prefer to automate this process.
In short, I try to develop a code that will change the target of a shared library of variable.
I tried to do that by opening a reference to the project file, using the properties to get the library reference and change the target. However, the target property is read-only. Is there another way to do this or I'm stuck having to do it manually?
It turns out that I had a version of the shared library Variable on the cRIO, so even when I welcomed the variables shared on the host PC, he always wrote in the cRIO. In fixing this issue, I have been able to accommodate the library on the host PC and get all what to run much more simply.
-
change the variables in a smart camera by a remote computer
Hello
I have a smart camera NI1722 and I want to change some variables inside the camera by a computer which is connected to the camera.
Is it possible to change the variables inside the camera from a computer outside? On the computer we program with CVI. We have a RS232 and TCP/IP connection.
Anybody can help us?
Thank you
Oliver
Hi Oliver,.
You use a LabVIEW or Vision Builder AI program the smart camera?
There are several ways to Exchange data between a smart camera and CVI on the host computer.
The easiest way is probably to use shared variables.
If you use LabVIEW to program the smart camera, the following article explains how to create and deploy shared on the target variables.
http://zone.NI.com/DevZone/CDA/tut/p/ID/4679
If you use Vision Builder AI, first connect to the smart camera, then select Tools > Variable Manager...
Select the tag System Variables, and then click Add to create the variable for the data you want to share. Be sure to select publish it on the network box.
You can set the value of these variables in Vision Builder, using the step set the Variable, located in the tools palette.
And a lot of steps allow for use directly in their configuration page, clicking the arrow to the bottom of some digital controls.
Now, on the side of the CVI, this example shows how to connect, read and write variables that you created on the smart camera.
https://decibel.NI.com/content/docs/doc-3806
I hope this helps.
Best regards
-Christophe
-
How to change the text Boolean unique element of clusters...
Dear Sir.
I need to change every single Boolean text element cluster programatially and here attached to my example of program it will change only the text lable, but I need to change the text Boolean cluter element .it posssible or not.
Your program is not attached.
What you need to do is right-click on the property node create on that and something specific to change.
-
Hi Sir,
I created a 4-page tab control. How is it possible to change the 1 tab to Page 2 and page 3 page, etc. by using a Boolean control?
Thank you vey much Mr. It worked
-
new to labview :-) and I have a problem when I want to change the value of a string in bunches, and I want to implement this using the node value of property instead of writing directly to the stream or by using the variable, enclosed is the picture. No matter, I have change in cluster (control) or value of Popery out (indicator) cluster, the value (sensor 7) dataflow keeps unchanged even I gave the new value by value of property node. Thank you to give me some advice about this.
Hi GerdW
Thanks a lot for your answer. The reason I'm stubbornly tring to break the flow of DATA is: we have a test system that have about 100 screws, they have a few connected flow, some of them will be unbundling a cluster dataflow chain to check the value in order to make the different cases. Now I want to insert user event by changing the control and influential cases during run time.
As I initially uses a global variable (to control cases) instead of unbundle string data flow, it works well. But then, I found there are a lot of screws that are using the string unbundle. One of the 'lazy' means, I tried is to change the value via the property node (because that way, I did not need to find all the places where using the unbundle string and replace them with the global variable), then I noticed a problem with "dataflow", the value in the stream of cluster in fact will not be changed by changing the value of the property node.
I did a test with VI simple (like the picture in last post), and after reading your advice, I tell myself that I need to understand the concept of "DATAFLOW" in labview, it seems that my "lazy" way can not work in this scenario.
I have attached the criterion VI here, have you furthur suggestions on what I can do in this case?
Mant thanks!
Minyi
-
How to change the color of the text only Boolean button cluster
Hi you
I try to change the text color of the Boolean button programmatically to custer. not that paticular button click right property node method bcaz of I batch button in cluster.here I have attached my sample program it will change some text color of the particular button only.
I managed to do work by defining the opaque background color.
-
Change the value of a Boolean switch rocker during execution
Hello world
Is it possible to change the value of a switch to toggle Boolean during execution?
I make a program where the user can switch a relay switch. However, I want the program to replace the user input if a measured value exceeds a predefined threshold.
The program below did almost what I want. The major problem is that it if the measured value returns below the threshold, the relay will be awarded if the switch is set to 'true '.
I would be very grateful for any suggestions to solve this problem!
Regards, Martin
Hi Martin & Asad,
Well, the problem is even more easy to solve
After cleaning example of Asad, remove this RubeGoldberg, put in some wait States and make a correct stop button I put in place the example...
Maybe you are looking for
-
FDC error at startup on my 400cs
Hello can help hereI have a 400cs and I lost my drive AEverything was going well until I tried to install a CD playerThe CD player was not recognized in the bios or back Windows, so I reinstalled windows 95 using diskettesEverything is OK until finis
-
Error message "A problem with the cooling system" on Satellite A660
Hi all Hope I can get help here. I got about 5 laptop computers HP after each of them had problems and errors. I got sick of them and so got a refund and bought a high spec A660-1FH. The A660 is a great laptop for two days until yesterday when I star
-
ProBook 6545b: where can I find a replacement battery?
I need to buy another battery of the BIOS, but can't find it on the HP website. Any ideas? Thank you. Jeff W
-
OS Vista sp 2 IE 8 I just changed my password, log and I can remember? Help!
-
Problem to generate a library with the JDE plugin for Eclipse
Hello world I created a new library project in my workspace. I used the JDE plugin for Eclipse create this project (New-> other-> BlackBerry project) but when I build my project, I receive a generated .class file, there is no file .jar and .cod gener