Actionscript :: Call A Class Method From ExternalInterface?

Dec 4, 2010

I can call JS functions with ExternalInterface.call('func_name',.args). OK

But what if I would like to call a js class instance method instead?

ExternalInterface.call('obj.method_name',.args) //this seems not to work

Is there any way of doing it?

View 2 Replies


Similar Posts:


Flash :: Call Anonymous Function From ExternalInterface.call() Method?

Nov 4, 2010

I need to get a javascript var in my Flash application. I like to be able to just set a variable in the javascript (client constraints) rather than define a function.

Can this be done? I am trying to use the ExternalInterface.call()

AS:

ExternalInterface.call("function(){return window.someVar}", null);

JS:

var someVar = "Test";

This does not work and I suspect it is because the ExternalInterface.call() does not like the anonymous function.

View 2 Replies

Javascript :: Reference The Html Object That Made The Call To SomeFunction Directly Using The ExternalInterface.call Call?

Jun 28, 2011

i have some actionscript that makes a

ExternalInterface.call('someFunction');

call.is it possible to reference the html object that made the call to someFunction directly using the ExternalInterface.call call?

Assume that the object that makes the call also has some Callbacks (via ExternalInterface.addCallback) that are accessible via javascript.

Currently:

Actionscript source
ExternalInterface.call("someFunction");
ExternalInterface.addCallback("someCallback",someASfunction);

[code]....

View 1 Replies

Actionscript 3 :: Call A Method From A Different Class In Current Class

Nov 4, 2010

I have a class, my document class, called SilkRoadTweeter. as I also have a class called User.as In my User class I need to call a method called nonce() I have tried this, trace(SilkRoadTweeter(root).nonce()); But I get the error, TypeError: Error #1009: Cannot access a property or method of a null object reference.

View 4 Replies

ActionScript 3.0 :: Call A Method From One Class From Within Another Class?

Jun 9, 2011

They are located in the same package and are both importing each other. I am trying to call a function from Class2 within Class1, but I don't know the syntax. I tried: Class2.godoThisThingNow(); But it gave me an error 1061, call to an undefined method. What's the proper syntax for this, and is it even possible in AS3?

View 3 Replies

ActionScript 3.0 :: Class A Call A Method From Class B?

Oct 12, 2009

From my LoadXML class I am trying to call a method, named onBackgrLoad, which sits inside the Main class. I made the method onBackgrLoad public. Inside the LoadXML class in the method ParseData I added an event listener. This is supposed to call onBackgrLoad but it doesnt work

[Code]...

View 3 Replies

Media Server :: How To Call A Method In Another Class

Mar 18, 2010

how can i use getUserID method in my main.as?

NetConnectionClient.as 
package com {
import flash.events.EventDispatcher;
import flash.events.Event;
public class NetConnectionClient extends EventDispatcher {

[Code]...

View 6 Replies

ActionScript 3.0 :: Call Method For Instance Of Other Class?

Oct 15, 2009

From my Main class, in the method onBackgrLoad, I am trying to call a couple of public methods (i.e. xmlData, hintergrund & numOfProducts) located in LoadXML. I keep receiving an error message that "loadXML" is undefined. I dont understand why because I clearly defined it in the main class:

PHP Code:[code].............

View 2 Replies

ActionScript 3.0 :: Call A Method In 'upper' Class?

Oct 21, 2009

Lets say I do this in one of my classes[code]...

how could I from _shader call a method in this class (where _shader was instantiated)?

View 6 Replies

ActionScript 3.0 :: Call A Method From A Instantiated Class?

Feb 25, 2012

I have this class called Main. And inside this Main class I have a method that I'd like to call from a the main timeline.

So on the main timeline I have instatiate the Main class like this:

var mainClass:Class = flash.utils.getDefinitionByName("Main") as Class;
var main:Sprite = new mainClass(this, mc1_mc, mc2_mc);
addChild(main);

Then on the frame after that, I try to access a function inside that Class like this:

main.prepareGame();

But I get this error:

Scene 1, Layer 'Layer 2', Frame 3, Line 61061: Call to a possibly undefined method prepareGame through a reference with static type flash.display:Sprite.

View 7 Replies

ActionScript 3.0 :: Call A Static Method From A Class Object?

Jul 15, 2009

I have a pointer to a Class object like so:

var temp_class:Class = getDefinitionByName(getQualifiedClassName(some_obj ect)) as Class;

I want to use it to call a static method 'can build' on that class, like so:

function can_build_ot(c:Class, qualifier:Object):Boolean {
if (c.can_build(this, qualifier)) {return true;}
return false;
}

When I do this, Flash CS4 AS3 tells me

1180: Call to a possibly undefined method can_build.

View 6 Replies

Flash :: Call Class Method From Inside Movie?

Apr 23, 2010

Can I call a java class method from inside a flash movie?

View 1 Replies

ActionScript 3.0 :: Cannot Call Private ... Method Of A Simple Class

Jul 31, 2010

I have .fla file where I have instantiated an object of a class( testclass.as ) like this in frame 1

[Code]...

View 9 Replies

ActionScript 3.0 :: Call Function From External Method In Same Class?

Jan 30, 2010

For some reason I cant figure this out,I have a function thats in a method in a class..I have a second method in the same class, trying to call the function from the second methodeg:

Code:
package com.sarin
{

[code].....

View 4 Replies

ActionScript 3.0 :: Use ExternalInterface.Call To Call A JavaScript Function To Launch A Lightbox Window?

Jun 22, 2009

I'm trying to use ExternalInterface.Call to call a JavaScript function to launch a lightbox window. So far I have this:

AS3:
flash.external.ExternalInterface.call("launchLB", "" + aUrl + "");
JavaScript:
function launchLB(url) {
alert(url);

[Code]....

I get the alert but I can't get the lightbox window to display. When my as code makes the ExternalInterface call I get what looks like a page refresh and a blank browser window.

View 1 Replies

Java :: How To Call Method On Remote Class Returned By Object

Nov 5, 2009

I have a RemoteObject returning a 'Schedule' class. I've created a client side RemoteClass to map to it. All properties of the class instance are coming in fine. I just not clear on how I go about calling methods on the class. How would I call a setter on startdate?

package classes.remote {
[Bindable]
[RemoteClass(alias="com.site.data.schedule.Schedule")]
public class Schedule {
public var id:int;
public var modifydate:Date;
public var startdate:Date;
public var enddate:Date;
}}

View 2 Replies

ActionScript 3.0 :: Know Public Method's Call Has Been Made From Outside / Inside Class?

Jul 16, 2009

I have to know if a public method has been called from outside the class or from inside. The reason is that depending on this, one of the actions to be executed in this method vary a bit.

View 3 Replies

Flash - Externalinterface.call Won't Call The JavaScript Function - Firefox 3.6

Feb 10, 2011

I have a function defined in JavaScript like so:

function fadeBack() {
alert("fadeBack called");
};

I call that function from my Flash file like so:

import flash.external.*;
flash.external.ExternalInterface.call("fadeBack");

This works in both Safari and Chrome, but for some reason Firefox won't ever call the function. Still, I can't figure this out. How can I fix it?

View 2 Replies

Actionscript 3.0 :: Call A Movieclip Using The String Class Together With It's Instance Name To Use GotoAndPlay() Method

Sep 20, 2009

I just want to ask if is it possible to call a movieclip using the String Class together with it's instance name to use gotoAndPlay() method. I know how to use the instance name and the method but then what if I want to use a string together with the instance name and the gotoAndPlay.

View 1 Replies

Flash :: Replace A URLLoader Call With ExternalInterface Call?

Feb 10, 2011

We have been given some code that does a URLRequest call which is really slow to respond, so I was looking to make it pull the data from the page, as it is already on the page.[code]I have tried to replace it with this (actionscript is definitely not my forte):[code]I am using addCallBack as that is what the editor suggested via autocomplete, unfortunately it doesn't seem to work. Unfortunately I cannot go back to the developer at this time.The error message is:Call to a possibly undefined method addCallback through a reference with static type flash.external:ExternalInterface

View 3 Replies

Flex :: Call To A Possibly Undefined Method Through A Reference With Static Type Class

Aug 1, 2011

I wrote a singleton class to keep track of some variables across my application.

I am getting a syntax error that I can't figure out, I am sure that I am missing something simple but it's been one of those days. Anyone see something wrong with my code?

The error is 1061: Call to a possibly undefined method setResult through a reference with static type Class.

My function in my singleton class

public function setResult(resultNumber:int, value:int): void
{
switch(resultNumber)
{

[Code].....

View 2 Replies

ActionScript 3.0 :: Call Javascript With ExternalInterface.call

Sep 29, 2008

I'm trying to call a javascript function from a flash movie. I'm using IE.

This one works:
AS3: ExternalInterface.call("test();");
Javascript:
function test()

[Code].....

...it says "undefined" insted of alert(666)...it seems that if i use a field in the function it simply stops working. (I'm accessing the page [URL]

View 2 Replies

ActionScript 3.0 :: Document Class Error 1180: Call To A Possibly Undefined Method AddFrameScript

Nov 28, 2010

Im getting this error: 1180C: as3_scrollbarAS3 ScrollbarsrcclassesMain.as, Line 1 1180: Call to a possibly undefined method addFrameScript. the actionscript in my .fla timeline is: _scrollBar = new FullScreenScrollBar(_content, 0x222222, 0xff4400, 0x05b59a, 0xffffff, 15, 15, 4, true); addChild(_scrollBar)

[Code]....

View 5 Replies

ActionScript 3.0 :: Error 1061 Call To A Possible Undefined Method AddEventListener Through Reference With Static Type Class

Jan 2, 2010

Error 1061  Call to a possible undefined method addEventListener through reference with static type Class

source:buttonsMenu.addEventListener(Event.ENTER_FRAME, moveMenu);

View 3 Replies

ActionScript 3.0 :: 1061: Call To A Possibly Undefined Method ShuffleKnuth Through A Reference With Static Type Class?

Aug 11, 2011

I get the above error. I did actually change a little code because I put it in it's own class.I call the below ShuffleArray class in my main doc class as follows:

ShuffleArray.shuffleKnuth(definitionsArray); [code].....

View 3 Replies

Actionscript 3 :: 1061: Call To A Possibly Undefined Method GotoAndStop Through A Reference With Static Type Class?

Dec 11, 2010

I've been using Adobe Flash CS4 for a couple of days. I've drawn a worm, with eyes and a mouth and these pieces are all MovieClip symbols. I have exported them to actionscript with the class name being the same as what they are (ie. the mouth MovieClip is exported as mouth). The mouth has 2 frames, one smiling and one frowning. I need to mouth to stay smiling at first, so in Frame 1 actions I wrote:

View 2 Replies

Flash :: 1061: Call To A Possibly Undefined Method GotoAndStop Through A Reference With Static Type Class

Mar 30, 2011

I see where i was going wrong however when i change the instance name like you said i 1120: Access of undefined property snakePart. all of this code btw is at document class level and the movieclips are in the library not on stage

View 3 Replies

ActionScript 3.0 :: Call To Possibly Undefined Method AddChild - Convert A Auto-scrolling TextField Into A Class

Jan 18, 2011

I'm new to oop and I'm trying to convert a auto scrolling TextField into a class. I guess it has something to do with there not being a stage when the class is instantiated but I'm not sure how to get around it. my code:

[Code]...

View 3 Replies

ActionScript 3.0 :: Error : 1061: Call To A Possibly Undefined Method AddChild Through A Reference With Static Type Class

Jul 13, 2010

I got this Error : 1061: Call to a possibly undefined method addChild through a reference with static type Class.
 
what I'm trying to do :I have create a new class called Graph and make it extends Sprite and  add a scroolpane to my stage and make an empty movie clip called content_mc and make the source of the scrollpane equals to content_mc
 
in the first frame i wrote this code
  
import Graph;
var graph:Graph = new Graph();content_mc.addChild(graph);

View 4 Replies

"call To Possibly Undefined Method" Trying To Do Utility Class?

Jun 16, 2009

I want to create a utility class (my first one ). Trying the package thing first I'm stuck with a "1061: Call to a possibly undefined method abc through a reference with static type Class"

I have:

1. packagetest.fla: empty except the assignment of the class in its properties: packagetest

2. packagetest.as (same directory as packagetest.fla):

Code:
package
{
import flash.display.MovieClip;
import example.*;

[Code].....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved