BIRT: Custom Highcharts Event Handlers - colors

I am attempting to set a custom event handler in a BIRT report to change the color of a bar when I click on it. I am doing this in the JS theme editor as can be seen in the following screenshot:.
I have tried multiple ways of writing this, but as far as I can tell there is nothing wrong with the script, yet obviously the compiler thinks something is wrong. Can anyone shed some light on this problem? Thanks!

You can catch click event on the point and call point.update() function.
plotOptions: {
column: {
point: {
events: {
click:function(){
this.update({color:'red'});
}
}
}
}
},
Example: http://jsfiddle.net/etd9t0qx/1/

Related

Loaded SWF's wont preform their functions in air

Back for some help! So I am making an AIR application that loads SWF's into a container to be viewed by the user. However when I load the files into their containers, the SWF's that are loaded are unable to execute their own code. IE press an invisible button on the loaded SWF and it changes colour. I tried to google solutions for this since Security.allowDomain("*"); is throwing this error in flash. However from what I have read, AIR doesn't allow loaded swfs to execute code for some security reason but im not 100% sure on that either.
SecurityError: Error #3207: Application-sandbox content cannot access this feature.
at flash.system::Security$/allowDomain()
at BugFree()[D:\Desktop\BugFree\BugFree.as:72]
Without the Allow domain it throws this security error when attempting to click the invisible button.
*** Security Sandbox Violation ***
SecurityDomain 'file:///D:/Desktop/Rewritten Tester/TechDemoSwordNew.swf'
tried to access incompatible context 'app:/BugFree.swf'
*** Security Sandbox Violation ***
SecurityDomain 'file:///D:/Desktop/Rewritten Tester/TechDemoSwordNew.swf'
tried to access incompatible context 'app:/BugFree.swf'
SecurityError: Error #2047: Security sandbox violation: parent:
file:///D:/Desktop/Rewritten Tester/TechDemoSwordNew.swf cannot access
app:/BugFree.swf.
at flash.display::DisplayObject/get parent()
at TechDemoSwordNew_fla::Button_Play_21/onButtonPress()
This only shows in the Animate output bar. When I publish it, with application with runtime embeded, and open the exe it throws no errors but the invisible button still doesnt work.
Here is the code for the swf being loaded.
btnButton.addEventListener(MouseEvent.CLICK, onButtonPress, false, 0, true);
function onButtonPress(event:MouseEvent):void
{
MovieClip(parent).play();
}
stop();
This is timeline code within the button since that is how the game company who put my item in game did it. I originally submitted it with it all done in classes but that is besides the point. When the button is pressed the loaded SWF should play and then stop. But I get the above mentioned Sandbox violation.
The code used to load the SWF is below
public function WeaponLoad()
{
if(FileMenu.WeaponFileTxt.text != "")
{
LoadWeapon(FileMenu.WeaponFile.nativePath);
}
else if(FileMenu.WeaponFileTxt.text == "")
{
Character.mcChar.weapon.removeChildAt(0);
Character.mcChar.weaponOff.removeChildAt(0);
}
}
public function LoadWeapon(strFilePath: String)
{
WeaponLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, CompleteWeaponLoad);
WeaponLoader.load(new URLRequest(strFilePath), new LoaderContext(false, new ApplicationDomain(ApplicationDomain.currentDomain)));
}
public function CompleteWeaponLoad(e: Event)
{
var WeaponClass: Class;
if (MiscMenu.WeaponSelect.MainClick.currentFrame != 3)
{
try
{
trace("WeaponOff");
WeaponClass = WeaponLoader.contentLoaderInfo.applicationDomain.getDefinition(FileMenu.WeaponLinkTxt.text) as Class;
this.Character.mcChar.weapon.removeChildAt(0);
this.Character.mcChar.weaponOff.removeChildAt(0);
this.Character.mcChar.weapon.addChild(new(WeaponClass)());
}
catch (err: Error)
{
trace("Either the weapon class doesnt exist or it is wrong");
this.Character.mcChar.weapon.removeChildAt(0);
this.Character.mcChar.weaponOff.removeChildAt(0);
}
}
else if (MiscMenu.WeaponSelect.MainClick.currentFrame == 3)
{
try
{
WeaponClass = WeaponLoader.contentLoaderInfo.applicationDomain.getDefinition(FileMenu.WeaponLinkTxt.text) as Class;
this.Character.mcChar.weapon.removeChildAt(0);
this.Character.mcChar.weaponOff.removeChildAt(0);
this.Character.mcChar.weapon.addChild(new(WeaponClass)());
this.Character.mcChar.weaponOff.addChild(new(WeaponClass)());
}
catch (err: Error)
{
trace("Either the weapon class doesnt exist or it is wrong");
this.Character.mcChar.weapon.removeChildAt(0);
this.Character.mcChar.weaponOff.removeChildAt(0);
}
}
}
Any help would be apreciated since I have no idea how to change any security sandbox settings within the publish settings since it is greyed out for me. Like I said I tried googling it but I couldn't seem to come up with any answers. Also worth noting is im a self taught novice and I do not know a lot of things in regards to AS3. I know my codes could be cleaner and I plan to clean it up and properly reduce memory consumption once I have the base program up and running. Thank you for the help!
It seems that you're not setting the application domain properly. Here is the code included in as3 documentation:
var loader:Loader = new Loader();
var url:URLRequest = new URLRequest("[file path].swf");
var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
loader.load(url, loaderContext);
Use it in your LoadWeapon function.
In the meantime try not to use Uppercase letters for starting variables and method names. In ActionScript names starting with Uppercase represent Class names. It will widely improve readability of your code.
Can't you bundle your swfs with the AIR app and use File class to load them? If you want to use classes from the swfs, maybe consider making swc library?

Getting Change Event to Fire in SyncFusion's SFAutoComplete Control

I am trying to use the SFAutoComplete control from SyncFusion in a Xamarin iPad app. (only iPad).
I am not able to get any sort of change event to fire.
What I've tried:
If you download SyncFusion and install it, it comes with a "SampleBrowser" app that has samples for all the controls in the suite.
If you open that SampleBrowser in visual studio and open the AutoComplete_Tablet.cs file after line 97, I've added this code:
countryAutoComplete.ValueChanged += (sender, args) =>
{
suggestionModeLabel.Text = "IT WORKED!";
};
But it never fires.
I've tried to use several different events from the list of events this control has (partial list from screenshot):
None of them seem to fire (I haven't tried ALL of them).
What do I need to do to get one of these events to fire? What am I missing?
Thanks for using Syncfusion Controls.
Delegate property can be used to hook the SFAutoComplete's events as per in the following code example,
Declaration code for Delegate property
SFAutoComplete autocomplete = new SFAutoComplete();
autocomplete.Delegate = new SFAutoCompleteDelegate();
The way to hook the events in SFAutoComplete
public class SFAutoCompleteDelegate : AutoCompleteDelegate
{
public override void DidTextChange(SFAutoComplete SFAutoComplete, string value)
{
//It fired while changing the text in AutoComplete
}
public override void DidSelectionChange(SFAutoComplete SFAutoComplete, string value)
{
//It fired while changing the suggestion from suggestion box.
}
}
We have created a sample for achieving your requirement. Please download the same from the following link
Link:http://www.syncfusion.com/downloads/support/forum/125261/ze/testingAutoComplete_21799375630
Thanks & Regards,
Hemalatha M.R

Prestashop | Remove transplant restrictions

So, there's a problem - I need to transplant "Categories Block" module to "displayTopColumn" hook (yep, designer put categories list near (on?) slider). But, by default, there is no possibilities to do this. I don't like that awful Prestashop restrictions, so maybe there is solution for this problem - remove those restrictions?
Thanks.
Removing those restrictions would not resolve anything for a simple reason: if you could hook the module blockcategories to displayTopColumn, this module would not know what to display in this hook because there is no hookDisplayTopColumn() function in it.
However, you can modify the module, and add a function to manage this hook.
To do so, open the file blockcategories.php and add the following:
public function hookDisplayTopColumn($params)
{
// Your code
}
If you want to display here the same content as in the hookLeftColumn hook, you can simply do this:
public function hookDisplayTopColumn($params)
{
return $this->hookLeftColumn($params);
}
You can also create your own function and template by copying, pasting and modifying the code you can find in the function hookLeftColumn() or in the function hookFooter().

hover effect that make some object to change or move, using (maybe) processing.js?

I spent whole night to figure it out how does hover effect on this site http://goo.gl/WXlGT work. But i still cant get it. At first i thought that its made in flash, than i thought its html5 but finally i found out its using processing.js (i can be wrong). I checked their sites but i have no idea how to do it.
All what i want to know is how to make hover effect of one object (for example menu) that will make some other object (for example logo) to change or move. Perfect example of what im looking for is here: http://goo.gl/I777F .
Any help or hints to some manual on web would be very appreciated. Thank you!
This is a general object oriented programming question, with a general object oriented answer. In generic Processing code:
ArrayList<Drawable> things;
...
void somePlacementFunction() {
...
things.add(new Drawable(<some parameters>));
...
}
...
void draw() {
for(Drawable things: things) {
thing.draw();
}
}
...
void mouseMoved() {
for(Drawable thing: things) {
if(thing.over(mouseX, mouseY)) {
Drawable differentThing = getOtherThing(...);
differentThing.changeSomePropertyThatAffectsHowItGetsDrawn();
}
}
}
In this specific case, the Processing code is http://labfiftyfive.com/res/mathsbaby2.pde and the on-page JS triggers it as http://labfiftyfive.com/js/main.js line 162 and on.

Are there constants for iOS notifications in MonoTouch? And how to get a "local" observer?

Im currently trying to figure out which notification string is sent if the app gets pushed to background. Is there an enumerator in MT I keep on overseeing or do I really have to use strings as shown in this example:
NSNotificationCenter.DefaultCenter.AddObserver ( "UIKeyboardDidShowNotification", MyNotification);
If there are no constants: where can I find the valid strings? Which one do I need for my "pushed to background" notification?
The other thing: is there a way to make a specific controller observer a notification? In my example I want to get rid of the popover controller a controller is currently showing. So I would like that MY controller observers the notifcation instead of having the global approach as shown above.
The problem is: if I do it like above in my view controller, remove the view controller and show a different one, the removed one still gets the notification. This means I don't get rid of the reference to that controller.
Yes, there are constants. You can find them as static properties on the class that the notification refers to. For instance, to receive a notification when the app moves to the background, you could do something like this:
NSObject enterBackgroundObserver;
//...
enterBackgroundObserver = NSNotificationCenter.DefaultCenter.AddObserver (UIApplication.DidEnterBackgroundNotification,
delegate(NSNotification ntf) {
Console.WriteLine ("Entered background!");
});
Don't forget to remove the observer when you no longer need it:
NSNotificationCenter.DefaultCenter.RemoveObserver (enterBackgroundObserver);
Sure is. I believe this is what you want. UIApplicationState.Active
As in
public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)
{
if(application.ApplicationState == UIApplicationState.Active)
{
// this means your app is currently in the foreground
}
else
{
// this means a notification came in when your app was in the background.
}
}

Resources