ActionScript 3.0 :: Iphone Specific Functions/classes (specifically CameraRoll)?
Oct 21, 2010
Is there a way I can find out all the classes that are related specifically to the iphone in CS5? (ie Accelerometer, Gestures...ec)
What I want to do specifically is try to access the camera and then if there is none (say it is an old ipod touch) then go to a photos/camera roll folder and show those. Apparently in the help files, in the Air 2.5 runtime there is a "browseForImage" function that allows you to go to said cameraRoll but it will not compile if I publish under the iphone OS option (does not have specific stuff I am importing from an example flash.media.MediaType, flash.events.MediaEvent, flash.media.MediaPromise). Upon looking up the errors, there is no mention whether it is for a specific device.
View 0 Replies
Similar Posts:
Jun 6, 2010
I've got a project thats getting a bit big, so Im taking the actionscript out into separate as files. I want all the basic functions to be in BasicFunctions.as and the make a library for more specific functions. I find that a lot of people use the import statement but I cant get that to work with a simple Hello World trace, yet the include statement works fine (see attached). I understand that import/include work differently, but which is the better method? If import, then is that heavier to work with. Any rate, what's the best way to organise code when it gets to the 1000+ lines?
[Code]....
View 9 Replies
Dec 27, 2009
Let's I have a class Square that has a several functions. I want to call it from a class Grid, which is a group of Squares.So in the class file for Grid, how would I do this:
Code:
public function doSquareFunction(thisFunction:Function):void{
square1.thisFunction();
[code]......
View 8 Replies
Nov 25, 2011
I'm instructed to develop a project in such a way that it is available for iOS, Android and Blackberry OS platform all at once. A herculean task!! indeed... I am searching for all the possible development platforms for this assignment. I came across Flex 4.5.1 and the initial thoughts are really positive. Somewhere in SO I read that flex applications suffer from code bloating problem. I dont want such solution; infact memory is an important concern for me. I want to know which one of the following is the optimum approach:
Developing using OS specific SDK i.e. xCode for iPhone, Andriod SDK for Android.
Developing using Flex builder and ignore code bloating.
Using Flash Builder and developing application in ActionScript.
View 4 Replies
Oct 3, 2011
how to rotate an image loaded using CameraRoll on an AIR for iOS app. This code below works fine (displayImage() is called when CameraRolls media event returns completed, and imageArea is the scrollPane where the image is shown.
function displayImage():void
{
var image:Bitmap = Bitmap(imageLoader.content);
[Code].....
With the second version the image seems to load because the scroll bars expand to the size of the image I choose, but I don't see anything on the stage.
View 4 Replies
Apr 3, 2012
I have 2 classes, named Class1 and Class2. How would I use a function from Class1, in Class2?
View 4 Replies
Jan 5, 2010
so I'm having this problem where one of my classes can't locate a function. The function it's trying to use is in another class, so I was wondering if there was something special you had to do. This is what I'm basically doing:
One class
Code:
package
{
[code].....
View 5 Replies
Dec 27, 2009
Let's I have a class Square that has a several functions. I want to call it from a class Grid, which is a group of Squares.So in the class file for Grid, how would I do this:
Code:
public function doSquareFunction(thisFunction:Function):void{
square1.thisFunction();
[code].....
View 5 Replies
Mar 9, 2009
I have Flash project that is set up something like this:
myProject.fla
- document class = myMenu.as
- the document class imports a menu item from menuItem.as (import menuItem;)
I have a function in myMenu.as that sets the text formatting for all the text fields on the page. I want to be able to use this same function in menuItem.as so that all the formatting is consistent & you only have to change it in one place. How do I access this function from both myMenu.as & menuItem.as?
View 2 Replies
Dec 17, 2010
okay, i'm refactoring a huge ActionScript file, and so trying to move some functions into their own classes. why is this not working? i've got a function in my primary class:
// ...
private var testBlock:Sprite;
public function testingINT() {
testBlock = new Sprite();
[Code].....
View 11 Replies
Dec 13, 2011
I'm coding a small flash game, and wan't to access different functions between classes. In C# I'm used to just making it static, but I'm having some problems with it.Here goes:
Main.as
package
{
import Bus;[code].............
View 3 Replies
Oct 27, 2009
I need to call a function that sits in a class called MainClass.The function call is made inside a class called Rooms.
I have an event that is supposed to call the function, but when I do I get[code]...
View 2 Replies
Oct 27, 2009
This probably has a simple solution, but I'm a complete newb to actionscript and I could really use some guidance.I have a file, called Politismos.fla. The document class of this file is: com.plaidfox.PolitismosClassPolitismosClass.as is as follows:
ActionScript Code:
package com.plaidfox {
import flash.display.MovieClip;
[code].......
View 9 Replies
Sep 8, 2011
I've been working my way towards better OOP design lately and I've come across a problem with accessing functions in other classes from my Main class. Here is the code:
Main.as
ActionScript Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
stage.addEventListener(KeyboardEvent.KEY_DOWN, fireBullet);
They are listening for functions that are within the Player.as class, these functions control the dynamics/movement of the player itelf. But for some reason I'm getting a 1120 error(access of undefined property). Basically how do you listen/access for functions within a different class?
View 5 Replies
Sep 10, 2011
asically I have a Player class with methods (i.e. Moving the player) that I want to listen for and implement in the main class. To put it simply, I'm creating the player methods in the player class and then calling them in the Main class. But for some reason I'm having some trouble, I'm still trying to get used to all this OOP design.Here is the (Main) code, it's not alot:
ActionScript Code:
package
{
[code].....
View 9 Replies
Mar 13, 2009
I have 2 classes
Code:
package com.MyClass.basics1
{
//importing classes to use[code]...
Is there any other way to reference a function ?
View 3 Replies
Mar 12, 2010
in my Main class, i try to call a function from another class, but when i compile i get this error:1136: Incorrect number of arguments. Expected 1.i have seen some fixes involving an event in the OtherClass and (null) when i call it, but it dosent seem tohere is a code that describes my problem, what do i have to do to make this kind of code work?m i doing it wrong, or do i have to do something else?OtherClass
Code:
package{
import flash.display.*;
[code].....
View 3 Replies
Oct 3, 2011
I have made a simple app in Flash CS5.5 and am publishing it with AIR for iOS. I am trying to get an image from the iPhone cameraRoll to load to a scrollPane on the stage using this code (I don't need to save the image anywhere, just display it on the stag). The scrollPane is called 'imageArea' and the button to initiate cameraRoll.browseForImage(); is called select_btn.I've tried this both in the main timeline on frame 1 and also as a class of it's own, either way I get the same error:1119: Access of possibly undefined property SELECT through a reference with static type Class which points to this line:mediaSource.addEvent Listener(MediaEvent.SELECT,imageSelected );[code]
View 1 Replies
Oct 20, 2009
I was wondering if ActionScript had some way to call functions and classes from variables, like they do in PHP:
function funcname() {
print "Potatoes come from tree";
}
$function = "funcname";
print $function; // Prints out "funcname"
$$function(); // Prints out "Potatoes come from tree"
In case you don't know the syntax for PHP, you should know that anything perpended with a $-symbol is a variable.
View 1 Replies
Dec 17, 2009
I have a flex application that loads swf files and displays them using the SWFLoader object.is there a way to provide different classes and functions for the swf application to use? [code]...
View 1 Replies
Nov 16, 2011
I have a Flash application that creates a sort of powerpoint presentation. All the 'slides' are stored in an XML files which is read and processed.
I'm trying to build the presentation using this XML file. At the moment, my main class has it's initial function main and a static function processXML main initiates my database class with a function called initDB. One of my issues is that initDB forgoes processing because it's dependant on an event listener. On completion of loading the XML files, the event listener initiates my static function on my main to create objects from this file.
The issue is that because the event listener continues the processing (after an indeterminate amount of time), the functions are no longer controlled by the main class.
[Code]...
View 1 Replies
Aug 4, 2009
I'm new to the object oriented stuff and I'm trying to learn how it works. Here's what I've started on - it's led to a few dilemmas. I have one flash file and two .as each with one class. In the timeline of the fla file, it reads:
ActionScript Code:
var FileObject:ScriptFile = new ScriptFile();
function onEnterFrame(){
FileObject.CallInput();
}
Call input is a function in "ScriptFile.as" that calls another function in "Input.as";
ActionScript Code:
class Input{
public function Input(){
} public function keyListener(target:Number):Number{
[Code] .....
In output, when I press Left, it will say -5 over and over again, and I'm trying to add to xpos value but that isn't happening.
View 1 Replies
Apr 26, 2009
Im trying to load some data, but I want to outsource the job of data loading to different classes.lets say XMLLoader class will get the url and return an xml file. The problem now is that such procedures are asynchronous, the class has to wait for XML to load and then call back the caller class and return the xml data.One way of doing this, is returning the data with a custom event. once its loaded then dispatch this event with the data in. However, I was wondering, if there is a way to do it with some sort of asynch call, meaning the caller class sends the request, then waits for a response.is such a thing possible? is there a better way or do I need to stick to my custom events?
View 2 Replies
May 16, 2009
I have a rather general question regarding OOP. How do constructor functions execute with multiple class extensions? I'm making an orbital physics simulation, and every spatial body is of the class SpaceObject, which extends Sprite. Then, I have all earth-type planets be of the class Earth, which extends SpaceObject. There are certain parameters that I'd like to set for every single SpaceObject (like position and size) in the constructor function, and certain parameters (like density and mass) that I'd like to set in the constructor of class Earth.But from the main timeline, when I create an instance of class Earth, I can only enter the parameters of the Earth constructor, ie
Code:
var planet1:Earth = new Earth(density, mass)
Or I can create an instance of SpaceObject:
[code]......
View 2 Replies
Feb 18, 2009
For some reason I can't get this nested set of functions to work, it executes the first tween and the tween invoked after motion of the first is finished but it doesn't ever get to the third!
ActionScript Code:
var t1:Tween=new Tween(p1,"rotationY",Strong.easeOut,90,0,50,false);
var t1x:Tween=new Tween(p1,"x",Strong.easeOut,-900,0,50,false);
t1.addEventListener(TweenEvent.MOTION_FINISH,onMotionFinished);
[Code].....
View 3 Replies
Feb 20, 2009
I have this function in the parent class:
ActionScript Code:
private m_colors:Array;
protected function set colors(clrs:Array):void {
m_colors = clrs;
}
Then, in my child class I want to call this as:
super.colors = [15, 255];
But it throws an error, it says:
Ambiguous reference to colors. If I do the same with a common function, not a setter one, then just calling it with its name in my child class works fine.
View 2 Replies
Jun 7, 2011
I'm trying to design a class that uses functions from multiple classes, but as Google tells me, you cannot extend multiple classes.
Here's my code:
Code:
package com.levelGenerator {
import flash.display.Sprite;
import flash.events.KeyboardEvent;
[code]...
How do I use the Keyboard functions and nextFrame() without extending multiple classes?
P.S. A language with object-oriented principles that doesn't allow multiple inheritance? Lame...
View 9 Replies
Mar 4, 2009
Is there a way to do that without using a bunch of "if" or "switch" statements, like shoving them all in an array?I have a rough idea of how it would work, but I have no idea how it would look in code.And just to clarify,I mean an order than can be changed.Otherwise I wouldn't need to think about this at all.
View 6 Replies
Jun 21, 2011
I'm creating a Flash file which pulls in external SWFs onto a container. The main SWF which has the container clip is called Main.swf then we have external swf's.
So basically, we have Main.swf, English.swf, French.swf, More.swf
More.swf has a load of buttons on it (contact.swf, about,swf etc etc)
To make things neater, I wanted to put all of my button code in the Main.swf, and I've got it sorted so that English.swf, French.swf and More.swf load correctly into holder_MC which is on Main.swf
Now, to get the buttons working, I can either have the code situated in More.swf (in which case, can I change the contents of holder_MC which is located in Main.swf from within More.swf? If so, how?)
Or, I can have an event listener to say that when Main.swf is loaded, create these functions to link to contact.swf, about,swf etc etc)
View 1 Replies
Sep 26, 2011
Say I have the following set up of classes.
Road - extends MovieClip Car - extends Road
Controller - extends Car
And I want to incorporate some common Mathematical functions in them all to make them faster e.g.(replacing Math classes with some speedy bitwise versions).
What is the best way to incorporate these functions into all of them without writing the functions in the classes or extending from class of the functions. Is importing the class into each the fastest way or is their a better way?
View 2 Replies