ActionScript 2.0 :: Grabbing A Variable In A Function From An External Swf?
Feb 21, 2007
I need to trace out the variable currentClip from the following code that is in an external swf. The parent swf calls the external swf empty_mc via loadclip.
[AS]
function setNextClip():Void
{
currentClip = clipArray[iterator];
[Code]....
View 4 Replies
Similar Posts:
Jun 11, 2005
I have 36 buttons on my stage that are named [thumbBut0, thumbBut1, thumbBut2,..., thumbBut35]. Each button is a thumbnail image. I want to have it so that when the user clicks on a given thumbnail, the full-sized image corresponding to the thumbnail gets loaded and viewed...yada, yada, yada... So, if the user clicks on thumbBut25, the 25th image gets viewed...
My question: is there some cool way that I could avoid writing 36 different (although they would be similar) "_level0.thumbButXX.onRelease = function()..." type things for each of the 36 buttons. In other words, when the user clicks the instance "thumbBut25" something grabs the "25" part out of the instance name, converts it to an integer, and passes it on to a function that loads up the image that corresponds to "25"?
View 3 Replies
Mar 23, 2009
I'm having trouble adjusting to the way functions pass in AS3. How come when I say "this" it doesn't know I'm refering to AudioTrack?
PHP Code:
var AudioTrack:Object = new Object();
AudioTrack.myVar = "Hello";
AudioTrack.onComplete = function(){
[Code]....
View 2 Replies
Aug 6, 2010
I have an external log file which name changes each session, with the format XXXXX.log
I need to load it inside a swf to show its data, but each time the logs name is different, I need to open the .fla, changing the name of the file and then republishing the swf.
So I have made a simple script to load another .txt, to type manually in it the 5 number of the logs name and load it externally inside the swf:
Code:
var logNumLoader:URLLoader = new URLLoader();
logNumLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
logNumLoader.addEventListener(Event.COMPLETE, loadedLogNum);
[Code]....
While I cannot assign the value of logNum to the last function, the .log cannot be opened.
View 2 Replies
Aug 4, 2010
I have an external log file which name changes each session, with the format XXXXX.log I need to load it inside a swf to show its data, but each time the log's name is different, I need to open the .fla, changing the name of the file and then republishing the swf. So I have made a simple script to load another .txt, to type manually in it the 5 number of the logs name and load it externally inside the swf:
[Code]...
View 2 Replies
Jan 29, 2012
I have a public variable and I am trying to set it, then read it from a different function:
public var str:String;
public function DailyVerse()
{
function create() {
[Code]....
My trace results says null. Why does it not give me "hello"?
View 1 Replies
Jul 13, 2011
I am tasked with trying to do a slideshow of sorts, and I need to pull the filename of the slide from an xml file and display it, as well as display the appropriate slide notes in a text box.
the xml file they gave me is formatted as below, and with my current code (also below) I'm able to (trace) list all the file names, but I am missing how to address the filename on just one slide � say, slide 1, so I can then load it into a loader.
here's my code
Code:
import flash.net.URLLoader;
import flash.events.Event;
import flash.net.URLRequest;
[code]....
View 1 Replies
Nov 13, 2009
I have a flash menu that needs to play a different scene depending on which page it is embedded into. So I need the it to grab the URL of the html page it is on and do some simple test on it to figure out what scene it should be on. *For the record, I tried to do it without scenes but the frame jumping started doing some cracked out things
Code: (on a single empty frame in Scene 1) import flash.external.ExternalInterface; var urlPath; urlPath = ExternalInterface.call("window.location.href.toStr ing()"); getURL("javascript:alert('"+urlPath+"');"); if (urlPath == "http://www.awesome.com/Portfolio/portfolio.html"){ gotoAndPlay("Scene 3", "portfoliopage"); } else if (urlPath ==
[code]....
Somehow, my urlPath isn't getting the correct value, and therefore the if-else latter isn't functioning appropriately. I am posting the website on my test server, so the http addresses are correct, and the if-else latter functions perfectly when I just change the conditions to 'true'/'false', so neither is the problem. The problem is that the alert shows me that the value of urlPath is undefined, and so then all conditions in the latter evaluate to false.
View 5 Replies
Apr 28, 2010
I can't seem to find anything that tells me how to do this.Is there a way to grab the name of a symbol on the stage? Not the instance name but the name that it has in the library.
View 2 Replies
Aug 26, 2011
I'm getting my head around XML E4X in Actionscript 3 and been looking at Senocular's article about filters [URL] for a better way of validating the code below?
Essentially I want to check the profile nodes exist and if theres a profile node with a matching locale attribute (passed via FlashVars), and if not it grab the text of the first node. Anyway heres the code snippet and my XML is below:
function addInfoBubble(countryName:String, countryDataXML:XML):void {
// (theres other non related code here)
if(countryDataXML.achievers.achiever[0].profile as XMLList && countryDataXML.achievers.achiever[0].profile.length() > 0){
[Code].....
View 1 Replies
Jun 27, 2009
grabbing / formating a string.My mission is connecting to a web site - let's say domain.com/one.html - which returns the following html code:
Code:
<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>1,1,4,20,1,128,Harry J. All Stars - The Liquidator</body></html>
What I am looking for is a actionscript function which returns the text after the 6th comma - in this case:
Harry J. All Stars - The Liquidator
The thing is: The numbers are always different, but the text I want to "grab" and "show" in mytext.text (dynamic text) is ALWAYS present after the 6th comma.
View 1 Replies
Dec 21, 2005
Okay, what I want is kinda hard to explain, so bear with me.If I have an array:Code:myPets = ["cat", "dog", "bird", "fish"];Now, is there any AS that can use the value of say "dog", and return the position that "dog" is in the array, I know this seems a bit stupid and dog is obviously myPets[1], but when I'm creating arrays on the fly it becomes slightly harder.
View 3 Replies
Nov 10, 2009
I'm used to flash grabbing an xml file that's manually edited with image file paths. Is it possible for flash or xml to automatically grab images that are in a specific folder?
View 2 Replies
Jan 14, 2010
I am building a flash component to be embedded on an html side - the flash will include buttons to 'share' - i.e. on facebook, twitter, etc. I want to be able to grab the URL of the page and put it into the coding on the button.
Currently the button says:
tweetbtn.onRelease = function() {
getURL("http://twitter.com/home?status=Check Out This Company at www.thiscompany.com",
[code]......
View 1 Replies
Mar 7, 2012
how you would target a function's local variable through a concatenated variable string.For example:
var txt = "Hello World";
function testing(msg) {
var test1 = msg;[code].........
I'd expect the trace to be "Hello World" but rather is given "undefined". So if variables created outside functions are created on the main timeline, where are local function variables created and how would you access them?
View 2 Replies
Jul 28, 2007
I'm trying to combine PHP/SQL and Flash. I've got a problem now. I want to load a variable that contains an url to an image. so the variable is like this: [URL] Now I want flash to load the image, not the text. The variable is called 'img1' but the loadmovie function doesn't work when I put it in.
View 2 Replies
Feb 8, 2010
I have 2 movie clips, one being loaded into a container MC via "loadMovie();"In the main movie there is a variable with no value, in the external movie there are 5 frames, each with a value to update the variable in the main movie.
IE: if on frame 1, global value = 1 / if on frame 2, global value = 2 / etc etc I'm familiar with passing variables INTO an external swf, but am stumped on how to do it the reverse way.
View 1 Replies
Nov 24, 2010
I want to monitor a variable. Whenever the variable value changes I want to call a function. In actionscript 2 I can use "watch" but in as3 what can do ?
View 1 Replies
Sep 16, 2009
I'm not sure if you able to do this or not. But basically I want to be able to grab text off a website (not the one the SWF is hosted on).
I have several sites from which I am making small amounts of money online.. I want to make a small app that loads the URL and searches the pages for the spot where the money is listed, then add them all up to shorten me having to consistently check each. The app could refresh loads, say every 30 seconds or so. Is there a way to do that?
Another example would be to make a text box in flash that displays the headline of an article on CNN.com
I did the like with loading XML from other pages, but what I want to do just involves grabbing any said text from a site.
View 2 Replies
Mar 19, 2010
I'm trying to create a website that will grab content from a MYSQL database, and display it inside of a dynamic text field in Flash. There are several buttons on the page, and I want each button to grab different information depending on id #. So far, I've done a few tutorials both here and elsewhere, and I've finally figured out how to get the Flash to connect to the database, but I'm not sure how to get info based on the id. My current database only has two columns: id & home_body with one row. I want to add more rows to this soon so I'll have something like this:
id | home_body
1 | info <-button 1 grabs this
2 | info <-button 2 grabs this
Here's my code thus far:
AS3:
// this code gets the home page data from the database for display
var homePageText:String;
// Assign a variable name for our URLVariables object
var home_variables:URLVariables = new URLVariables();
[code]....
View 3 Replies
Dec 27, 2010
[URL]..and I wanted to duplicate the effect and turn it into something.. I don't know, something. I just want to get it to work!
It's been a while since I did AS3 programming, so excuse me for being a bit rusty. I loaded a .mov as a FLVPlayback exported it as movie.swf and in the main.fla I made an URLRequest for the .swf. I then did all the silly math things that strobes it, and it all works out when I have an image, but with the movie.swf I just can't get it to work.
With the image it's just a matter of copying the bitmap and repositioning it. But how do I capture a still of the playing .swf?
I am a little bit lost within all the CopyPixels and BitmatData's and I just can't get it to work.
To make it short:
- I want to load a movie (a .mov in this case)
- I want in every frame to capture the frame of the playing movie and duplicate it/reposition it
View 1 Replies
Jan 9, 2012
I simply don't understand why now at the end of my project, the last 5 frames are giving me such trouble. I have five scenes. The first scene plays fine. Second scene plays fine until just the end, then it grabs audio from the third, fourth and fifth scenes and starts playing them. Here is the site: [URL] (it is a site for children in Swedish) if you click the 3rd button to the right (3 Delan) you will notice that the sound starts truncating and then starts grabbing and placing into scenes before the next scene.
View 1 Replies
Sep 8, 2003
I want to load an external variable called name from a text file into a local variable in flash called my_str...here's what I have:
var loadText = new loadVars();
loadText.onLoad = function(success) {
if (success) {
[Code]....
I need to have the variable my_str available outside the function..
View 3 Replies
Sep 10, 2003
I have a LoadVars object called loadText in which an external variable is loaded from a text file. Now, the whole thing works, I just want to create a template to optimize the system, so here is what I need: The external variable (in an external text file) is called page1. I am assigning that external variable to a local variable (at this point the external text has already been loaded in loadText, of course):
[Code]...
View 2 Replies
Nov 27, 2009
I have a set of Cue Points in an FLV I'm playing. It's an interactive quiz, so the idea is that flash will change a variable, theAnswer, to a different letter depending on which question it is. The answer to question 1 is B, question 2 is D, etc. Either the cue point event listener isn't working, or else it is working and Flash isn't declaring the variables. 1120: Access of undefined property theAnswer. I literally can't find a single problem with my code. I have an almost identical Event Listener further down which works.
[Code]...
View 4 Replies
Jul 27, 2009
is it possible to declare function this way
ActionScript Code:
function startShake(e:MouseEvent, num1, num2):void
what i mean is it possible to send to the function not only en event but also a variable and a second question how can i access
ActionScript Code:
function stopShake(e:MouseEvent):Array
this array that function return.
View 1 Replies
Mar 28, 2009
After 2 nights of *almost* getting it I realized that Flash's RegExp doesn't support lookbehinds. Here are the 3 scenarios:
1) [URL]
2) <a href="http://example.com">http://example.com</a>
3) <br><br>http://example.com<br><br>
Basically what I want to happen is to ignore scenario #2. I know the solution, but I can't seem to nail it. All that needs to happen is to select the http (and everything after that) as long as it's not preceded by a "> or =", but since I don't know a way for RegExp to look backwards, I'm sort of at a loss. Here's hoping that someone has run into this issue before
View 5 Replies
Apr 27, 2007
Is it possible to get the color being used in a dynamic textbox through actionscript? I am formatting the textbox with css and I want another element in my movieclip to match whatever color the text is in that textbox dynamically. Ive tried everything I can think of.
View 4 Replies
Sep 16, 2009
I need to pass a variable to a function inside a function. However this parameter (i) seems not to be passed (to function ...onRollOver). This is required to attach a textfield to a movieclip (reading the adress and showing it as a tooltip).
ActionScript Code:
for (i=0; i<array_BE_ElecCities.length; i++) {
var attachElecCity = mc_map.mc_places.attachMovie("Plant",
[code].....
View 1 Replies
May 5, 2011
I want to create a vector, then call a function that populates that vector with arrays. Fine. The only catch is the function itself will declare new array variables to put into the vector, but are these new array variables private to the function only?e.g. something like this
ActionScript Code:
public var vec:Vector.<Array> = new Vector.<Array>();
private function populateVec():void {
[code]....
Is this "kosher"? a was declared in the private function but added to something outside the function..?
View 4 Replies