Do these hotkeys exist for Flash Pro CS6? - flash-cs5

1) when you are in edit mode for one symbol, go into edit for the next symbol in library
2) automatically put cursor in the instance name box for selected movieClip
As far as I know there are is no way to put shorcuts for moving around "inside of the library panel"
A duplicate and edit shortcut would sure be nice though. I can't even find where you would do it in custom shortcuts.

The examples you have listed do not have shortcut keys because they are not default tasks inside of the IDE. That being said you can create ways to do those examples using JSFL to first create a command and then assign a keyboard shortcut to that command. As an example I will include a script for the second item in your list.
2) automatically put cursor in the instance name box for selected
movieClip
There currently isn't a way to tell the IDE to send the cursor to the instance name box in the properties panel, but you can get around that by using JSFL. Let's make our own instance name box pop up.
Here is the code required to do this:
// Assign Instance Name - Andrew Doll
/* This code will provide a prompt for the user to assign an instance name to a selected symbol on the stage. The great thing about using a
// prompt is that the focus is already in the input field of the prompt. To speed up your workflow I recommend assigning a keyboard
// shortcut to this command.
*/
// Check to see if there is a file open first.
var dom = fl.getDocumentDOM();
if (dom == null)
{
alert("Please open a file.");
}
else
{
// Make sure to only select one symbol on the stage at a time.
if (dom.selection.length > 1)
{
alert("You can only select one symbol to assign an instance name to. Please make only a single selection on the stage.");
}
// Make sure that you have at least one symbol selected.
else if (dom.selection.length == 0)
{
alert("You need to select a symbol on the stage to assign an instance name.");
}
// Make sure that the symbol you have selected is a movie clip or a button.
else if (dom.selection[0].symbolType == "graphic" || dom.selection[0].elementType != "instance")
{
alert("Your selection needs to be a button or a movie clip symbol.");
}
else
{
// Pop up a prompt for the user to assign an instance name with.
var iName = prompt("Assign an instance name to the selected symbol.");
// If the user cancels then do nothing.
if (iName == null)
{
// Do Nothing.
}
else
{
// Assign the instance name to the selected symbol.
dom.selection[0].name = iName;
}
}
}
Save this command as a JSFL script in the commands folder in your Flash config directory and then assign a keyboard shortcut to it.

Related

How to display default value from prompt macro in value prompt CA11?

I was wondering if it is possible to display the default value from a prompt macro in a Value prompt. My prompt macro looks like this "#prompt('pMonth','MUN','[Previous Month]')#"
so my goal in the value prompt would be to have 202103 displayed instead of header text name which I have named "Previous Month"
I tried with an old javascript from Cognos 10 where you desc the Months and specify what index it should pick but the issue with that code is that everytime you try to change to a different month the report re-runs and loops back to to the same Index value.
<script>
var theSpan = document.getElementById("A1");
var a = theSpan.getElementsByTagName("select"); /* This stmt return an array of all value prompts within span */
for( var i = a.length-1; i >= 0; i-- ) /* now loop through the elements */
{ var prompts = a[i];
if( prompts.id.match(/PRMT_SV_/))
{ prompts.selectedIndex = 2; } /* This selects the second options from top */
canSubmitPrompt();
}
</script>
All solutions, tips and ideas are highly appreciated.
Best regards,
Rubrix
For Cognos Analytics, running with full interactivity, you probably need a Page Module. Check out IBM's Scriptable Reports documentation for Cognos Analytics. You'll want to craft your script to use the current parameter value as default (if you can get it), then fail over to your default value from the data. You will probably need to integrate this with a Custom Control to be able to get that default value from the data.

GetFirstDocTemplatePosition() returns NULL

I have a MFC to display graph data. I created OCX for the same to display graph in another application. in Normal exe I have an right click pop up menu to do some operation. But when I use the OCX in another application, when I do right click application crash. I got the detail by debugging as follows,
POSITION pos = AfxGetApp()->GetFirstDocTemplatePosition();
// here GetFirstDocTemplatePosition() returns NULL so the below line crashes.
CDocTemplate* doc_template = AfxGetApp()->GetNextDocTemplate(pos);
I couldn't understand why GetFirstDocTemplatePosition() returns NULL. I created separate MENU for exe and OCX. separate resource files too.
Eg:
My application is MyGraph then I created MyGraphOCX.sln for OCX and resource_ocx.h, MyGraphOCX.rc for OCX.
POSITION CWinApp::GetFirstDocTemplatePosition() const
{
if (m_pDocManager == NULL)
return NULL;
return m_pDocManager->GetFirstDocTemplatePosition();
}
Here m_pDocManager is NULL. Why this is NULL I don't understand.
Please provide your valuable suggestions

text field attributes/methods dynamics crm 2011

I'm looking a method or way how to check that the text field in crm form is "null"
I've got a tab, there are section and text field inside of it;
furthermore, I'm using that function in order to hide/show tab.
function setVisibleTabSection(tabname, TextFieldName, show) {
var tab = Xrm.Page.ui.tabs.get(tabname);
if (tab != null) {
if (TextFieldName == null)
tab.setVisible(show);
else {
var section = Xrm.Page.data.entity.attributes.get(TextFieldName).getValue();
if (section != null) {
show == true;
tab.setVisible(show);
}
}
}
}
however, It doesn't work. There is nothing inside of the text box, and the tab expanded anyway.
by the way, parameters, which I give the function: "tab_8", "new_conf_report", false
where the secon one the name of the text field
Try
if (section != null && section !="")...
You may find that a field which is initially blank is null, whereas one from which you have deleted content but not yet saved the form is simply an empty string.
Certainly worth a shot.
show==true
is incorrect as others have pointed out (needs to be show=true) but is simply redundant as written inside the same IF statement, just replace next line as:
tab.setVisible(true);
It is possible you intended "show" to be the default tab state to use if text field is not empty, in which case just move this line outside the IF instead of changing it (as shown below)
It looks like the construction using the third "show" parameter is to allow you to use the function to set the tab state to a specific state of shown or not without looking for a text field value at all. You would need to pass parameters as eg tabname,,true - you might consider swapping the TextFieldName and Show parameters so it is easier to just drop the third rather than remember to double-comma.
While we're fixing stuff, lets replace that variable "section" with something with a more meaningful name:
function setVisibleTabSection(tabname, show, TextFieldName) //usage: show is state Tab will have if no TextFieldName is specified, or if text field is empty
{
var tab = Xrm.Page.ui.tabs.get(tabname);
if (tab != null)
{
if (show==null){show=true;}
if (TextFieldName == null)
{
tab.setVisible(show);
}
else
{
var strFieldValue = Xrm.Page.data.entity.attributes.get(TextFieldName).getValue();
if (strFieldValue != null && strFieldValue !="")
{show=true;}
tab.setVisible(show);
}
}
}
I don't see anything wrong with your Javascript (besides what Guido points out, which basically will only set the tab to visible if you pass in true for show). Use the debugging tool within IE by pushing F12, and set a break point at the top of your function to see where your logic is failing.
If you've never debugged javascript before, see http://social.technet.microsoft.com/wiki/contents/articles/3256.how-to-debug-jscript-in-microsoft-dynamics-crm-2011.aspx
or
How to debug jScript for Dynamics CRM?
I think there is a typo in the code:
show == true;
actually the code (assuming "=" instead of "==") will show always the tab if TextFieldName isn't empty, removing that line will show/hide the tab according to show parameter value
It seems to work when I run it but I'm not sure what you'd expect it to do so it might not be working the way you'd like it to. :)
function setVisibleTabSection(tabName, textFieldName, show) {
var tab = Xrm.Page.ui.tabs.get(tabName);
if(!tab) return;
if (!TextFieldName)
tab.setVisible(show);
else {
var section = Xrm.Page.data.entity.attributes.get(textFieldName).getValue();
if (section)
tab.setVisible(true);
}
}

Resharper live templates - inn & ifn

Do I have something similiar to intelij's "ifn" and "inn" live template in ReSharper?
("if not null" and "if null" templates )
Thanks.
ReSharper doesn't have these built in, but you can easily write them yourself.
Just go to ReSharper > Templates Explorer... > Surround Templates and add a new template with something like this:
if ($SELECTION$ == null)
{
throw new ArgumentNullException("$SELECTION$");
}
Then you can select something and hit Ctrl+E, U to surround the selection with your template:
In my case, I added it to the quicklist with the letter F.
If you want to be able to type ifn and press Tab, you need to add a Live Template. This can be done in the Template Explorer, under Live Templates, but the content has to be different:
if ($ARGUMENT$ == null)
{
throw new ArgumentNullException("$ARGUMENT$");
}
or maybe:
if ($ARGUMENT$ == null)
{
$END$
}
Then you can write ifn (if that was the shortcut you specified) and press Tab

How to get string value from mfc popupmenu when clicked without making use of resource id

I'm creating a dynamic popup menu without generating resource ids. How can I keep track of the clicked action without a resource id?
Is there any way I can get menu's string value?
CMenu m_subMenu;
m_subMenu.CreatePopupMenu();
utf16string actionName(L"");
int nCatgryId = 1000;
for( ; itr != itrEnd ; ++itr)
{
actionName = itr->first;
CString csActionName = actionName.c_str();
AppendMenu(MF_STRING,nId++, csActionName);
}
So how do I obtain the value from the menu when an action is clicked?
#define YOURMENU_ID WM_APP+10
...
AppendMenu(.., YOURMENU_ID,...);
And handle it in WM_COMMAND
Every menu item, when you create it, needs to have an ID. You need to reserve a list of ID's, use those to create the menu items, then use the normal menu functions to get information on them.

Resources