I am working on a project in Flex 3.
First off, I should explain I'm learning Flex as I go along. I was tasked with figuring out something and I needed Flex to do it as that is what our UI guys do (I am a database developer and work in PL/SQL and minimal ColdFusion).
What I'm trying to do is create a PDF, and I was able to get this to work on my local machine with a simple program using Flash Builder 4.6. It grabs a snapshot of an object and turns it into a PDF with no issues.
When I move this to Flex 3, I get issues. The error I am getting is:
abc bytecode decoding failed.
I tried to refresh and clean the project per some google searches suggestions, but that did not fix anything.
My code looks like this:
public function pdfBtn_printPDF(event:MouseEvent):void
{
Alert.show("Hello!");
}
Starting with an alert box to verify the function works perfectly. With my full function code or even if I replace it with just the following:
public function pdfBtn_printPDF(event:MouseEvent):void
{
var createPDF:PDF = new PDF(Orientation.PORTRAIT, Unit.MM, Size.A4);
}
I get the error above and my project won't work. I am at a loss as to what I am missing. am I creating the variable wrong? If I create it outside of the function it still gives me the decoding error and I have verified that I am creating the variables like other variables inside this project.Any help would be appreciated!!
The issue was I had compiled a library in Flash 4.6 and it wasn't compatible with Flex 3. It is working now with a new library.
Related
My project runs, and I see my mod populating within Minecraft, but for some reason my code doesn't do anything. I followed a basic tutorial that should be adding an item with a texture. I also set some basic method as such within Main to test whether this is working or not:
public void onPlayerTick(TickEvent.PlayerTickEvent tick)
{
System.out.println("testing 123");
}
Upon loading of the world, this doesn't output anything.
Any help?
I think it's working now. I made the dev environment again, this time with a different tutorial from the beginning. The main difference was this tutorial used intellij like me, unlike the other tutorial which used eclipse. Seems to be working because something in the init method printed out something in the format that is expected in the console (meaning it is compiling and using the code properly). So it appears to be working... It seems. I used these tutorials, they were very in depth, would recommend regardless. This is the playlist: https://www.youtube.com/playlist?list=PLxZiPYkNuhkQKH-QlM0C_3-LvjbQA8ZAu
I am trying to get my browser to create a screen like pdf. My code, based on MinimalExample.Offscreen works but generates the print image version, which is the default. I know this can be done because pupeteer does it if you are in a node.js enviroment.
I am using:
var scriptTask = browser.EvaluateScriptAsync("Emulation.setEmulatedMedia({ media: 'screen'});");
I've tried a few variations but I'm not getting it right. Thank you.
I'm working on an update for our app. I've added a HeadlessTask and I've started seeing this warning in the console:
React: Calling JS function after bridge has been destroyed
How can I get the name of the function being executed?
From the error message I assume you're in java (react-native Android):
When you reload on react-native, what happens behind the scenes is that the react context is getting destroyed, and a new one is being created.
That error get's thrown whenever a react-native Native Module is trying to do work, by using the old react context (the one that was valid before the reload).
The last time I saw that error it also included an explanation as to which module tried to do work by using the old context. Typically it's the RCTDeviceEventEmitter module trying to send a message to javascript.
You'll have to open logcat on Android studio and read the full error message.
p.s: If you're using react-native-navigation in your project, (after you discover which module is the trouble maker by using the logcat), make sure to search on their issues as they are heavily using the native side of react-native android, and I've seen lot's of similar issues so far.
Never found a good solution to this until recently, so thought I'd put this here in case it helps someone else. I finally got around this error by doing the following:
public class RNMyNativeModule extends ReactContextBaseModule {
private ReactApplicationContext currentContext;
public RNMyNativeModule(ReactApplicationContext reactContext) {
super(reactContext);
currentContext = reactContext;
}
public void myEmitFn(String emitMe) {
currentContext
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("RNMyNativeModuleEvent", emitMe);
}
}
Basically, in your module constructor, make sure you capture the currentContext in it's own variable, and just use that whenever you need it. Otherwise it gets overwritten and destroyed whenever a live reload happens, and getReactApplicationContext() is not actually giving you the current context.
I've started making a game using python and pygame, and tried using py2exe. It didn't work, (like it should), so I used the pygame2exe code found here: http://www.pygame.org/wiki/Pygame2exe
It still doesn't work, and comes up with the error stated in the title. I have a suspicion it's to do with not having the correct dlls, but I'm clueless apart from that.
Also, I managed to create a pygame executable in what I think was exactly the same way a few months ago, but now it doesn't work. If you'd like me o add a little more info I'd be happy to.
Here's a screenshot of the error message (I can't post images yet):
I've met the same problem and I finally solved it. The problem is with my font definition:
basicFont = pygame.font.SysFont(None, 48)
overFont = pygame.font.SysFont('Comic Sans MS', 60)
Using a default font to replace 'None' in your definition and add '.ttf' files in your dist folder can help
I've a bit experience with qt+ and creating not so complex web pages, but I don't know how begin with titanium...when I run the default app this work...I can change the index.html like a web page...I can include javascript code and jquery too...very nice...but when I try run api functions I don't know how include these...all examples talk about iphone and a app.js file...I'm trying make a desktop app and don't appear any .js...I can create these but don't work
...in the docs I read things like these:
var win = Ti.UI.createWindow(); var view = Ti.UI.createView({backgroundColor:"red"}); win.add(view); win.open();
I don't know where I've put this code...I try put it inside a javascript inside the html (bad practice!) but it don't work...I put it inside a function onload but don't work neither.....there are any "convention" with the names for the files for this work?...I think this is like create a very dynamic web page but I don't know how work with the api....I see the example "kitchen something" but it wasn't so clear to mee...I see a examples like this:
http://mobile.tutsplus.com/tutorials/appcelerator/appcelerator-using-json-to-build-a-twitter-client/
but seems this work different when is an ipod to when it is a desktp app...I create an app.js (like the tuto) and put my code inside it but it never run...I look the source code and only need create a .js and inside my "home.html" link it..but it don't work...I create a index.js too but it don't work neither
please help..I'm very noob...thanks
Aaron:
This reply kindly brought something that could have been a solution but just made me lose more than 15 minutes of my time, as these first online courses have info about how to create a new project with a default html file, not about the original poster's issue.
The original poster's issue is that he has a new project with an index.html file, but no app.js file.
And he then doesn't understand where he could put the sampe code :
var win = Ti.UI.createWindow();
var view = Ti.UI.createView({backgroundColor:"red"});
win.add(view);
win.open();
... as whatever he puts in app.js is not executed.
The documentation in Titanium Dev Center fails to provide accurate information as it only mentions Titanium Mobile app.js and does not speak of index.html in the application structure.
After some starting experience on Titanium Mobile, I had to work on Titanium Desktop andactually just had the same problem as angel_ang, which brought me here.
So, here is the real answer :
Titanium Desktop applications do not need or start with an app.js file, but with index.html.
Deleting or removing this file never works as it will still be launched from the last build if need be.
Adding anything to app.js will never run as only index.html is run as a starting place.
Something that should have been a solution was found that to the following link:
http://www.youtube.com/watch?v=lgGVNB2nkKc&NR=1
This video is two online courses further from the link supplied by Aaron. At 0.19 seconds exactly, we see the starting code he has added to index.html.
You need to put a ... in your HEAD section, and add a function() there.
You may put the sample code inside this function.
Then you may even set the function to run when you click a button ().
Unfortunately, this doesn't work with me either.
I tried with the example code above but also with the other example (notification) mentioned in the online course.
It just seems that something is deprecated here and many documentations are outdated.
Anyone that could answer to this situation would be very helpful to us and many newcomers.
We just have an index.html that we can't use, instead of a running app.js file.