Cannot be used for the loop variable 'i' twice?
Something weird is happening with a dialog box that I'm doing that dynamically creates buttons based on the number of objects in a table that I pass in a function. I say weird, but it's obviously me not understanding how the variables in a loop. See below:
mrp = { one: [new File("/Users/constantincerdan/Creative%20Cloud%20Files/Templater/Iconbuttons/bagspouches.png"), "One"], two: [new File("file:///Users/constantincerdan/Creative%20Cloud%20Files/Templater/Iconbuttons/beauty.png"), "Two"], three: [new File("file:///Users/constantincerdan/Creative%20Cloud%20Files/Templater/Iconbuttons/bluepocketsquare.png"), "Three"] } function Dialog(dialogTitle, buttons) { var dlg = new Window("dialog", dialogTitle + " - OU"); dlg.margins = [20, 15, 20, 17]; dlg.buttonsGroup = dlg.add("group"); dlg.buttonsGroup.orientation = "row"; dlg.buttonsGroup.spacing = 15; for(var i = 0; i < buttons.length; i++){ templaterButton = dlg.buttonsGroup.add("iconbutton", undefined, buttons[i][0]) templaterButton.onClick = function(){ open(buttons[i][0]) dlg.close() } dlg.buttonsGroup.add("panel", [undefined, undefined, 0,120]) } dlg.show() } Dialog("Test",[mrp.one, mrp.two, mrp.three])
Execution of this poster dialog very well, and all the icon buttons have their own photos as they should (see photo below).
This is what confuses me: line 16, he is able to use I on the buttons [i] [0] very well get every image and use it, but for some reason any when I also try to use the same thing to line 18 to try to open the real images for each button, I get the error "undefined is not an object" on this line. Change key [i] [0] to line 18 to the key [0] [0] opens the first image very well (on three keys), so I can't understand what I'm doing wrong here?
The problem is that the function that executes the dialog box is not a variable that I exist. It is a function that get-called on the fly. One thing you can do is to use 'this' in the service running, so it will point to the iconbutton that you clicked on, unfortunately there is no default property of this button that can point to the actual file, there is only the property "icon" but that only gives the name of the file and not its full path , but you can create a custom property that can point to the path to the file like this:
MRP = {}
a: [new file ("/Users/constantincerdan/Creative%20Cloud % 20Files/Templater/Iconbuttons/bagspouches program. PNG"),"One"],
two: [new file ("file:///Users/constantincerdan/Creative%20Cloud%20Files/Templater/Iconbuttons/beaut y.png"), "Two"],
three: [new file ("file:///Users/constantincerdan/Creative%20Cloud%20Files/Templater/Iconbuttons/bluep ocketsquare.png"), "Three"]
}
function {Dialog (dialogTitle, buttons)
var DLG = new window ("dialog", dialogTitle + "- OR");
DLG. Margins = [20, 15, 20, 17];
dlg.buttonsGroup = dlg.add ('group');
dlg.buttonsGroup.orientation = "row";
dlg.buttonsGroup.spacing = 15;
for (var i = 0; i)< buttons.length;="">
templaterButton = dlg.buttonsGroup.add ("iconbutton", undefined, buttons [i] [0]);
templaterButton.myFile buttons [i] [0] ;// = my custom property
templaterButton.onClick = function() {}
App.Open (this.) MyFile);
Open (this.) MyFile); / / use the property of the selected object
DLG. Close();
}
dlg.buttonsGroup.add ('panel', [undefined, undefined, 0,120])
}
DLG. Show()
}
Dialog box ("Test" [mrp.one, mrp.two, mrp.three])
Tags: Photoshop
Similar Questions
-
All,
version: 12.1.3
I am trying to create a new area where I wanted to use the same scheme used in the existing domain. It failed with the below error
com.oracle.cie.domain.security.external.ConfigSecurityException: oracle.security.opss.tools.lifecycle.LifecycleException: security of the store DB configuration error. Oracle.security.opss.tools.lifecycle.LifecycleException of exception: the SOA12C_OPSS schema is already used for the safety of the point of sale. Please create a new schema.
Is it mandatory that the scheme (creating the UCR) used in a field cannot be used for the new domain? or am I missing something? Please notify.
Thank you
Sen
That's the point... So actually you were never more than one domain using the same patterns, you have never shared patterns on different fields... You had a domain which would sometimes... Not possible in 12 c but because of OPSS more... Maybe you could just the OPSS schema duplicated, but you would always use the platform so that it was not intended to...
-
Movie Maker error: cannot be used because the audio hardware is not found
I am trying to use Movie Maker on my lap top, but get the following error: Windows Movie Maker cannot be used because the required audio hardware cannot be found on your computer.
I don't know what is missing, please help
Hello
· Were there any changes made on the computer before the show?
I suggest you to update the audio driver installed on the computer. You can visit the link below for the procedure: how to manage devices in Windows XP: http://support.microsoft.com/kb/283658
-
Error 907: This connection cannot be used with the VZAccess Manager
original title: error message appear on my screen
I get this error message appear on my screen every two seconds:
"This connection cannot be used with the VZAccess Manager.Error 907 "
Hello
Disable/remove your Verizon Wireless software or contact Verizon for help with this error. Posts like this occur generally when third-party utilities are used to manage connections and issues must be resolved by the Distributor, because they are often specific to that software.
Verizon support suggest that you go in the Options Internet/Control Panel and on the Connections tab, check the option "never establish a connection" is selected.
Good luck, Rick Rogers, aka "Crazy" - Microsoft MVP http://mvp.support.microsoft.com Windows help - www.rickrogers.org
-
"This device cannot be used for readyboost.
Hey guys, as you can see the image below... I bought a new Kingston 8 GB DataTraveler® 101 and I want to ReadyBoost, but it says "this device cannot be used for readyboost"... format of the file system is FAT32...
"ReadyBoost is not activate because the service responsible for ReadyBoost (Sysmain) has been disabled on this computer." An administrator can turn on service Sysmain.' = I can't find Sysmain service. :(Photo: http://s630.photobucket.com/albums/uu29/blackboy123_02/?action=view¤t=Capture.png
I have 4 USB and not everything can use readyboost...
I can't find any solution for this problem... Well, hope that the microsoft team can help. :)Then ready boost will give you NO increase in performance at all.
ReadyBoost is designed for computers with 1 GB or less RAM, who have no possibility to increase...
-
The pp Skycure is interesting to use for the security of the iPhone?
I doubt it. You need some protection when the computer opened and then install and use a VPN. SaturnVPN is effective and inexpensive.
-
What is the MTBF method, used for the cRIO 9012, is the method of counting of Telcordia under what conditions? (Temperature, humidity, etc.)
Hi jojosalud,
According to the specifications for the cRIO-9012, the MTBF is 330 481 hours at 25 ° C; Question of Bellcore level II.
Kind regards
-
The Parental account for my child's account has been disabled for inactivity and to accept the new terms of use for the xbox update must be parental confirmation. I can't do this because even when you type the parental email address in the password recovery, it does not recognize because because it is inactive. I need a Windows Live technician to reactivate the account and I don't know if I should put the email address of the account here for security reasons. My other question is also if you can't reactivate can you switch parental permissions to another account.
-Thanks, MichaelHello
What version of the Windows operating system is installed on your computer?
I suggest you to refer to the following article in the Xbox and check if it helps.
Xbox LIVE connection issues:
http://support.Xbox.com/en-us/billing-and-subscriptions/Windows-Live-ID/Xbox-Live-sign-in
If the steps in the section of the Xbox did not help, then it would be better to post the same question in the Windows Live ID portal and forum Xbox to get help. We have a dedicated team to help you with questions of this type.
Windows Live ID Portal: http://www.windowslivehelp.com/product.aspx?ProductID=10
Forums Xbox: http://forums.xbox.com/
Hope the information is useful.
-
This license to use for the banks of the device Indian co
If the Bank is already a licensee for Windows now this license should be used for the renewal. (Indian co-operative bank)
Volume Licensing is the solution for organizations who would like to keep their PC fleet up-to-date with the latest Microsoft Software. such as Windows and Microsoft Office.
-
Windows Movie Maker cannot be used because the required audio hardware cannot be found on your computer.
Help, please.
original title: MM not working,.
Laughing out loud!
I found the awnser!It was two things,I have a dell and in some sort when I returned to XP SoundMAX Digital 7 Starter was deleted,.Then I got the thing plugged into the wrong entrance! -
Which card to use for the backup of Win8
Windows 8 requires a minimum of 32 GB card to use for the backup. I bought a PNY 32 GB (http://www3.pny.com/32GB-Pro-Elite-Series-Hi-Speed-SDHC-Class-10-UHS-1---35MBs-233X-P3122C442.aspx ), but it wouldn't work. Even though it says 32 GB it is actually a little less. If I buy a 32 GB SanDisk will, that I meet the same problem? Exactly what the size is a SanDisk 32 GB card? (http://www.sandisk.com/products/memory-cards/sd/standard-class4/?capacity=32GB)
Thank you
Ed P2
any card 32 GB will be less than 32GB after it is formatted to be used in a computer. It is a standard for all types of storage.
If you need 32 GB of actual useful storage space, you will have to get a 64 GB card.
-
What type of glass or plastic is used for the lens of the camera
What type of glass or plsastic is used for the protection of camera lens?
No glass is plastic sony replay for me
-
Original title: trouble installing the drivers for my printer.
Hello
I am trying to install an EPSON L110 and eveytime I try to run the CD, it appears this error message.
Windows could not determine the language to use for the installation: CODE of ERROR: 0x80004005.
I have windows 7 32 bit OS. What I'm doing. A quick response will be very useful.
TKS
Gerard
Hi, Germain,.
This problem could occur due to corrupted files. We will try to download and install the latest printer driver on the site of the manufacturer of the printer. Check if it helps.
See the articles for more information.
Find and install printer drivers in Windows 7
Hope this information helps. Answer the post with an up-to-date issue report to help you further.
-
Can embed you fonts in a pdf file after that the pdf has been created? I received a PDF of an another designer, made a few minor corrections, and now the printer cannot be used because the original pdf didn't have all fonts embedded. Any ideas?
Use the Acrobat Pro preflight!
To incorporate the missing fonts in Acrobat Preflight profile will incorporate the missing fonts in your PDF file assuming that:
(1) the fonts in question are installed on your system and
(2) the police themselves is not protected against the incorporation (they can at least see and print incorporation.
-Dov
-
Can I use other Adobe ID instead of the Adobe ID, used for the command to install and activate the Photoshop CS6?
Thank you
Only ID authorized to use the software is the ID of the software license.
Maybe you are looking for
-
System preferences do not accept the admin password
System preferences panel does not accept the administrator password
-
DirectX 9 installed but .0c envy it reads as 9.0
I installed Directx 9 .0c. When I run dxdiag States that directx 9.0 c but my videocard envy device it always reads as 9.0. Everything is up-to-date driver wise.
-
How to transfer contacts from another phone to my Droid?
I need help transferring my contact information for a phone to my Droid, out there, can someone help me?
-
My USB devices were working and are now not recognised in Vista (SP2)
I spent days reading the forums and try solves nothing doesn't. I have a mouse, printer, drive hard USB and fingerprint reader. First mouse has stopped and the rest followed in the course of the last few days. At least I found someone with an old
-
Need advice on how to recover the Aero theme
I lost the theme Aero Windows Vista Edition Home Premium. Have you tried everything to bring him back, but the "themes" is no longer the same figure as in services.msc. Any ideas on how to get that back? Do not appear as an option in customize. Deskt