Error 1034: converting TLF text to MovieClip for fade in transition - transitions

I am trying to make text in my project fade in/out when a test button is pressed. I have gotten as far as writing the basics (I think so at least), however every time I try I click the test button, I get the following error message:
Error Message:
TypeError: Error #1034: Type Coercion failed: cannot convert fl.text::TLFTextField#2de22479 to flash.display.MovieClip. at Products_fla::Products_1/fader()
The code for the button is as follows:
Code:
test.addEventListener(MouseEvent.CLICK, fader);
//Function: fade text
function fader(apple) :void{
clear();
TransitionManager.start(Text.Rubens, {type:Fade, direction:Transition.IN, duration:9,easing:Strong.easeOut});
}
I've been searching for hours now, but I only found that code from a copy/paste from the Adobe website: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/transitions/Fade.html
P.S. This is my first time using stackoverflow (as I'm a newbie :) and any help will be greatly appreciated.

I believe in the end, I cached the TLF text as a bitmap on runtime, and then applied the alpha transition. This seemed to work. A bit stupid to be honest...

Related

react native crash when tapping navigation button too fast

I used react navigation 4.0.10 and it's little bit complicated app with nested navigator. Currently it's performing relatively well except that When I try to navigate it very fast, it will crash. The error message is
TypeError: undefined is not an object (evaluating 'navigation.state')
The structure is
-bottomTapNavigator(Home, Scan; Scan is a stackNavigator)
--HomeScreen
--ScanNavigator(stackNavigator, parent for ScanScreen and JourneyNavigator[tabNavigator])
---ScanScreen(Real page, initial screen of ScanNavigator, having buttons to navigate(HomeScreen) and navigate(JourneyNavigator))
---JourneyNavigator(TabNavigator, including ScreenTest1 and ScreenTest2; having header with back button navigate(ScanScreen) for both ScreenTest1 and ScreenTest2;)
---ScreenTest1(Real page)
---ScreenTest2(Real page, does not matter in this case)
what I do is tap ScanNavigator[ScanScreen]->ScreenTest1->ScanScreen(tap navigation button quickly here)->HomeScreen
In such case, the app will crash. If i do it with normal pace then it's fine.
Any help or direction is welcome.
EDIT
I'm 100 percent certain it's something to do with resetOnBlur setting. When it set to false, the issue gone. Help please.

UITextView freezes iPad app from textViewShouldBeginEditing. (Invalid Glyph Index)

So I've been working on this bug for about a week now, and for the life of me I can't figure out what's happening.
Due to confidentiality issues I can't post too much code, but I'll do my best to explain everything.
What's happening is that we're populating a UITextField via code, and initially have the text greyed out. The user then can do one of two things:
1) Tap a button which says "commit" and a method is called which does the following method we'll call "commitData". It does the following:
Registers the commit with an undo Manager
Changes the text from grey to black
Register with our application that the text field has been updated and needs to be saved upon application close
2) Tap on the text field with the greyed out text, which then calls the following default apple method textViewShouldBeginEditing. From here we call our "commitData" method listed from option 1 like so:
-(BOOL)textViewShouldBeginEditing:(UITextView *)textView
{
if ([[self box] hasGreyedOutText])
[[self box] commitData];
[self setActiveTextView:textView];
return YES;
}
The issue we're having is that tapping the button to commit the greyed out text works perfectly fine, and we run into no issues.
HOWEVER
When we tap into the text field and trigger the textViewShouldBeginEditing method, our iPads can freeze up and make the user wait for a couple of minutes before finishing. When I mean freeze, I mean the entire iPad freezes. The iPad clock won't even update while this is happening.
When this happens, we get an error code in the console which says:
!!! _NSLayoutTreeLineFragmentRectForGlyphAtIndex invalid glyph index 2147483647
We can get the error code above to display from all of our hardware when following the steps above, but can only reproduce the freezing on an iPad 2(with 100% accuracy however).
A note on this, my co-worker has found through diagnostics that we only have about 8MB of free RAM when this error occurs. We only ever hit this little of RAM on the iPad 2 however, so this could just be a coincidence.
I have a feeling that this could be related to threading and that we might need to somehow call our method after returning YES from the textViewShouldBeginEditing method, but I'm not quite sure how I should be going about that.
If anybody has any ideas on how to fix this, or even ideas that could point me in the right direction, I would be incredibly grateful. I've looked everywhere I can possibly think of, and none of the solutions I've found relating to the error code have ended up working.
I can't debug, so in my guess it may caused by non-main thread UI operation. So, my suggestion is to make sure your UI code is in mainThread. Try this:
-(BOOL)textViewShouldBeginEditing:(UITextView *)textView
{
dispatch_async(dispatch_get_main_queue(), ^{
if ([[self box] hasGreyedOutText])
[[self box] commitData];
[self setActiveTextView:textView];
}
return YES;
}

Adding array of UIImage in a UIViewController with some alignment

I just started my first project in iOS, recently I have encountered a problem in the UI when i receive it from the designer.
The expected output is shown as below and i can do most of it without any problem.
Now the problem came when I am about to implement this :
As the number of colour varies depending on item, I cannot add it like what I did for the share and love button I have no idea how can i implement something like this, I have look through the Object Library in the storyboard and cannot find any that can produce the output as expected .Any helps and guides are much apprecited!

firefox addon sdk override link preview text

I'm new to developing firefox addons and was wondering if there is a way to override/modify the link preview text that appears at the bottom of the browser when you hover over a link.
I've looked briefly and wasn't able to find any reference describing this.
Thanks for any thoughts.
You can set the status text like this:
aDOMWindow.XULBrowserWindow.setOverLink('blah')
Where aDOMWindow is a window like that returned from for example Services.wm.getMostRecentWindow('navigator:browser').
So like do link.addEventListener('onmouseenter'.... a function that does setOverLink
and to make it go away set it to blank string. So just window.XULBrowserWindow.setOverLink('')
But you are doing this on mouse enter of a link and by default mouse out of links will blank it so you may not neede to handle blanking it.
edit:
you asked about add-sdk, so the Services.wm.getMostRecentWindow might not make sense, so here's a quick test you can try in sdk:
const { getMostRecentBrowserWindow } = require('sdk/window/utils');
getMostRecentBrowserWindow().XULBrowserWindow.setOverLink('hiiiiiii!!!')

Open Flash Chart - tooltip #x_label# not showing

I'm currently playing with a bar chart implemented through Open Flash Charts (I believe version 1, might be version 2...) with PHP. Unfortunately, we're having real trouble with the tooltip not showing the correct thing. I am trying to get it to show the x-axis label for the hovered-over column, then a ":", then the value of the bar. The code is as follows:
$Colour = '#3465A4';
$BarChart= new bar();
$BarChart->set_values($Bar);
$BarChart->set_colour($Colour);
$BarChart->set_tooltip('#x_label#:#val#');
$x_labels = new x_axis_labels();
$x_labels->set_labels($Roles);
$x_labels->rotate(-60);
$x = new x_axis();
$x->set_labels($x_labels);
$chart = new open_flash_chart();
$chart->add_element($BarChart);
$chart->set_bg_colour( '#FFFFFF' );
$chart->set_x_axis($x);
$tooltip = new tooltip();
$tooltip->set_hover();
$chart->set_tooltip($tooltip);
$JSONArray['my_chart_1'] = $chart->toPrettyString();
As far as I can tell, this should be correct - the bar chart appears, with the correct values (populated from $bar, whose generation is not shown above). However, the hover-over tool-tip for a column only shows ":value" - the label name is missing!
Does anyone know where we might have gone wrong, and how I can fix it?
EDIT:
An update for any Bounty Hunters coming in to try and answer this question. The reason I have not accepted the below answer is that it only provides a work-around, and does not explain why the work-around is necessary. I am looking either for an answer to my original question (how to make the labels show in a normal bar-chart), or a reasonable explanation regarding why one must use a stacked bar chart (including sources makes your answer so much better!). If the latter, example code or an explanation of how stacked charts are created would be much appreciated as well!
If you are happy with the simple bar visuals then use stacked bar (using it with an array of one element will draw it just like the simple bar). That one will replace #x_label# correctly.
Alternatively you can copy the missing code from Bars/Stack.as to other bar types and recompile the code.
As per: http://forums.openflashchart.com/viewtopic.php?p=7433#p7433
It's a bug in OFC2 in the latest versions (at least). I've found what is causing the issue with #x_label#, but my understanding of the code/Flash isn't good enough to know why it's happened/broken.
I've done a quick fix that I need to test some more, but it now works on bar charts. Assuming I've not broken anything else beyond repair, it'll make it's way into the next community release.
If anyone wants the source code changes before the next release let me know.
(I am currently maintaining the community releases)

Resources