ActionScript 3.0 :: Load 2 Xml File Into One Public Function?
Aug 12, 2010If i want to load 2 xml file into one public function, do i need to have seperate private functions for both. do in need to declare 2 variables.
View 9 RepliesIf i want to load 2 xml file into one public function, do i need to have seperate private functions for both. do in need to declare 2 variables.
View 9 RepliesThe title says it all. Is there a way I can execute a public function (defined in a .as file,linked to .fla) when typing some script in a frame?i get this error:1120: Access of undefined property btn_upgrade1120: Access of undefined property comp_verapparently, flash does not let me use my public functions in my .fla .
View 6 RepliesHow can I run a public function in the DocumentClass?
View 4 Repliesthere is an interesting problem here:
How to return a value from a function to public?
Here is the code:
var df:String; //i declared it here
function onResult(e :OperationEvent):void
{
df = e.data.toString(); // i set it here
[Code]...
Is it possible to have a class with a public function [code]...
View 8 RepliesIf I override a public function in a base class, I would have thought that this override function is called and the original is ignored? though this doesn't seem to be the case...
public class AbstractScreen extends Sprite
{
public function AbstractScreen()
{
[Code]....
If my model dispatches a CHANGED_LANGUAGE event, the text in the views gets updated, But I also get a trace of "WARNING: need to override public function updateLanguage()"
I have been working on a Flex Mobile application using Flash Builder 4.6. I have 2 mxml 'views' in my project. In one mxml file, i have a function that grabs xml data. In my other mxml file, I have a refresh button that when depressed is suppsosed to call the function in the first mxml file in order to once again grab the xml data. I dont know how to call that function from outside the mxml file it is housed in. [UPDATE #2]* I thought I should share some more details about my issue.
It is a reddit client mobile app. It fetches the feeds, etc. In my main view called RedditReaderHomeView.mxml, I am using a splitViewNavigator spark component to house two other views like so:
[Code]...
Is it possible to override a protected function to a public.
View 5 RepliesIs it possible to call/envoke a public static function from JS? I can't seem to get it working and Im almost certain it cannot but I thought I would ask the community.
View 2 RepliesI'm using exanimo's statemanager class but I dont know how to use this function:
public static function set defaultStateID(defaultStateID:String):Void
how do I call this function?
I have (may be a simple solution needed) a problem with a class I've wrote. I've wrote a class named Navigation [URL] and in there I make all the buttons for the navigation. Next to that I have a Ipage class [URL] and in there I have all the pages stored. When I click on a button, the Navigation Class is called and tries to access the public function ChangePage in the Ipage class. In the ChangePage function I trace if the function is called and the trace comes back. So it works... BUT if I want to access another object it's not working. I can't even set sprites on visible = false.
View 7 Repliesi've put some public functions in one as-file. how an i call the functions in the .fla-code?
just calling the name "go();" doesn't make it:
I have two classes that I am trying to get to intereact, main.as which is the class attached to the stage and then light_mc.as which is attached to a movieclip.
I have a function in main that I would like to access in light_mc. I have set it up so main stores "this" in a variable called instance so I can easily access the functions within main.
Here is the code the main.as
Code:
package
{
import flash.utils.Timer;
[Code].....
I have a datagrid with itemRenderer in datagridcolumn as my custom component(c1). I am getting the dataprovider data in custom component by overriding the set data function, it is fine. But now my custom component(c1) is also having another custom component(c2).
Now the doubt is - how to get the dataprovider data in c2 component?
i want to know what i should put befor .mx_internal
override public function initialize() : void
{
var target:DialogButtons;
var watcherSetupUtilClass:Object;
[Code]....
Is it possible to externally override a public function of a class (as opposed to override via inheritance)?
For example:
Code:
Class Foo {public function doFoo():void {trace ("Foo");
}
}
Such that:
[Code]...
I know this is possible in JavaScript and ECMAScript, but the compiler won't let me get away with this kind of mischief in ActionScript, from what I've seen: It barfs up a 1168 Illegal Assignment error as soon as I attempt to assign a new function to doFoo.
I'm thinking specifically in terms of a "hot fix" solution where you deploy a small swf that replaces a specific chunk of code in a larger application, without the need to recompile/deploy the full application (or even see the sourcecode for that matter, just know the API).
I'm a bit confused in AS3, after long developing in 1 & 2. I'm doing a radioplayer, so I did set my document to be of document class: RadioPlayer. Here is everything ok, sound playing etc. Now my client wants to add a volume button. So I made a movieclip of class VolumeManager. Now, to change the volume, I want my clip to call a public function of RadioPlayer.
As RadioPlayer is the document class I don't know how to reference it inside VolumeManager to call its public function. In AS2, I would say: _root.setSoundVolume(volume);
What would be the scoping to reach a variable within a external class public function FROM a function on the main timeline?In menu.as public function buttonClick()Need to reach a starFunction variable(var starFunction = such and such.@fn) within an if statement within buttonClick function.On main timeline(menu.as declared on first frame main timeline as var menuH:Menu = new Menu()In function aboutUs()here is where I need to use that variable for an if statement
View 1 RepliesI am trying to create a public function, i have a decument class with all of my variables in it, I have worked out how to bring in external .swf files, now I need a way to have an even trigger something on a separate .swf So at the moment I have a flunction that works on the parent
stage.addEventListener(MouseEvent.MOUSE_MOVE, mousePosition);
function mousePosition(event:MouseEvent) {
if(mouseX>=125)
[Code]....
How do I call a custom component's public function from the main app. For example, I've got a timer component, MyTimer.In the main app, I want to call startTimer() or stopTimer().In the main app, I've got:
<visualcomponent:MyTimer />
In the component, I've got:
public function startTimer():void {
[code].....
I'm having some big issues with the scoping problems in my XMLConnect Class. I already found some things about the Delegate class online for setting the scope correctly, but my code still doesn't work the way it should Problem I need the XML data to be accesible in the public function Strip() because the user needs to put in some characters to strip from the strings in the xml file. Does someone known how to fix this scoping problems?
[Code]...
How can I return an object with an update data, that is pass in to a public static function?
GetDate.dayName(MyDate.setDate(1984,3))
//MyDate with new info (year, month) will be pass into GetDate.dayName
package hwang.time
[code].....
As I've been working with AS I've developed a collection of utility functions. For example:
$ cat utils/curried.as
package utils {
public function curried(f:Function, ...boundArgs):Function {
[Code]....
And I've found that, some times, I want to keep more than one public function in each file... But ActionScript restricts me to one public definition per file, if that file defines its self as being part of a package.
So, without creating a class with static methods, how could I get more than one public function in a single .as file?
im trying to load some HTTP URL from a xml file into a actionscript function..Its xml gallery i was successfull in loading the pics the description but im stuck at the url....The XML file is structured this way....
<Node myURL="images/cow.jpg" myTitle="Cow" myDesc=" libero sed dapibus aliquet, quam risus luctus lacus, vitae tincidunt dui diam dictum mauris. Morbi tempor, Nunc eleifend sapien ut odio pharetra eu aliquet eros fermentum. Proin et nisi vel risus eleifend pulvinar. "myThumb="images/thumbs/cow_thumb.jpg" onlinelink="http://vaughntucker.com/exflowers/"offlinelink="projects/web.swf"/>
I need to place the on and offline links into a onclick button fuction in flash.so i imported the xml data it works fine for the title so i used the same code for the url
here it is...
allOnlinelink.push(element .@onlinelink); allOfflinelink.push(element .@offlinelink);
the next function pulls the url of the current index
var currentWeb:String = allOnlinelink[currentIndex]; var currentCD:String = allOfflinelink[currentIndex];
[code]....
I'm working on a function that checks for 2 things to pull up the correct .swf file. I have to check for 2 things
·_global.theYear
·_global.theDate
Is there a different way I could write this function to say something like:
checkAll(_global.theYear, _global.theDate) = function(){
loadMovie(_global.theYear,_global.theDate".swf", 1);
}
So when a button is pressed, it runs the function above and fills in the variable. Names in the .swf name, does that make any sense, am I on the right track? Because all the .swf file names are all consistent such as 2009_18.swf, 2007_5.swf., etc. The only problem I see is there are 2 sets of buttons, one when you press it sets the _global.theYear variable and the other sets the _global.theDate variable.
So would one button look like this:
mybtn.onPress=function(){
checkAll(2008,_global.theDate);
}
And the _global.theDate would be set with what the current var is set at as?
I have searched for this everywhere but it seems like every answer is either overcomplicated or simply does not work, and I know for sure there should be a more simple way of achieving what I need. So, until today, I have always coded from within the timeline. But now I realise why I should code in separate class files. However, I still want to include snippets of code in the timeline for simplicity's sake.
[Code]....
can i call a class public function from another class? what's the cleaniest solution to do that?
[Code].....
a button wich is istanced in Menu, run showTheThumbs method, in Thumbs.
If I have a main.fla and main.as (where I written a Main class).
How can I access a public function (main.as) from main.fla?
is it better to use public variables or public static variables?
View 6 RepliesI'm trying to load a swf file within another swf file and then load different swf files from buttons.This is the code I'm using, but I can't get any of the swf files to load.
var Xpos:Number = 0;
var Ypos:Number = 0;
var swf:MovieClip;[code]...........