Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Native Language Calls



Is it possible to make native language calls in flash 5 or higher?

Thanks,

FrankenMoro



FlashKit > Flash Help > Flash ActionScript
Posted on: 07-21-2003, 09:31 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Dinamic Text Option For Other Language Than English (or Latin Language)
I tried to use the Dynamic Text option in other language than English (or Latin letters) but it doesn’t work. Can anyone please tell me how should I do it.

Translation Of Text From One Language To Another Language
hello
this is kishore raju
i have a problem
i want to translate some text from english to any other language using google translate (i.e i want to send the word to the google as a parameter and get the result)
so please send me the source for that .
urs
kishore raju

Scripting Language VS Programming Language
Dear Sir,
I cannot understand which is the difference between a scripting language(like actionscript or applescript) and a programming language (like java or C++).
I know that actionscript 2.0 is similar to javascipt. so it must be a scripting language.
but actionscipt 3.0 is most simmilar like java or C++.
so why it is still a scripting language?
Thank you upfront for your interest.

Translate AS1 To Native AS2
Hi all.

I want to translate this AS1 code to native AS2.
The strangest thing is that this code works if I compile it setting Flash Player 6 and AS2, but it doesn't work if I set Flash Player 7 and AS2. I think it's something related to variables path but I can't find any solution.


Any suggestion?


ActionScript Code:
stop();
var xmlUrl:String = "menu.xml";
var menuItemHgt:Number = 15;
var menuHeaderHgt:Number = 28;
this.attachMovie("McMenu", "menuClip", this.getNextHighestDepth());
var chldRoot:String = menuClip;
// menuItm
function menuItm() {
}
menuItm.prototype = new MovieClip();
menuItm.prototype.onEnterFrame = function() {
    if (this.startMove == 1) {
        this.counter++;
        this["button_" + this.counter].Move();
        if (this.counter >= this.myNodeCount) {
            this.startMove = 0;
        }
    }
    if (this.closed == 1) {
        this["button_" + this.counter].Close();
        if (this.counter <= 1) {
            this.closed = 0;
        }
        this.counter--;
    }
};
menuItm.prototype.Open = function() {
    this.initMove();
};
menuItm.prototype.initMove = function() {
    this.opened = !this.opened;
    if (this.opened) {
        this.myRoot.closeOpened(this.myIdNum);
        this.closed = 0;
        this.startMove = 1;
    } else {
        this.startMove = 0;
        this.closed = 1;
    }
};
menuItm.prototype.MovePlus = function(pxs:Number) {
    this._y += pxs;
};
menuItm.prototype.MoveMinus = function(pxs:Number) {
    this._y -= pxs;
};
menuItm.prototype.Move = function() {
    parId = this._parent.myIdNum;
    parTot = this._parent.myNodeCount;
    this.myRoot.updateViewPlus(this._parent.myIdNum);
    this._visible = 1;
    this._y = this.endY + (menuItemHgt - 2);
};
menuItm.prototype.Close = function() {
    parId = this._parent.myIdNum;
    parTot = this._parent.myNodeCound;
    this.myRoot.updateViewMinus(this._parent.myIdNum);
    this._visible = 0;
    this._y = this.startY;
};
Object.registerClass("menuHeader", menuItm);
Object.registerClass("menuItem", menuItm);
Object.registerClass("menuItemDivider", menuItm);


Thx to all.

Open A PDF In Native Program
Creating a presentation that will be on a CD/DVD for a client. Whant to link to some Spec and warranty sheets that PDFs. Have buttons created for the link. Would like to have the PDF open in Acrobat when clicking on the button. Tried the linking to local files method from the manual with no luck.

Using Fonts That Are Not Native To Windows
Is there anything special I must do when I publish to swf if I am using a non standard windows font and create text using the createTextField method or attach a mc that contains dynamic text? Will all the characters of the font be embedded in the swf file? How does Flash know which letters/numbers/etc. I want if they are created dynamically?
Thanks!

Customizing Native Events
This is a problem I keep encountering, and I would like to know how any of you generally go about solving it.

So, if I have an event and I need to pass some parameters to the resulting function, I will create a custom event class with which I can pass those parameters. HOWEVER, what do I do if I need to pass additional parameters through a native AS3 event -- for example, "MouseEvent.MOUSE_OVER"? I don't seem to be able to extend an existing event type (or can I?), but there are inevitably situations in which this comes up. For example, I currently need to pass information about a movie clip through a mouse_over event, and I don't know how to work around this.

Greatly appreciate any help.

Flash On OSX: Better Emulated Than Native?
Hi, just out of curiosity I've ran the Powerflasher flash benchmark both on my Macbook Pro under Mac OS X 10.4 as well as under Windows XP SP2 - emulated via Parallels Desktop for Mac. Guess what: Flash on Windows outperforms the Mac even while it's running in an emulated box.

That benchmark is available from http://powerflasher.de/bench/powerbench.html so you can try it yourself. My MBP (2.33GHz Intel Core2 Duo, 3GB RAM, ATI Radeon X1600 w/ 256MB, fast HD) was running OSX 10.4.10 when I first tried that benchmark. Back then I've got about 1938 points on OSX, vs. 2136 points when running Windows XP SP2 in Parallels Desktop build 5540.

Today, I've repeated the test after I've upgraded the machine to OS X 10.5. The Mac benchmark stays basically the same, while Parallels/Windows goes up to 3091 points, more than 40 percent better than under 10.4.10.

I seriously doubt that it's simply not possible to write a decent flash plugin for OSX. So my question to Adobe is: Why are you crippling flash performance on the Mac?

Regards,

Christian

p.s.: I do know about the issues involving the proper implementation of useful benchmarks. One might say that this benchmark is not representative, it might even be not correct at all. However: The Powerflasher guys have been flash specialists since the first days of Macromedia, are frequently seen as speakers on Adobe events and simply know how to make flash rock. Check out their portfolio to see what I mean. So while this test doesn't have to be the end of all benchmarks, it can certainly indicate that there's something seriously wrong with flash on OSX.

Does Cs4 Have Native Motion Blur?
Just like After Effects, press a button, Bam! Motion Blur. Does Flash now have that? Or is it still trapped in AS3?

Detail question on nha khoa Adobe group

Configuring Native Bandwidth
According to

http://livedocs.adobe.com/flashmediaserver/3.0/docs/help.html?content=03_configtasks_31.html

native bandwidth detection is configured on by default. How do you adjust this?

The docs imply that the BandwidthDetection container is already in the Application.xml file but on my FMS3 install, it isn't on either live or vod apps. Also if I add this markup the server complains about invalid config. I've tried adding as child of Application and child of Client in Application.xml.

Any ideas?

Thanks
.M.

Relative And Native Path Reconciliation
Okay, I have the following directories:

C:/Documents and Settings/user/My Documents/The Game/Game Images/picture.gif
C:/Documents and Settings/user/My Documents/The Game/Game Files/game.xml

When the xml was saved, the game image path was stored (relative) as:
"../../Game Images/picture.gif"


Now let's say I play the game.

When the game looks for picture.gif:

ActionScript Code:
myRequest = new URLRequest( "../../Game Images/picture.gif");
myLoader.load ( myRequest );
The game screams invalid.

Now, what I do have available to me is the nativePath to the game being played, as a string. Example:
"C:/Documents and Settings/user/My Documents/The Game/Game Files/game.xml"


My question is this:--> How can I make a full nativePath pointing to picture.gif with the only two strings I have:

Code:
"C:/Documents and Settings/user/My Documents/The Game/Game Files/game.xml"
"../../Game Images/picture.gif"

Thanks for any input and/or suggestion.

Accessing Native Code From ActionScript
Hello all,

I'm new to ActionScript, so please forgive my ignorance. Is there a mechanism by which native code can be called from within ActionScript?

Thanks

W.

Making Swf Native Resolution Higher
Hi everyone,

I am currently animating a musicvideo/story in flash MX 2004. It started as a school project, but I'm planning on entering it into a contest and feel I made it too small. Details I put in it are hard to spot and I generally feel this is hurting the film a bit. Is there an easy way to increase the size of the document without ruining the animation done so far?

You can see a little bit of the animation here: http://www.newgrounds.com/portal/view/366583

Also, any good tips on exporting to movie format? One where I maintain good picture quality and objects animate correctly?

Thanks,
Michael

Error 1034: Variables Cannot Be Native
Hi, I have an error that really has me confused...

The error output says "Type Coercion failed: cannot convert com.temp::CustomEvent@14b7b51 to com.temp.CustomEvent." However, LiveDocs describes the error number as "variables cannot be native."

Here's the setup:
Window1.SWF loads Window2.SWF, which loads Window3.SWF.
Window2.SWF listens for a custom event generated by Window3.SWF.

I've stripped out all unneccessary code and this error is consistent when running Window1.SWF. The error does not appear when running Window2.SWF directly. It only occurs when the custom event is set to bubble.

An error is thrown when the custom event is dispatched...

at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()

Also I did figure out a workaround... if I create a variable of type CustomEvent in Window1.SWF the error does not appear. Does this make any sense?

Error 1034: Variables Cannot Be Native
Hi,

I'm experiencing a problem dispatching a custom event class. A TypeError is thrown

at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()

The error says "Type Coercion failed: cannot convert <package name>::CustomEvent@14b7b51 to <package name>.CustomEvent."

Compile errors on LiveDocs describes the error as "variables cannot be native."

Also important to mention... It only occurs when bubbling is set to true.

Any info would be great!

Thanks!

Opening Files In Their Native Application
Hey,

How do i open a pdf file in Acrobat Reader thru flash. I have done this in past..but i dint remember thtt.

any idea.

Can An Externally Loaded Swf Interact With A Native Movie?
I've been trying to see if i could figure this out on my own, but i am finding a hard time doing it. So i decided to see if any of my fellow peers could figure it out. I am trying to figure out a way for an externally loaded swf file to interact with a native MC on the main timeline of the movie that loaded it. I've tried seeing if the main timeline could see if the EXT MC got to frame (?) then _root.gotoAndPlay(next frame). the actual coding is below, but it involves the native MC called doors and the externally loaded movie name portfolio2.swf. Any help would be appreciated.


*/PORTFOLIO BUTTON CODE./*
on (release) {
_root.doors.gotoAndPlay(2);
}
on (release) {
if (_root.doors._currentFrame=6) {
loadMovieNum ("portfolio2.swf", 1);
}
}

*/ATTEMPTED CODING FOR PLAYING REST OF FRAMES IN DOORS CLIP/*
on (release) {
if (portfolio2.swf._currentFrame(12)){
_root.doors.gotoAndPlay(7)
}
}

3rd Party Or Native Memory Tracking Commands?
Good day,

I'm on a hunt for flash memory tracking components. From what I've heard there are no commands within actionscript that will accomplish this. Is there a work around or a 3rd party tool that will let me track the amount of memory used by a flash application?

Regards,

Stuart

How Can You Use Browser's Native Scroller At Fullscreen Flash?
Does anyone know how to use fullscreen flash but still using the browser scrollbar for overflowing content? I've seen it on some fullscreen sites... Some help would be appreciated...

Niklas

FMIS 3 - Native Bandwidth Detection Accuracy
I am trying to setup a bandwidth testing app using the native bandwidth detection in Flash Media Interactive Server 3.
I have a cable connection which consistently shows around 4500-4800 mbps (5 mbps rated) on Speakeasy.net's speed test. The FMIS bandwidth detection shows anywhere from 500 kbps - 2100 kbps. I bumped the test time up to 15 seconds (from the default 2 seconds), hoping to get more accurate results, but it still way off.

Is anyone else having this issue? Any suggestions?

Create Native Flash Links With Dynamic Text?
I'm incredibly stumped on this one, and am wonder if it's even possible. Here's what I'm trying to do:

I have dynamic text that is being pulled in from an external XML document and I would like to have certain words be clickable to bring up a "popup" IN Flash with a definition. This will ultimately be part of a projector file, so opening browser windows with standard HTML links won't cut it, this needs to be a "link" to an event or frame within Flash itself.

I had one idea which is kind of crazy but would do it. If I could bring in the text from the XML field into a variable, split it by spaces (so it would split each word), and then put each word in a new text box positioned appropriately on the stage (all done on the fly with ActionScript) it could work. BUT, I don't know of a way to make a text box auto-size itself based on its contents plus I'm SURE this is a processor hog and a half. But, it's an idea and may hopefully get other people's juices flowing.

If anyone can help with this, even if only a bit, it'd be greatly appreciated. I think having the ability to this would be a GREAT thing to have in your bag of tricks.

Thanks!

Resizing .swf To 100% Of Screen While Keeping It's Content At It's Native Resolution
I've posted this question before on the design board because it deals with aesthetics but I think this may be a better forum for it.

I think the issue I'm asking about is how one might resize an .swf to 100% of a viewers screen height and width while keeping the content center screen and at it's native resolution. Below is a link to an example:

Just wondering how this might be achieved???

How do they get the BG image to go 100% of the screen height and width without affecting the resolution (clarity) of the main content section? Maybe I'm incorrect, but isn't the BG image imbedded within a .swf? When reviewing the html container documents source it showes the browser being told to display the "mainswf" at 100%.

My guess then would be that the content portion of the site is a separate swf that is loaded into the "mainswf" (only a guess though).
If this is the case, how is the resizing of the main movie not affecting the content's resolution?

Or...maybe...my assumption is incorrect...and their achieving this in an altogether different manner.

Anyone got an idea?

Thanks!!!!!

Storing A Data Object In Native Type To MySQL
I have an object which stores data for a user-editable dictionary, the format for which is as follows:

var dictOb:Object = {word0: "Hello",
word0Value: 78,
word1: "World",
word1Value: 83,
etc...

I'd like to be able to send this straight to the database as one chunk of data without having to convert it all to a string (& then have to convert it back later) to store in just one field in the database on the same row as my other user data (username, password, etc). I've read that you can do this with the AMF format and I've looked into amfphp but I can't find any helpful examples of how I might achieve this.

Has anyone done this before? Could you give me a good old nudge in the direction I wanna be going?

Goowaaan

* Genius Needed: Load External Swf At Native Size?
Hi,

I want to load an external swf into a container movie. The swf I am loading in could be any size and any aspect ratio. I have got my code successfully resizing the external swf and making it as large as it can be inside the container movie, maintaining the aspect ratio.

The problem is the swf comes in showing everything thats within the fla, whether it be within the movie area or not. As an example: I have a swf 800x600 with elements that move from off screen on the left to off screen on the right. The 800x 600 swf comes in 1100x600, showing the off screen elements.

Does anyone know if there is a way to size the imported swf to its native size? Using a mask to bodge it won't work as the main viewable content area could not be automatically calculated.

I've seen loads of posts about this issue but no answers!

Thanks,

Matt

Laco Tween Engine Versus Flash Native Tween
i am wondering if there is a way to put a delay (seconds) on the flashs' native tween class like you can on the laco tween engine... such as

Code:
#include "lmc_tween.as"
my_mc.tween("_x",100,1,"easeOutStrong",1.5,callbackFunction)
where "1.5" is would be the one and a half second delay before the tween starts. this is very useful to me because i dont have to use a callback function or an onMotionFinished function to start a new tween.

thanks in advance to anyone who can teach me

-frankf

API Calls
is there any way to make API calls in Flash like BitBlt, ShellExecute, or others

SwF CAllS
I'm doing an entire site out of flash and currently it's all in the same document. The navigation menu just jumps the play head to different frames to go to different pages. This is excessively stressful if you decide to change just one page as you'd have to continuosly shift the rest of the frames and it takes long to find a particular page.
How do I make each page in its own swf and then call different pages from the navigator?

Also, each time a different page is loaded, an animation occurs on top of the current page. This I do by using a motion tween before each and every page. Of course if I decide to change this animation I'd have to do the same with all the other pages.
How can I do this animation more intelligently? Notice: the current page must be visible behind the animation.

Set Calls Get
Hi.
I browsed and searched the forum but "set" and "get" really isn't good searchphrases so I didnt find any topics on this, thou I'm sure it has been discussed before.

I'm quite curious about the extra call to get method when using set.
Imagine this class:
class Foo{
private var _bar:String="";
public function get bar(){
trace("GET");
return _bar; }
public function set bar(value:String){
trace("SET");
_bar = "#"+value;}
}

Using it like this:
foo = new Foo();
foo.bar = "Hello";
trace(foo.bar);

produces the following output:
SET
GET
GET
#Hello

Why is the set method calling the get method?
After having some problems with this I stumbled across a discussion at http://www.darronschall.com/weblog/archives/000071.cfm. The comentators there suggests that it is due to chain assignments and that you would like to pass on the checked and possibly modified version of the value(!), but still the following code:
foo = new Foo();
var a:String = foo.bar = "Hello";
trace(a);

outputs:
SET
GET
Hello

So I really don't see the point in calling the get method from set at all.

Any thoughts or explanations?

Pretty print of the class code:







Attach Code

class Foo{
private var _bar:String="";
public function get bar(){
trace("GET");
return _bar; }
public function set bar(value:String){
trace("SET");
_bar = "#"+value;}
}

Calls Vs. Functions
I wrote an extremely long function that calls many other functions. I originally created it in Flash 4 using call methods. However, I am migrating a site from 4 to 5 and wanted to take o advatge of the new AS lib, syntax, (especailly functions,) creating external AS files and using #includes, and shared stuff. I opened my flash 4 created file in 5, it converted it for me, and worked fine. SO I started conerting the calls to functions and it worked...sometimes. Sometimes Flash would bomb out on me and make that set of objs assocaited with the script just disapeer of the stage - even if I changed back all the functions to calls, or dumped back in the old stuff from an old file, it seemes my file was corrupted and would no longer work...at all. This is bad. Has anyone had any problems with converting flash 4 stuff to 5 or experienced problems with using flash 4 scripts in 5, etc?

any help would be greatly appreciated as this is starting to become a large, tedious problem...

thanks,
Brian Riley

Calls Vs. Functions
I wrote an extremely long function that calls many other functions. I originally created it in Flash 4 using call methods. However, I am migrating a site from 4 to 5 and wanted to take o advatge of the new AS lib, syntax, (especailly functions,) creating external AS files and using #includes, and shared stuff. I opened my flash 4 created file in 5, it converted it for me, and worked fine. SO I started conerting the calls to functions and it worked...sometimes. Sometimes Flash would bomb out on me and make that set of objs assocaited with the script just disapeer of the stage - even if I changed back all the functions to calls, or dumped back in the old stuff from an old file, it seemes my file was corrupted and would no longer work...at all. This is bad. Has anyone had any problems with converting flash 4 stuff to 5 or experienced problems with using flash 4 scripts in 5, etc?

any help would be greatly appreciated as this is starting to become a large, tedious problem...

thanks,
Brian Riley

Function That Calls Himself
Hi,

I've got another problem...

Code:
map = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
colom = 22;
rij = 16;
depth = 100;
spacing = 25;
rocks = [];
komtvoora = false;
komtvoorb = false;
komtvoorc = false;
komtvoord = false;
function buildMap(colom, rij) {
for (i=0; i<rij; i++) {
for (j=0; j<colom; j++) {
rock = _root.holder.attachMovie("rock", "r"+i+"_"+j, depth++);
rock._x = j*spacing;
rock._y = i*spacing;
map[i][j] = "r"+i+"_"+j;
getal = Math.round(Math.random()*2)+1;
rock.type = getal;
rock.gotoAndStop(getal);
}
}
trace(map);
}
buildMap(colom, rij);
_root.holder.onPress = function() {
var x = Math.floor(_xmouse/spacing);
var y = Math.floor(_ymouse/spacing);
deleteBall(x, y);
};
function deleteBall(x, y) {
var rock = _root.holder["r"+y+"_"+x];
var rocko = _root.holder["r"+(y+1)+"_"+x];
var rockb = _root.holder["r"+(y-1)+"_"+x];
var rockl = _root.holder["r"+y+"_"+(x-1)];
var rockr = _root.holder["r"+y+"_"+(x+1)];
if (rockr.type == rock.type) {
for (i in rocks) {
if (rocks[i] == rockr) {
komtvoora = true;
}
}
if (!komtvoora) {
rocks.push(rockr);
deleteBall(x+1, y);
}
}
if (rockb.type == rock.type) {
for (i in rocks) {
if (rocks[i] == rockb) {
komtvoorb = true;
}
}
if (!komtvoorb) {
rocks.push(rockb);
deleteBall(x, y-1);
}
}
if (rockl.type == rock.type) {
for (i in rocks) {
if (rocks[i] == rockl) {
komtvoorc = true;
}
}
if (!komtvoorc) {
rocks.push(rockl);
deleteBall(x-1, y);
}
}
if (rocko.type == rock.type) {
for (i in rocks) {
if (rocks[i] == rocko) {
komtvoord = true;
}
}
if (!komtvoord) {
rocks.push(rocko);
deleteBall(x, y+1);
}
}
rock.removeMovieClip();
komtvoora = false;
komtvoorb = false;
komtvoorc = false;
komtvoord = false;
}
The code works, but not always. I've uploaded an example:
klik

As you can see, if you click, it doesn't delete ALL the balls.

Does anyone have an idea why this is?

.swf That Calls For External .swf
Hello,

I have a flash project I'm working on where on .swf (the shell) calls for external movie clips .swfs (the content). In one of the content .swf's, I have a continous-feedback button scrolling action that works fine when I test the content .swf, but when I view it through the shell .swf, it doesn't work. Is this because I have to have the path absolute from the root of the shell .swf? Currently, its set to a relative path in the actionscript.

Jason

XML And Timed Calls
Hi,

I have a few questions regarding Actionscript as im just starting to learn it. I have been programming in Java and php for about 3 years to give you an idea where im at.

From what i have gleaned so far there is no User done Threading in flash is this correct ?

I wish to make an XML call every few seconds (between every 2sec - 8sec). To get updated data.

I tried to use a while (true) loop but it just warned me that it was killin the system as there seems to be no Sleep/Pause function.

What are the methods to get around this? All i need is to every few seconds to recall this XML file so that i can update the GUI/Movie.

Many Thanks,
Richard

ExternalInterface Calls
Hi all

I'm using Flash and JavaScript to push data to a database. I have been using the ExternalInterface.call method, because it works with the latest browsers and I get a response back whether the call was successful or not.

The problem is that when ever I make one of these calls, the Flash freezes for a number of seconds and I get the spinning pinwheel or hourglass (depending on my computer). And it seems like the more of these calls I make, the worse the lag gets.

I noticed doing some searching that there are people complaining about the same thing, but there doesn't appear to be any solutions out there that I could find.

So my question is this. Is there a way to use ExternalInterface.call in tandem with some progress bar? Something like with loadvars where you can track the bytes sent with an onEnterFrame?

If not, is there some other method I should use?

Thanks
Chris

AS2 - Function That Calls Itself
Hey guys, im using a function that iterates through all nodes in an XML tree, and then calls itself again if any of the nodes it is looking at has a set of child nodes, so in other words it multi-dimensionally loops through the entire XML tree.

heres my code

ActionScript Code:
function loopThroughNode(childNodeSet:Object, containingArray:Array):Void {    //    for (var i:Number = 0; i<childNodeSet.length; i++) {        var tempObject:Object = new Object();        //        setupData(tempObject, childNodeSet[i].childNodes);        //        if (childNodeSet[i].childNodes.length>2) {            for (var k:Number = 2; k<childNodeSet[i].childNodes.length; k++) {                //                var NewNodeName:String = childNodeSet[i].childNodes[k].nodeName;                tempObject[NewNodeName] = new Array();                //                loopThroughNode(childNodeSet[i].childNodes[k].childNodes, tempObject[NewNodeName]);                //            }        }    }    //    containingArray.push(tempObject);    //    return;}

one question i have is - am i correct in my assumption that while variables declared within a function are not accessible anywhere but within that function, if a function calls itself, any loops within that function that use a variable such as "i" will be affected seeing as "i" is accessible within the function?

if so, how do i get around that? currently my function loops through all the way down to last child node it can find along the first branch of the XML tree, but then doesnt continue looping through the other branches...

anyone who understands what im trying to do and has any suggestions would be much appreciated

System Calls?
hello all,

this is my first post here and i hope it's not a dumb question...i've been looking all over (unsuccessfully) for a way to do this. so, here goes:

is there a way other than loadVariables or getURL to have flash mx interact with the server (for example, a perl script)? meaning, do all such interactions have to occur with a webserver running (ie access to scripts in cgi-bin)?

please forgive me if this is a dumb question.

james

Function Calls From SWF
I have constructed a multi level template that eventually relies upon an inserted movie (using Generator) calling root level functions.
The inserted movie does NOT contain any functions, they all exist in the master "template".

It appears that I can set variables and the like for root level, but cannot call the actual functions that are at root level from the imported movie ?

Any Ideas ???

Does anyone know when a movie is compiled into an swf does this convert a function call eg: _root.myfunction(param1) into an address relative to the swf or the environment in which it sits ???

I just need to find a way to get a SWF into a template and calling functions from within that template.

Cheers

Juglugs

Please Help With Multiple Variable Calls..
Hi there.. Im Ray..Nice to meet you..
I have a problem....I dont know what the hell Im doing..LOL.
Here's what I have: I created a flash movie that contains the names of and titles of the administration of a major colleg..It was supposed to be just one time thing, but they liked it so much they want to incorporate it into the website..My problem is the name need to be updated when I person leaves thier position..Heres what I tried: I deleted the names out of the buttons, so now I just have titles. In place I created a dynamic text box so the persons name could be updated in the members.txt file..

I got it to work (by hacking the hell out of it) by calling a variable like (ScholarName1 = somename) I can get it to work with one person, and I need all the names in one text file and I will have multiple variable calls, around 10 names per scene, all at the same time..
I also hakced to piece your multiD script and got it to work by removing everything in the VAR after the second =, but its slow and I want to do this the correct way.


=================================
Heres what I used:
=================================

Frame 1.)

loadVariablesNum ("./members.txt", 0);

Frame 2.) Frame name is : loadvar 1

if (scholar1 ne "")
{
gotoAndPlay ("govar 1");
}

Frame 3.)

gotoAndPlay ("loadvar 1");


=========================
=========================

Thank you all to pieces if you can help...Im trying to learn about variable and how you use them, although Im a scripting fool, Im a kick butt artist.

thanks Again.....Ray Russell

OnClipEvent(mouseDown) Calls All?
Okay, here's the scoop. I'm helping a friend build a flash site to house a LOT of information that is categorized by a person's name. Basically, Flash loads the first 60 names from a text file, and displays them each in their own button on the screen. Then, the user can click "next" to view the next 60 names, etc...

Now, to be able to keep myself from going mad with 60 different functions (for each button), I've automated a lot of the process. I've used "attachMovie" to load a pre-set button instance (with a Dynamic Text Field) onto the movie, and it is assigned the same name as the person who's name occupies the button. But here's where the problem arrises. To be able to communicate to the Dynamic Text fields, I had to keep all of the used instances (and their parts) behaving as Movies, so that I could name them, and later call them. I am using onClipEvent(mouseDown) to query the clicked instance for it's own name, and to send that to a pre-defined function to load the information on that person. But for some reason (unbeknownst to me) the (mouseUp) seems to be a universal call to ALL of the instanced buttons, so my function keeps receiving the first name loaded, regardless of which button I click. After adding debuggin tidbits, I am seeing that ALL of the buttons are having their (mouseUp) commands executed no matter when or where I click.

I can't make it a Button (that would be too easy) because then I lose the Heiarchy to send the name to the Dynamic Text. And Movies don't support any onMouseEvent parameters.

Does anyone know of a workaround, or am I simply approaching this from the wrong direction?

Thanks to all of the geniuses who have guided me here before, and probably will again!

Dynamic Function Calls...possible?
Is it possible to dynamically call a function..1 of 2 functions in the pTest object:


Such as...

//=================
// functions are: myFunction1() and myFunction2()
//
//================

nPick = Math.round(Math.random()) + 1; // 1 or 2

pTest["myFunction" + nPick + "()"];

...or any other variation?

Thanks,
Richard

Dynamic Variable Calls
Hooowdy! I want to call different variables depending on what section I am in. I've tried variations of this:

Code:
current_section = 1;

section_1_total = 16;
section_2_total = 12;
section_3_total = 9;

total_in_current_section = "section_" + current_section + "_total";
...but no luck. I'm sure I've just got the sytax wrong. How can I pull this off? Thanks!

JavaScript Calls From Flash
Hi, when calling JavaScript functions from flash can you only call them using getURL action as this makes the annoying hyperlink click noise -
1) is there anyway to disable clicking noise
2)Can you call a JavaScript () using another action such as LoadVariables or a FSCommand
3)if you can use FScommands instead, are these supported by OS X with IE 5.2??

thanks for any help

Preloading Swfs From Db Calls?
I am going to be calling variables from a server side script. The db is calling variables such as :-

clientName1 = "clientTest";
clientIngress1 = "blah blah";
clientImage1 = "clientImage.swf";

The images (the external swfs) are created server side and are literally a 1 frame swf with jpeg in it.

Can i somehow preload all the swf's before i execute an action to view them in the root movie that will be displaying them?

Many thanks

m00p

Dynamic Function Calls?
Hi.
I am trying to call a 2 different functions from 1 line of code.
I have seen a few posts on this, but cannot get any of them to work.

What I am trying to do is:

I have 2 fuctions. 1 called "func1" and 1 called "func2".

I am trying to call either one of them with this line:

eval("func" + Block + "()");

Where 'Block' is a variable that contains either 1 or 2.

I can't get this to work. Can you help???

Thanks in advance.
Damian.

2 GetURL Calls, But Only One Works
I got a button in Flash(MX) with 2 getURL calls attached to it.
When 1 of them has a reference to a getURL(java script:function) then only the second getURL works. What happens to the first call?
If I comment out either one the other one works!

PHP Code:




on (release) {
    getURL("java script:myChromeless.openChromeless()");
    getURL("goodbye.html", "_self");
}






Some other ppl have the same prob.

Here you'll something that may be a solution, but i don't understand it (still little bit newbie).

What am i doing wrong?

tia,

-snap

Function Calls In An Array?
Hi

I'm trying to populuate an array with function calls and then I want to activate the functions by clicking a button (gather) in the order that they are populated in the array. This is my first attempt at an array and i'm having no joy. How do I get the array to play the functions in the correct order? This is my script on the root level frame:

function playSound() {
intro2 = new Sound();
intro2.attachSound("intro2");
intro2.start();
}
function playSound2() {
section1 = new Sound();
section1.attachSound("section1");
section1.start();
}

myArray = new Array();
_root.gather.onRelease = function() {
_root[myArray[0][1]];
trace(myArray);
};


This is my script on the 2 buttons to popualate the array. Am i populating the array with the functions?

on (release) {
_root.myArray.push("playSound");
trace(myArray);
}


on (release) {
_root.myArray.push("section1");
trace(myArray);
}


I think i'm a long way off the mark and would really appreciate some help.

Thanks
boonos

A Prototype That Delays Then Calls Itself
I'm working on a function (defined as a class prototype) that needs to iterate a given number of times. I'm able to make most of the function work by a simple FOR loop. But because one of the steps is a statement that needs to evaluate .textHeight on a just created text field I need to introduce a slight delay in processing.

So I figured I'd take the FOR loop out and create my own counter. Somethign like:

Code:
ClickGUI.prototype.displayClicker = function() {
var i = currentIndex;
myRoot.createEmptyMovieClip("myClicker"+i, ++this.depthCounter);
myRoot["myClicker"+i].createTextField("clickerLabel_tf", ++this.depthCounter, 0, 0, 0, 0);
[text formatting stuff skipped here]
//the height of the following clip depends on the above textHeight
myRoot["myClicker"+i].attachMovie("flexButtonGrey", "buttonGrey_mc", ++this.depthCounter);

//so build in this pause:
var tempInt = setInterval(function () {
myRoot["myClicker"+i].mc_buttonGrey.gotoAndStop("Button" + parseInt(myRoot["myClicker"+i].clickerLabel_tf.textHeight/17));
if (currentIndex < numClickers){
currentIndex++; //increment me
//do some visual stuff
myRoot["myClicker"+i]._x = myPos[0];
myRoot["myClicker"+i]._y = myPos[1];
ClickGUI.easeIn(myRoot["myClicker"+i]);
//now recall self
ClickGUI.displayClicker();
} else {
clearInterval(tempInt);
}
}, 50);
}
So I want the interval to run a given number of times (currentIndex < numClickers) and then clear itself.

But Flash likes this stratagy / syntax not at all. ...In fact, so little that i'll be rebooting while you guys consider what my mistake is.

Multiple 'createEmptyMovieClip' Calls
I have a function that draws a chart dynamically. I want to make multiple calls to this function, passing parameters to tell where and how big to draw the chart. The function works fine for one chart, but I can't seem to get the createEmptyMovieClip to create a unique name with each call.

I create the mc like this:

this.createEmptyMovieClip("graph", Level);

Then I set some parameters like this:

graph.width = XSize;
graph.height = YSize;

All that works fine, but when I tried to make multiple calls,
I set each mc instance like this:

this.createEmptyMovieClip("graph"+i, Level);

which appears to be correct, but how do I set the parameters?

This certainly doesn't work:

graph+i.width = XSize;
graph+i.height = YSize;

Appreciate any help you can give. Thanks in advance.

IE Problems With PHP Calls In Flash
Having a strange problem with a Flash game I'm working on, would appreciate some input.

The problem area is with a highscore table that is called after the game is over. The highscore table works like this: Upon entering your name and hitting a button, the following code submits your score to a page called highscores.php:

URLstring="http://www.myurl.com/highscores.php?subscore="+score+"&playername="+pla yername;
loadVariablesNum(URLstring, POST);

This page compares the submitted score to all the previous scores (contained in a text file), then arranges them with a bubble sort and writes the rearranged scores back to the text file.

After this is done, the movie goes to another frame that uses the following code to populate variables that are used to display the top names and scores in dynamic text boxes on the highscore page on the following frame. The code for that frame is as follows:

highScores = new LoadVars();
highScores.load("http://www..myurl.com/getscores.php");

This all works perfectly well...except when the movie is played in IE. When IE plays the movie, the score is submitted properly but the scores displayed are not up-to-date; it's as if you hadn't gotten a high score. The submitted score is not displayed until the NEXT time you play and view the highscore table.

I can't figure out what's causing this. It seems like maybe IE is "preloading" the URL in an attempt to speed performance, but trace tests have confimed that my score variables are not being set before the getscores.php page is being called.

Can anyone shed some light here?

Copyright © 2005-08 www.BigResource.com, All rights reserved