Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Photoshop panel created with Flex question

New Here ,
Nov 25, 2008 Nov 25, 2008
Hi everyone,
Im trying to create a simple panel in Flex that you would be able to create a new PS document. I want to pass 4 parameters from Actionscript to my Javascript function. For some reason Im only able to pass one parameter, it will not work when I pass more the one. For example:

My AS function:

public function callCloseDocument():void{
CSXSInterface.instance.evalScript("testFunc", "10", "10", "myDocName");

}

My JS function:
function testFunc(theWidth, theHeight, docName){

thisWidth=parseFloat(theWidth);
thisHeight=parseFloat(theHeight);

app.documents.add(thisWidth, thisHeight, 72, docName, NewDocumentMode.RGB, DocumentFill.WHITE);
}

This will not work, when I pass just one parameter no matter which one it works no problem. I can't figure out how come this is happening. Any help would be greatly appreciated.

Chris R.
TOPICS
SDK
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Explorer ,
Feb 08, 2009 Feb 08, 2009
Hi Christian,
I'm having the same annoying problem; in my Flex, the Javascript should get two slider values, but only the first one hit the target.
My Javascript is something like:

function inizializza(rMin, rMax) {
...
...
}

and my call look like:

CSXSInterface.instance.evalScript("inizializza", sliderMin.value.toString(), sliderMax.value.toString());

I've tried to add
+ " " +
or
+ "," +
or
+ ", " +
in between the two parameters, but had no luck!

Anyone knows the secret move?!
Thanks,

Davide Barranca
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 08, 2009 Feb 08, 2009
Hi Davide,
I was never able to find out why that didn't work. I looked at all the documentation available and there was nothing there. What I ended up doing was I just called 2 different functions in flex to set 2 different variables in my Javascript. For example:

myVar2.evalScript("setWidth", docW);
myVar2.evalScript("setHeight", docHeight);

and in my JS:

function setWidth(sentWidth){
thisWidth=parseFloat(sentWidth);
}
function setHeight(sentHeight){
thisHeight=parseFloat(sentHeight);
}

That worked for me, very lame I had to do it this way but like you I tried everything under the sun and I could not send more then one parameter. Let me know if you figure out how to send them over the proper way.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 09, 2009 Feb 09, 2009
Hi Christian,
I've already sent a private message to Bernd Paradies in the PatchPanel AdobeLabs forum with the link to this post - PatchPanel seems to be the closest subject for our question. Let's keep an eye on that, anyway if I'll get no answer in few days I'll post directly to the forum (maybe you can do it as well). Thanks for the workaround, anyway it seems very, very strange it's not allowed to pass more than one parameter!
The link of the AdobeLabs forum is:
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=72&catid=668&entercat=y

Kind regards,
Davide
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 11, 2009 Feb 11, 2009
Hi Christian, I've got an "official" answer here:
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=668&threadid=1423807&enterthread=y

In brief: known issue, workaround proposed. Do you happen to know how to get more info about that CSXSInterface?
Regards,
Davide
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 11, 2009 Feb 11, 2009
LATEST
Hi Davide, thanks for the info. To tell you the truth I was playing around with the panels around November. I made a few test panels and I have not been doing them since. The funny thing is I actually have a meeting tonight about doing a few panels for a client so I'll be back in full swing making these in the next couple of weeks. I was just thinking that maybe we can send an Array as the parameter? I don't remember if I tried this or maybe you have. Anyway thanks again for the info, I'll let you know if I'll be doing this project, . If I am then I'll gradly share any information I can gather. Even if I don't do the project for the client I'll still play around with this a bit. Talk to you later.

Chris R.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines