ActionScript 2.0 :: Swf File Function Within Another Swf File?
Jun 6, 2011
I'm having issues having a swf file with a sliding navigation controlled by as2 be functional when its housed within a lookbook/sliding slideshow employing as2 that's referencing the sliding navigation swf file. the swf file with the sliding navigation functions on its own perfectly, but when it's called within the lookbook file, only the arrow/graphic controlling the navigation/movement works. the image the navigation moves doesn't function when its housed within the lookbook swf file. Both files reference the same AS folder containing a greensock folder for tweening etc. Does anyone have any idea what i'm doing wrong within the code i've provided below? I'm relatively new to AS,
I am trying to send a function to my SWF file via a HTML file, and every browser works fine except for Internet Explorer.The test file is supposed to animate the graph when you mouse over the word click, and come to a halt upon mousing off of it.Here is the example URL:[URL]
*** begin *** <script type="text/javascript"> function sendToActionScript(str) { document["accelachart"].sendToActionScript(str); }</script> <a href = "#" onmouseover="sendToActionScript('fast')" onmouseout="sendToActionScript('slow')">click</a>
[code]....
Like I said before, it works on all browsers I tested (Chrome, FireFox, Safari) except for IE (7 or 8).
I'm having issues having a swf file with a sliding navigation controlled by as2 be functional when its housed within a lookbook/sliding slideshow employing as2 that's referencing the sliding navigation swf file. the swf file with the sliding navigation functions on its own perfectly, but when it's called within the lookbook file, only the arrow/graphic controlling the navigation/movement works. the image the navigation moves doesn't function when its housed within the lookbook swf file. Both files reference the same AS folder containing a greensock folder for tweening etc.
I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?
I am trying to write a class file using a .as file instead of writing code into the script tab of a .fla file.When I write stage.addChild(img); I get an error that stage is null. When I take out stage, and just write addChild(img); the code runs fine, but nothing appears on stage. Do I need to do something to set a stage active?
Is this because I don't have a Main class? My class is named after the file and I don't have a file named Main.Here is the code. As it is, it runs and I get the two trace outputs, but no graphic on my screen.
package { import flash.display.DisplayObject; import flash.display.Sprite; import flash.display.Loader; import flash.events.*; import flash.net.*; public class HelloWorldImage extends Sprite { private var background:DisplayObject, foreground:DisplayObject; private var url:String = "hw_jpg.jpg"; private var loader:Loader = new Loader( ); public function
I'm new to AS3, I have an index.swf that loads thumbnail images from this file (projects_list.xml). When the user clicks on a thumbnail image I want it to pass the selected thumbnails "link" node information to the callFull function. You can see that I have managed to get it to work when I use the real path name. I just can't figure out how to pass the link node text.
Projects_list.xml file set up Code: <project id="0" name="Con" thumb="portfolio/images/con/thumbs/web_1_200pix.jpg" htm="" link="portfolio/xml/desc/desc_con.xml"></project> desc_con.xml file set up (details file) [Code].....
I need a bit of assistance in a game making.Basically ve got the mysteryNumber inside thefunction working but I need functions in the other ActionScript files to access themysteryNumbe.So basically I have a:
Main.as (with the mysteryNumber function) function init():void {
i am making a game in action script,i have the regular scene (stage) with actionscript code functions, game intialization etc,and external AS file the works with that (assigned to some movie clip)can i run function that is on the stage from this AS file?
i tried this:
var main:MovieClip = MovieClip(this.parent.parent); main.increaseScore(); this.parent.removeChild(this);
it workes inside a movieclip, but not in external AS (class) file...
I have 100 swf file in one of my project. And there is one common function available in some of swf's. All these files are loadded into the main.swf file. Here is my Question, "If have the common funcion is there int the loaded swf file, how to trigger this funciton from the main.swf
I am relatively new to Flex/ActionScript, but I have been using a pattern of creating one file per function in my util package - with the name of the file being the same as the name of the function.
Like if the file was convertTime.as: package util{ public function convertTime(s:String):Date{ ... }}
This way I can import the function readily by doing: import util.convertTime; ... convertTime(...);
I like this way better than importing a class object and then calling the static methods hanging off of it, like this: import util.Util; ... Util.convertTime(...);
But, the more I do this, the more files I'll end up with, and it also seems a bit wasteful/silly to put only one function into a file, especially when the function is small. Is there another alternative to this? Or are these two options the only ones I have?
I have an index.swf that loads thumbnail images from this file (projects_list.xml). When the user clicks on a thumbnail image I want it to pass the selected thumbnails "link" node information to the callFull function. You can see that I have managed to get it to work when I use the real path name. I just can't figure out how to pass the link node text.
I have a simple f4V file that I am playing through the FLVPlayback component. It is working great. I even have a cue point in there, and it is firing off what it is supposed to do.
However, what I am curious about is if there is a way to detect when the file is done playing in order to fire off a function?
I suppose I could do it with a cue point, but I am going to need to do this a lot, and don't want to have to place cue points in all my videos.
I have found a lot of conflicting info on this subject, and am not sure how to do it, but it doesn't seem like it should be too hard.
Is there an AS file sniffer function in AS? PHP has two or more and so do most other languages (example is isfile(), exists() etc)...) but i can't seem to find one that works in flash.
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?");
So, my situation is like this: I have an XML file. I load the file to flash and display data. But this XML file can be changed by some other system, updates data,.. Now, i want to update my data in flash also. What i have done is use timer and check XML file every... let's say second. And i don't wanna do that...
I just want to know what the data in XML file changed and update at that time, otherwise do nothing.
So, i was wondering if that is possible. Is it possible for AS3 to get an event or something, when XML file changes.
I know i could do that with FMS or Red5 and shared objects... but let's say that that is not the best option in our case.
I have 1 .fla and 2 .as files. The first .as file is called documentClass and is the document class for the .fla. The second .as file is called tracePrac contains a function that traces a varible in tracePrac.as. I want to know how i call for this function in my documentClass.as code?
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];
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 load in ActionScript a swf file. So far no Problem, but I didn't found a way to access one of it's functions, the best thing would be if I could access the main function in the mxml part of the swf.
Here is the code of the main-mxml file that belongs to the swf that should load and access another swf[code]...
this swf is loaded into another swf using Loader and added with addChild(loader).i then need to call the init function from the parent swf. how can i do this? just calling
loader.content.init();
fails.another question is, what is the exact classname of this mxml file?
This is my main AS File. I tried to call the function onChangeState within the Main AS File to avoid that the _side.menuXXX addEventListener ist called when there is no such object. So i want the main as to call the onChangeState functionbut i always get this error[code]...