Java :: Translating Ecmascript (javascript) Knowledge To Objective C?
Apr 24, 2010
Newcomer to Objective C and trying to translate concepts and sytax I know from ecmascript based languages to Objective C.Is it proper to think of the .h header file in ObjectiveC as an Interface in Actionscript?Lets take the following code example in Objective C which calls a method containing 2 arguments
[myTextObject setString: @"Hello World" color: kWhiteColor];
In Actionscript(or javascript) would this be the same as calling 2 accessor methods on 'myTextObject'?
ie
myTextObject.setString("Hello World")
myTextObject.color(kWhiteColor);
View 2 Replies
Similar Posts:
May 2, 2011
The following doesn't work (although it gives no explicit error), but why not?nd... Is there really no way around it, strictly using the with statement? Forget using for / foreach.
with (object1, object2) {
attribute = value;
method();
}
Why the code above gives no syntax error, doesn't work but is accepted by with?If it's possible, how could we change multiple objects with same attribute using with?
var object1 = { attribute: 3 };
var object2 = { attribute: 2, method: function() { alert('blah'); } };
var object3 = { method: function() {alert('bleh'); } };
[code]....
View 2 Replies
Sep 14, 2011
My compilers class requires us to find a yacc grammar for one of these languages and combine it with the tokenizer we wrote. Presumably this is something easy to Google but I can't find it and my classmates are struggling as well. A yacc grammar for any of those three languages would suffice.
View 1 Replies
Jun 1, 2010
I'm tring to convert the following 3 methods from java-actionscript to Objective C. Part of my confusion I think is not knowing what Number types, primitives I should be using. ie in actionscript you have only Number, int, and uint. These are the 3 functions I am trying to convert public function normalize(value:Number, minimum:Number, maximum:Number):Number
[Code]...
View 3 Replies
May 6, 2011
I'm writing a simple game based on my physics engine for Android (in Java). Because I want to play with some special graphic effects performance is very important for me. I read on the Internet that you can write an application in ActionScript3 and then just export it as an iPhone/iPad or Android application. That means, I wouldn't have to rewrite everything from Java to Objective-C if I wanted to make version also for iPhone. Do you have any experience with writing games in ActionScript3 for both Android and iPhone/iPad? Are there any significant advantages / disadvantages?
View 4 Replies
Sep 15, 2011
I want to make simple project which play flash video file from online. I've searched some articles and read carefully. But I can't understand, how to play flash video files on iPad by Code.
View 5 Replies
Feb 3, 2011
In my Cocoa app, I want to prevent Flash from loading in a WebView, and let the user decide if the Flash should be shown for each page. (That's the same behavior already available through the ClickToFlash plugin or Safari extension. Bundling any of those extensions is probably not an option because of licensing issues.)Unfortunately most of the Flash I'm trying to avoid is generated from embedded JavaScript specifically designed to prevent easy flash blocking, so I cannot filter the raw HTML for inclusion of Flash objects.Also, I cannot disable JavaScript for my WebView, as the page I want to display looks completely different when JavaScript is turned off.Is there a notification/hook I can use to modify the page DOM after JavaScript has been executed, but before the Flash plugin is loaded?
View 3 Replies
Oct 6, 2010
I have a game I wrote in Actionscript 3 I'm looking to port to iOS. The game has about 9k LOC spread across 150 classes, most of the classes are for data models, state handling and level generation all of which should be easy to port.
However, the thought of rejiggering the syntax by hand across all these files is none too appealing. Are there tools that can help me speed up this process?
I'm not looking for a magical tool here, nor am I looking for a cross compiler, I just want some help converting my source files.
View 3 Replies
Nov 13, 2011
I need to load somehow the html code of a webpage A into a javascript string of another webpage B, on a different host. I know this is impossible to do with javascript alone because of the same origin policy, and I know I could do it loading the page via php on my server and then send results back to the user's client but I wouldn't be able to handle so many requests, so I need it to be done directly by the user's browser. I can use nearly whatever browser scripting language/applet framework common enough to be installed on the majority of my users' computers, like flash and java.On example, what if I use flash or java to load the external html code and then call a javascript callback function providing the source? Could this work?
View 2 Replies
Jan 12, 2010
I need to make a point in a Flash video where the video stops and pressing a button will move to another frame. I understand there is something called a "stop action" but not what this means. Using other online instructions, I end up with the video not stopping and the button not doing anything.
View 1 Replies
Sep 22, 2009
I'm trying to nail down the latency problems in AS3 Sound.play() method.After collecting and calculating delays it seems that the latency basically always is a multiplier of approx 46 milliseconds, from 0 up to 185 (0, 46, 92, 139, 185) where 185 is in great majority.What is it with this 46 millisecond value, can that be derived from some internal clock, sample rate or something else?
View 1 Replies
Feb 14, 2010
Can you perfom regexp test on XML when filtering using the dot notation syntax?
I'm trying to test for a string pattern in the xml.child('folder') where folder can be 1 or more nodes xml.(folder.search(/ref/ig) < 0)
View 1 Replies
Mar 3, 2010
i'm studying getPixel32() and the Bitmap and Bitmap Data classes.Basically, i'd like to know how to output a simple trace of an ARGB from a hexadecimal value.as an aside, i'm under the impression, which i assume/hope is wrong, that hexadecimal values can't produce as many colors as RGBA values.perhaps "web safe" has thrown me off with understanding the usefulness or desire to use colors produces with hexadecimal values.
View 1 Replies
Jun 17, 2011
I'm new to using ByteArray, and am trying to parse hex color values from an .ase (Adobe Swatch Exchange) using ByteArray in AS3. I can see position of the hex values using a hex editor, but don't know which methods to use to parse the hex value from there. Here are the values copied from the hex editor. The 2 color values are #ffffff and #cdcdcd:
ASEF........¿..........$...#.f.f.f.f.f.f..RGB.?Ä..?Ä..?Ä....¿..........$...#.c.d.0.0.c.d..RGB.?MÕŒ....?MÕŒ
I've made a weak initial attempt to get the first color, but am stuck here :
var byteA:ByteArray = _fr.data;
byteA.position=29;[code]....
how to parse out the color value, so it can be added to the temp array tA? As a bonus answer, since there can be multiple colors in a swatch, advice on a method to parse out all colors in a given .ase file
View 1 Replies
Aug 17, 2005
I have flash set up to read an external .jsp file.the problem is that this jsp file contains names with chars such as "&" and "â„¢" among others. when flash loads this file it halts when it hits those chars. does anyone know how to fix this problem?
my flash code is as follows.
Code:
text1.htmlText = true;
unicodeData = new LoadVars();
unicodeData.source = "http://localhost:8080/testingground/...ctionslist.jsp";
unicodeData.load(unicodeData.source);
[code]....
View 1 Replies
Nov 17, 2009
I'm having trouble; the Facebook API that I'm using throws a whole bunch of errors where it has [Bindable] and such. I'm a bit stuck.
View 6 Replies
Feb 14, 2012
I'm looking to port some DateTime functionality from ActionScript 3.0 over to Java/Android. I am currently looking at Joda. Before going with this option I wonder if there are actually any implementations of the DateTime object with ECMA-262 3rd Edition compliance? Or is there a better option (smaller/lightweight) solution to achieve this?
View 1 Replies
Jun 22, 2011
I need to convert Java regular expressions into Actionscript regular expressions. There apparently aren't any premade converters, so I'm trying to write one myself. Is there any resource that'd list all the differences? I'm aware of regular-expressions.info, but there doesn't seem to be a comprehensive listing of differences there.
View 2 Replies
Nov 9, 2010
I've been trying to understand how flash animations or a Java Applet work within a browser. I can think of a couple of ways - The Flash Player/Java Applet are machine code that's dynamically linked it, and given some parameters about the area of the screen that belongs to them; after that, they run within the same process space. The browser exposes an API that the player/applet use to talk to it and they live in a separate process. (Presumably they talk via sockets?) The API could correspond to openGL/X11/some custom calls.
These possibilities still don't explain things like how a button click can make the player full-screen, how it can play music, how it can inspect the DOM, etc. For that matter, is the video displayed by decoding to a sequence of images, and rendering them one at a time, or is there a more efficient way, e.g., of pushing the deltas in the image? The Wikipedia page on Java Applets
(1) talks about how the applet is run in a sandbox (presumably a separate process), but it doesn't say how the browser and the applet communicate. Perhaps the answer depends on the underlying platform?
View 2 Replies
Jan 19, 2012
I'm working on a quite simple native extension for Adobe Air powered iOS app.I'm playing with CLLocationManager class and i ran into really strange problem.When i'm trying to initialize CLRegion object app crashes.
CLLocationCoordinate2D coords = CLLocationCoordinate2DMake(0.0, 0.0);
CLRegion *region = [[CLRegion alloc] initCircularRegionWithCenter:coords radius:100.0 identifier:@"Region1"];`
[code].....
View 1 Replies
May 11, 2011
I'd like to incorporate some flash animation (a 2d character animation) into my objective c app.
I heard you can create and export a flash cs5 app into iphone. But I don't want to export an entire app. Just a small component...
for example, I want to get an animation of a 2d character waving that was made in flash and just incorporate that into my objective c app.
View 3 Replies
Mar 22, 2012
We have a project developed in Flex, which we have already successfully able to integrate with our Android app. The best part is Android let you embed adobe air app as part of another Android app so you can integrated seamlessly. We would like to do similar thing with iOS app but cant any way to sort of embed Air app in iOS Objective-C based app. We can launch one app from another but thats not what we want. We would like to show show flex app in half part of the screen of iOS obj C app. If anyone has managed to do such thing, are there any other tricks to achieve such thing? ( Flex app needs to load data do its own bits)
View 1 Replies
Jan 15, 2010
Just looking for more recommendations for great Ojective-C-Cocoa books. My ideal book would be one with actual hands-on walk thru examples increasing in complexity and doesn't spend unnecessary time on basic OOP. Trying to leverage what knowledge I DO have in Actionscript 3. (or maybe its all about unlearning?)
View 1 Replies
Jul 7, 2010
I have an iPhone app with an UIApplicationDelegate conforming delegate called MyAppDelegate - it has a UIWindow.Instead of adding buttons, labels and whatnot directly to the window, I guess I'm supposed to make a child class of UIViewController for every screen I wanna make. When that screen should be displayed, I add the respective controller's view to the window as a subview. When another screen should be displayed, I should pop off any other view from the window and add the new view. Hope I got everything correct so far...
My intent is to make each view controller only know about its own things, so let's say I wanna call view A from view B, in ActionScript I'd add a button in A firing off an event which would be caught in view A's owning object (could be the application), which could take proper action (remove view A, instantiate view B and display it).How do I do this in Objective-C?
View 2 Replies
Nov 10, 2010
I make an iPhone app with Flash and it generates my app and a xml (that I don't understand if is it useful).My question is if I can read the objective-c code that Flash generates.
View 2 Replies
Dec 15, 2011
I went through many links like this,this and this, but not getting good direction to move with. I need to implement some flash content in my iPhone app. good tutorials to move on with the conversion process.
Suppose I am having a flash air iOS app and I need to convert the whole app in objective c for say adding some features like APNS then I have to do some needful. I want to convert the air iOS based app in objective c for same thing and hence need a tool like Haxe.
View 2 Replies
Feb 13, 2012
My issue is when I try to compile my .ipa using the adt tool (through Terminal) I get the following error:
ld: absolute addressing (perhaps -mdynamic-no-pic) used in -[MediaCaptureViewController showCamera] from /var/folders/NP/NPNiEhuUEwGiPRg0Bym7Sk+++TI/-Tmp-/97f7f1f9-6d5e-4486-9ba0- 147ff50f7157/libcom.luxson.mediacapture.a(MediaCaptureViewController.o) not allowed in slidable image. Use '-read_only_relocs suppress' to enable text relocs
Compilation failed while executing : ld64
The iOS native extension pops up an instance of the UIImagePickerController and it works apart from the following line of code, which causes the above adt error:
cam.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
I have included the MobileCoreServices framework in my project and added the following to my header file:
#import <MobileCoreServices/MobileCoreServices.h>
I'm using Xcode 4.2.Project set to build with the following settings:
iOS Deployment Target: iOS 4.3
Enable Linking With Shared Libraties: No
View 1 Replies
Mar 24, 2010
I develop with Actionscript and was glad to see that AIR 2.0 was going to give access to mic input data. I planned to use this to create a visualizer set to the tempo of the incoming live audio. After doing a few days of google research it seems unlikely that it will be possible to analyze the data of the mic input in Flash/AIR. If anyone has ideas on how I can achieve this in AIR please let me know. (I'm open to workarounds.)Run on OSX Two windows - one that can go fullscreen while the other(controller GUI) stays put Able to access live mic input data I've done reading on FFT and understand what needs to be done on the sound side so no need to help with that.
View 1 Replies
Mar 27, 2011
I'm starting to learn Objective C and I wonder if there is any similar function toactionscript trace to show messages in a console.
View 1 Replies
Mar 13, 2010
I know javascript, CSS, AJAX, and HTML/ XHTML. I was told to learn these in order to make an application for the iphone. Now what? What/how do I start learning objective-C?
View 1 Replies