ActionScript 2.0 :: Call A Php File Onload?
Feb 2, 2010Is there a way to fire up a call to a php on my website everytime the .swf file is loaded?
View 1 RepliesIs there a way to fire up a call to a php on my website everytime the .swf file is loaded?
View 1 RepliesI'm trying to call a function with a onLoad function in a Class
XML_var.onLoad = function(success) {
anotherFunction();
}
I've created a multi-framed flash file that's calling multiple variables from an external php (text) file. I'm using an onload command to do this and for some reason the variables seem to "disappear" once I leave the first frame (where the onload and load commands are)I'm figuring that my problem has to do with 'variables scope'. I've read the article on this site but I don't know actionscript well enough to proceed.I ultimately want to do away with using multiple frames by using multidemsional arrays and for...next loops, but this is what I have to work with (for now). I'm going crazy trying to get THIS to work.
[AS]
// ##################################
// FRAME 1
[code]......
Is there a way to fire up a call to a php file on my website everytime the .swf file is loaded?
View 1 RepliesCode:
onLoad=function() {
my_text=new LoadVars()
my_text.load("C:\Documents and Settings\Wrkspace\Desktop\flash_wordlist.txt");
my_wordlist="";
} my_text.onLoad=function(success) {
if(success) {
my_wordlist=(this.var_wordlist).split(" ");
trace(my_wordlist)
}}
The trace doesn't showup at all....by the way, this is in the first frame of the timeline, and i am trying to load a wordlist and then use the words in my program separately. Is it because flash loads the text file slowly? I am using flash 8, AS2.
I'm building an external class file that other developers can use to include a set of functions that essentially read and write data to MySQL via PHP.
The idea is that their AS2 script calls a method in my class which uses LoadVars to verify the data passed to it and write it to a database, and then it returns a value back to the AS.
I'm having a problem where the delay in waiting for OnLoad means that the calling AS function gets an undefined value back. i.e.
var returnValue=myClass.myMethod(params);
This (I assume) is setting returnValue instantly, despite the fact that LoadVars can take a little while to work.
What's the recommended/normal way to deal with this? I don't want to have to bring the OnLoad part of the process back into the developer's script, it would be nice to keep it all in the class. is there a way to make the calling script wait for a response?
I am writting an image gallery that loads one intial xml file named galleries.xml.From this point each xml node loads a XMl file for that gallery that holds all the images.The problem arises in the fact that to do this I need a onload function within an onload function.Onload functions dont accept parameters so I can pass down the variable that shows what loop the gallery loop is on as I need that in the function that holds the images.
View 4 RepliesI have downloaded a template from [url].... And there is a xml gallery for images. I want to use my movie in swf instead of one single image from slide show.[code]...
View 1 Repliesi 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]....
I was going through some sample codes and i found that some files had .as extension and others had .fla. One animation used only .fla to run and the other animation used both .fla and .as to run. My question is how do i call a .as file from .fla file?
View 5 RepliesI am using flash CS3 and the code I need is in ActionScript 3.0.
Suppose, I have a .swf file(viz., file1.swf). Now, i am developing one more .swf file(viz., file2.swf), in which I need to execute file1.swf when a CLICK event is listened on button present in second file(i.e., file2.swf).
I am facing some problem to call a swf file via xml when this xml file loaded it calls another swf file which includes a new xml file. now if i call this nested swf calling without xml it works but in case case of xml it is not showing the result. i m confused. how to nested xml file calling done in as2/as3.
View 4 RepliesHow do i call a swf file within a swf file?
on (press) {
loadMovie("2.swf","showmovie");
}
i tried using this code but... (this code is on a button in 1.swf and i want it to open 2.swf after click)
I'm a complete newbie when it comes to actionscript. Basically for a uni project I have to design an MP3 player in flash. I've modified the snow script from this site slighty, in order for it to display track names, artists and album name instead of snowflakes. The script looks like this:
Code:
this.children = new Array ();
function makeFlakes ()
snowflakes = 75;
do {
[Code]...
In short: how can i call a function in another .as file? Is there a way to make header files or forward declarations in AS3?
Output
Code:
BREAKPOINT1
1061: Call to a possibly undefined method playerCharMove
through a reference with static type Class.
game.fla layer 1 frame 1
[Code]....
So I've created an xml slideshow using Flash Slideshow maker pro, because its very fast and versatile and I need to update my galleries frequently. I'm trying to load it into my flash site using the following AS3 script:
var Xpos:Number = 20;
var Ypos:Number = 20;
var swf:MovieClip;
[Code]....
and when I do that, it seems to be unable to read the xml file anymore and I get a "load fail" message.
On looking at the error message, its trying to call the xml file from the same folder that the site is saved in. How do i tell it to get the xml file from a different folder?
I have want to tell a movie instance to play from a class:
`package com
{
import flash.display.MovieClip;
public class Global extends MovieClip
[code]....
pic1m is the class, but I get 1120 undefined property error.If I just put pic1m.play(); in my main timeline action layer it works fine, but I need the function playMask to be global in AS3...
I have a m.c. calling for a swf file as such:
Actionscript Code:
mcl.loadClip("splash.swf", emptyMC1);
How do I get it to call for a html file instead??
I have a function called test in my first frame of my fla file all it does is trace HELLO WORLD
All i want it to do is call it in my AS file no I cant no such function exist?
[Code]...
I'm calling a function[code]...
View 3 RepliesI want to use AS3 call EXE file under HTML,because there was a demo.swf file,but now it has been converted demo.exe,so I wan to play this demo.exe,I use following code to run demo.exe,my class extends Sprite,
fscommand("fullscreen","true");fscommand("allowscale","false");fscommand("showmenu","true");fscommand("exec","demo.exe");
When I run above code,I can't see any information,where is wrong?
I have made a flash banner where there are 5 buttons.So I want that whenever I will click those buttons a light box will come out.For that I am using Fancy box.So how to call fancybox in a flash file?
View 2 RepliesHow to call the stage from as file. Actually, I need to access the mc which is in library. One way of getting it is by adding it in the fla file and then sending to as file. Is there a way to get the mc directly from library to as file.
View 2 RepliesI have a movie that I need to update every 60 seconds, calling a PHP file, which provides update server time/date, and (on-the-fly updated) air times for an online video. Is every 60 seconds too CPU intensive?
View 2 Repliesmy xml file is as such:
Code:
<menu txt="THIS ITEM FIRES A FUNCTION IN FLASH" txtcolor="0xFFFFFF" menuaction="myFUNCTION" />
myFUNCTION is a function inside of flash, how can i possibly trigger this?
i did some searches but i can't find the sollution:
i read upon asfunction:myFUNCTION, but it simply doesn't work
this is my relevant flash code
Code:
myFUNCTION = function()
{
trace ("am i called?");
[Code]....
I have a 2 swf files. Within the main swf i have a button that I want to call in a second swf when it is clicked. The code I have for this looks as below.. Btn_interiors.addEventListener(MouseEvent.CLICK,lo adGallery); function loadGallery(event:MouseEvent):void{ var l = new Loader(); addChild(l); l.load(new URLRequest("portfolio_interiors.swf"));
} The problem I am having is that when I enter the code and "Check Syntax" no errors appear, however when I preview the published swf and click the button, i get the following message....
[Code]....
How to call the stage from as file. Actually, I need to access the mc which is in library. One way of getting it is by adding it in the fla file and then sending to as file. Is there a way to get the mc directly from library to as file. One more, Is there any way to access the variable declared in fla file from as file.
View 6 RepliesI like to call a function that is outside of the class file.
for example
main.fla
Code:
function callmepls(){
trace("yes");
}
[Code].....
I have to call a .swf having parameters from another flash file. I made this using:
var context:LoaderContext = new LoaderContext();
context.parameters = {
'param1': 'foo',
'param2': 'bar'
}
loader = new Loader();
[Code]...
But now I have the need to embed the .swf, not dinamically load from an external url.
I have created a mxml file , and i would like to display it in a pop up window. i have alrdy done the pop up window, but i couldn't display the mxml file i have done. I am not trying to call the pop up window in the mxml page. this is my popup window i have done:
[Code]....