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




[Q] Retrieve A Value From A Class



dear all i have create a simple class ABC
Code:
package { class ABC extends MovieClip { private var _id:Number; public function ABC() { this._id = 0; } public function setID(in_id:Number):void { this._id = in_id; } public function getID():Number { return this._id; } }}
and a loop for assigning the ID
Code:
for (var i=0; i<10; i++) { var a:ABC = new ABC(); a.name = "a" + i; a.setID(i); addChild(a);}
what is the syntax, if i would like to retrieve the 3rd ID (that is MovieClip "a2")a2.getID(); // seems not workingMovieClip(root).a2.getID(); // not working as well THANKS ~~



KirupaForum > Flash > ActionScript 3.0
Posted on: 07-26-2007, 07:33 AM


View Complete Forum Thread with Replies

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

Retrieve Full Class Name (string) From An Instance
Hello,

Ok I wonder if it's doable.
Is there a way to retrieve the full class name (package name) of a class from one of its instance???

Thx much.

Retrieve A Reference To The Stage A Class Instant Was On ?
Say I have instantiate an external class in flash....can that external *.as file class access the properties of the stage it is currently instantiate on ?

Like the stage's height and such.

Store And Retrieve Array Of Custom Class Objects From Shared Objects.
Hi,

I am stuck up with a problem in ActionScript 2. I am using Flash MX 2004 on windows XP.

I have created 3 custom classes say Parent, Child, and GrandChild. Parent class contains in it an array of its Child objects. Similarly each Child object contains in it an array of GrandChild objects. Also I do have one global array of all the Parent objects.

I want to store this array to the shared objects on specific events(say exiting the session) and then reload them from the shared object(on next session startup). I am able to store the global array to the shared object but when I try to retrieve the same array from shared object, I could not do it. The retrieved array is not of my custom class type [Parent].

Help needed to solve this problem urgently. Does anybody have idea how to do it??

Thanks in advance.



Cheers,
Naishadh Sevalia

Retrieve The Fla?
I was working on a flash thing for a friend and suddenly flash closed, I hadnt saves scince some time so most of the work i did dissapeared, but alot more of it was in the swf file, is there a way i can get it back by doing anything to the swf one?

How To Retrieve This Value?
Hi everyone !

Can someone tell me why I can get the value from my text field when the enter key is pressed? I guess I don't use the right statement to get the value.


Code:
mc_new_mess = new Object();

mc_new_mess.onKeyDown = function() {

if (Key.getCode() == Key.ENTER) {

test_var = "xxxxxxxxx" // outputs xxxxxxxxx in the other field
test_var = this.ins_new_mess.text;// outputs nothing in the other field
test_var = ins_new_mess.text;// outputs nothing in the other field
test_var = mc_new_mess.ins_new_mess.text;// outputs nothing in the other field

} else {

}

}

Key.addListener(mc_new_mess);

Retrieve Url From Txt
Well,

I've read a few topics about my problem: http://www.kirupaforum.com/forums/sh...hlight=txt+url

BUT It doesn't work for me:

What I want: my mc (infoxtra) has a few dynamic textfields and another mc (called 'visit')

----
MC infoxtra
+ dynamictextfield 'titel'
+ dynamictextfield 'categorie'
+ dynamictextfield 'info'

+ mc 'visit'
----

AS1 on mc infoxtra:

Code:
loadText = new loadVars();
loadText.load(freakingtest);
loadText.onLoad = function(success) {
if (success) {
titel.html = true;
titel.htmlText = this.titel;
categorie.html = true;
categorie.htmlText = this.categorie;
info.html = true;
info.htmlText = this.info;
visit.onRelease = function() {
getURL("loadText.url");
};
}
};
stop();

AS1 on the frame where 'infoxtra' is placed:
freakingtest="web.txt"

The first AS1 is static in my site. the second AS1 isn't .... or in other words: I want to load different txt files into infoxtra.



Problem 1:
I'm not getting my url.... what goes wrong


Problem 2:
I can't seem to reach freakingtest.... at least flash can't...
(if I change freakingtest for "web.txt" it works ofcourse.)


Anybody: tips // other AS1 // anything would be greatly appreciated!!

Retrieve The URL From Swf.
I am having problems with the _url property

I need to retrieve the url from where my swf is located and not the url for the swf.

How can i do this?

The prob is that i have a swf that will do this job in a url: http://www.beedigital.net/testes.html

When getting the _url property on it it always traces http://www.beedigital.net/mySwf.swf
and not
http://www.beedigital.net/testes.html

How can i make it trace the url that is in the browser and not the url for the swf?

Thnks.

How Can I Retrieve A Swf's Name?
Hello everybodys !

This question is probably more theoretical than practical, though there may be uses for figuring out how to do this.

If I set up a small dynamic text box (var 'disp') on the main stage and then script on a movieclip: onClipEvent(enterFrame){_root.disp = this._name} I will get the name of the movieClip, correct?

I have been trying to get a swf to state what it's name is, ie: if a swf called movie1.swf is playing, how can you extract that data? I tried scripting on a movieClip: onClipEvent(enterFrame){_root.disp = _root._name}, but nothing happened of course lol. Maybe it is not possible to do this.

Thanx in advance for any insights anyone might have on this

Retrieve Url From Txt
Well,

I've read a few topics about my problem: http://www.kirupaforum.com/forums/sh...hlight=txt+url

BUT It doesn't work for me:

What I want: my mc (infoxtra) has a few dynamic textfields and another mc (called 'visit')

----
MC infoxtra
+ dynamictextfield 'titel'
+ dynamictextfield 'categorie'
+ dynamictextfield 'info'

+ mc 'visit'
----

AS1 on mc infoxtra:

Code:
loadText = new loadVars();
loadText.load(freakingtest);
loadText.onLoad = function(success) {
if (success) {
titel.html = true;
titel.htmlText = this.titel;
categorie.html = true;
categorie.htmlText = this.categorie;
info.html = true;
info.htmlText = this.info;
visit.onRelease = function() {
getURL("loadText.url");
};
}
};
stop();

AS1 on the frame where 'infoxtra' is placed:
freakingtest="web.txt"

The first AS1 is static in my site. the second AS1 isn't .... or in other words: I want to load different txt files into infoxtra.



Problem 1:
I'm not getting my url.... what goes wrong


Problem 2:
I can't seem to reach freakingtest.... at least flash can't...
(if I change freakingtest for "web.txt" it works ofcourse.)


Anybody: tips // other AS1 // anything would be greatly appreciated!!

How To Retrieve This Value?
Hi everyone ! :)

Can someone tell me why I can get the value from my text field when the enter key is pressed? I guess I don't use the right statement to get the value.


mc_new_mess = new Object();

mc_new_mess.onKeyDown = function() {

    if (Key.getCode() == Key.ENTER) {
    
    test_var = "xxxxxxxxx" // outputs xxxxxxxxx in the other field
    test_var = this.ins_new_mess.text;    // outputs nothing in the other field
    test_var = ins_new_mess.text;    // outputs nothing in the other field
    test_var = mc_new_mess.ins_new_mess.text;    // outputs nothing in the other field
    
    } else {

    }

}

Key.addListener(mc_new_mess);


How To Retrieve A Jpg?
Ok this is exactly how i did it.

I created a button and put a keyframe in the over state and changed the color.

I then imported my .jpg file into my library and created a folder called image.

I then created a second layer and put in an "invisible movie clip" and named it "img_loader" i went to edit in place mode and brought the .jpg to the stage

I then wrote the action script to the button as follows

on (release) {
loadMovie("image/name_of_pic.jpg", "img_loader");
}

The script is correct but when I go to run the movie to get the .jpg nothing happens?

What am i missing? I cannot see any of my pics, second question once I am able to get a pick or any URL, how do i make it available to click the pic itself so I can see a larger view of it?

Retrieve The URL From Swf.
I am having problems with the _url property

I need to retrieve the url from where my swf is located and not the url for the swf.

How can i do this?

The prob is that i have a swf that will do this job in a url: http://www.beedigital.net/testes.html

When getting the _url property on it it always traces http://www.beedigital.net/mySwf.swf
and not
http://www.beedigital.net/testes.html

How can i make it trace the url that is in the browser and not the url for the swf?

Thnks.

Retrieve File From Dir
is it possible to give a loadMovie command and jusr specify a directory to look in? and let the script load an swf movie?

Retrieve Instance Name
How can I retrieve the instance name of an object? For example, how do I retrieve into a variable, the instance name of the MC I am clicking?

Thanks in advance

shoul be

myvar = this.instancename ? or something like that?

About Retrieve Data From PHP
Hope it is not Off Topic. I am a database newbie, would like to ask a question on retrieving data.
Let's say I have a column "Name" (rs["Name"]) in database. I want to use Flash to load this column of data. How can I write the php ECHO statement so that it can be easily recognised by Flash?

eg.
Name
-----
May
-----
Jane
-----
Patrick
-----
....
Eric
-----

Shall i write it likes: echo name=May&Jane&Patrick&....
Thanks

Retrieve Variable
i have a text entry fieldd "entry" and a display field "display" wich i want populted with the text from the entry field once i click my button...how do i retrieve and redirect this text.

thanks

How To Retrieve A Picture Name
I have a clip with 4 frames. Each frame has a picture and some buttons.

How can I use actionscript to retrieve the name of the picture in each of the 4 frames?

I know how to do it manually, in library. But I need to document that this clip is showing the pictures I say it is showing, and so I need a programmable way to do it! (I am presenting the case of one clip, but in fact I have to check 20 or more clips)

I know flash has the info, I did not see anything in all my actionscript books to suggest that this information can be retrieved by an actionscript command. Any one knows or has a suggestion to go around this?

For (i=1;i<=#..... Can I Use To Retrieve Properties?
I've used 'for (i=1;i<=#;i++)' in the past with great success, but only to apply the same property to every mc that contains ' i ', for example:

setProperty("mc" + i, _visible, false);

Now I want to use ' i ' to retrieve a property from each mc and store them in their own variable so that I can use that variable in a formula.


PHP Code:



for (i=1;i<=8;i++){
    Locators = ("PT1Browse" + i + "locator");
             LocatorsXpos = how can I retrieve the X position of each of the 8 mc's, and store them as variables to use in a formula ??  

    trace(Locators._x); // doesn't work

    trace(PT1Browse1locator._x); // works fine
    trace(PT1Browse2locator._x);
    }




Thanks for your time!

Retrieve JS Variables
Hey,

Does anyone know a way to get the value of a variable stored within a javascript function via as?

example: (have flash get the value of xid)

<script language="javascript">
function set_id_number(user_id) {
xid = user_id;
}
</script>

Thanks!

Retrieve All Vars In An Mc
does anyone know how to transfer all variables in an mc (i used loadVariables...why it cant use an Object!! beats me...) to another mc or object, etc...?

i tried using the method in Flash help...


Code:
mc.onData = function() {
for(var i in this) {
trace(">> " + i + ": " + this[i]);
}
}
this didnt work at all....all i got was ">> onData: [type Function]"


all im trying to do is store variables outputed from a php file in an Object instead of a movieclip

Is There Way To Retrieve The Value Of A Timer?
Reason I ask is I made a progress bar, and I want the width of that bar to be equal to the value of the timer.

For instance:

ActionScript Code:
var myTimer:Timer = new Timer(100,0);
myTimer.start();

progressBar.width=myTimer.value;

I know value is not a property of the Timer class, but just wanted to give an idea of what I'm looking for. When the timer is at 67, I want my progress bar's width to be at 67, etc...

I know a work around this, but I'm not looking to make an extra timer, I was hoping it could be done without doing:

ActionScript Code:
var progressBarTimer:Timer=new Timer(1,100);
progressBarTimer.start();

progressBarTimer.addEventListener(TimerEvent.TIMER, updateProgressBar);

function updateProgressBar(e:Event):void{
     progressBar.width++;
}

So as you can see, I do know a way around it, I would just rather not have the extra memory usage of a second timer. Any ideas?

Password Retrieve Help
Okay heres what i have:

this.loadVariables("http://jagx.pimpsofpain.com/extras/gbot.txt");
var securenum = hex_md5("painpimp");

what that is doing is going to http://jagx.pimpsofpain.com/extras/gbot.txt and retrieving the securecode then it changes it to the password painpimp

recentely the securecode has been changed

I need to convert the secure code into the new password

The secure code is 17.6356931450224

can someone tell me how to convert that to a password. I suppose the hex_md5 has something to do with it.

thanks for the help guys!

How Do I Retrieve This Variable?
Hey,

Ok using a simple form as I want to test out things before implementing them into my website. Anyway, just wondered how I retrieve the variables from flash mx components to send to my PHP form?

I have attached the file, not quite sure what I am missing? I've used the getValue function but still not showing it on my php script which is the following:


PHP Code:



<?php
$to = "me@me.com";
$msg = "$name has requested the following: $listbox.

";
$msg .= "Their email address is $email.

";

if ($tickbox) {

    $msg .= "They wish to be contacted about future promotions.

";

}

$subject = "Website: ".$listbox;


mail($to, $subject, $msg, "From: My web site
Reply-To: $email
");
?>




Cheers,
Chris

How To Retrieve Flv URL From Swf File?
Some of the swf files have flv videos in them. Is there a way to retrieve flv URL from the swf file?
Thanks in advance.

Cant Retrieve Numberstepper Value
it seems im unable to retain the NumberStepper value... if a user selects say 10, and clicks next, in my text box it should display 10.. well it displays undefined.
my_txt.text = my_nstep.value;

i have a listener to display the value in the output panel, and it works just fine.. however, once you hit next to go to the send frame, it wont display the value.

How Do I Retrieve This Variable?
Hey,

Ok using a simple form as I want to test out things before implementing them into my website. Anyway, just wondered how I retrieve the variables from flash mx components to send to my PHP form?

I have attached the file, not quite sure what I am missing? I've used the getValue function but still not showing it on my php script which is the following:


PHP Code:



<?php
$to = "me@me.com";
$msg = "$name has requested the following: $listbox.

";
$msg .= "Their email address is $email.

";

if ($tickbox) {

    $msg .= "They wish to be contacted about future promotions.

";

}

$subject = "Website: ".$listbox;


mail($to, $subject, $msg, "From: My web site
Reply-To: $email
");
?>




Cheers,
Chris

[FMX] XML Retrieve And Write...
Hello,

I'm working on a project with settings in a cinfig.xml file. Here are links to
html files and images. I want to apply a sort of CMS to this and I made a form in Flash that retrives all variables that I want in the correct way.

But the question is:
Can I retrieve my variables in my Flash form, change and modify, then send them back where they came from in the xml file ????
So not to generate a whole new xml file by PHP. So the way I retrived my varibales I want after changes these to overwrite the existing with the new variables....

Can anyone give me an example or good hint how or IF it is possible,

friendly regards

Retrieve SWF Information
So many threads have been made about saving a users SWF or outputting a screenshot of the SWF. I've been researching this for a long time now and have came up with good solutions just not for me in this case due to server incapability, budget, resources at work etc.

So my question now is, what if you saved the SWF file's information on the server ( or possbile users computer ).

For example if I have a Flash file that allows you to pick an image out of 30 let's say ( of course this would all be dynamic ), and some text that the user was able to type in them selves, would there be a way to store that information without using a database (or data source for that matter ) and let's say email that client a SWF file with the image they have chosen along with that text.

Basically I don't want to do anything server side if possible. ( Of course the email would be server side ).

Any ideas?

How Do I Retrieve My Data From My Xml
i've trying to retrieve data from my xml file using an "on release" handler attached to a button but with no luck. what i actually want to do is create 30 buttons in flash (10 x 3) using thumbnails, then at the click of each, data will be extracted from the xml (texts and pix) and load it into specified textfields and a movieclip. please help me because i don't know how to achieve this. All the tutorials i've seen places their code on a frame and infact, the code is used to generate the buttons and associated actions.
pls i'll be grateful if you can help me !!!!! also if there are any resources i can use to improve my xml/flash knoeledge, i'll be glad

CheckBox Value Retrieve In ASP
hello there, how could i retrieve the checkBox value in the ASP?

how can i tell my form to send variables to form.asp without getting the URL in a blank page...

thanks so much

cheers

How Do I Retrieve This Variable?
Hey,

Ok using a simple form as I want to test out things before implementing them into my website. Anyway, just wondered how I retrieve the variables from flash mx components to send to my PHP form?

I have attached the file, not quite sure what I am missing? I've used the getValue function but still not showing it on my php script which is the following:


PHP Code:



<?php
$to = "me@me.com";
$msg = "$name has requested the following: $listbox.

";
$msg .= "Their email address is $email.

";

if ($tickbox) {

    $msg .= "They wish to be contacted about future promotions.

";

}

$subject = "Website: ".$listbox;


mail($to, $subject, $msg, "From: My web site
Reply-To: $email
");
?>




Cheers,
Chris

[FMX] XML Retrieve And Write...
Hello,

I'm working on a project with settings in a cinfig.xml file. Here are links to
html files and images. I want to apply a sort of CMS to this and I made a form in Flash that retrives all variables that I want in the correct way.

But the question is:
Can I retrieve my variables in my Flash form, change and modify, then send them back where they came from in the xml file ????
So not to generate a whole new xml file by PHP. So the way I retrived my varibales I want after changes these to overwrite the existing with the new variables....

Can anyone give me an example or good hint how or IF it is possible,

friendly regards

SAVE And RETRIEVE ... Diary .....
I've been foolin around the site ...
and i had an idea ... well am not pretty sure how can i do this .. or if it is possible , but you might help ...

can we save variables to a text file , then we retrieve them back ...

like i wanna create a diary ... with dates and titles .. and comments for sure ...

can anyone help ...

How Do U Store And Retrieve And Use An Istance Name?
Ok...

how do i assign, retrieve and use instance names of movie clips?

i want to have two functions slideOn() and slideOff().
they just perform some tweening using actions script.

I have a number of panels (a mc with a pic and some text) sitting off screen.
Press a button and the corresponding panel should slide onto the screen.
Press another button and the current panel should slide off and then the new one slides on.

this would be very easy if i could 'pass' the instance name to the funtions.

i'm sure there is a way to do it...

thanks in advance.

Retrieve Data From Asp File
Hi flash gurus

I creating banner that it retrieve message from text file, its working fine. But right now i need to access variables from asp file. I really getting struggle to access file and load.

Any one help me, i hope u'll

Thx
sathish

Retrieve Swf File Name--Flash MX
How do you retrieve on the fly the name of the swf that's currently playing? What's the code to use?

Many thanks.

Retrieve Color Without GetRGB?
Since getRGB only reads the last setRGB. I think I need to retreive the color of a movie clip without using getRGB. Anyone have any ideas how to do this?

Thanks,
--Chuck
Chuck Davis
http://www.letterheadfonts.com

Retrieve Stats From Online
Would it be possible to retrieve stats from online? like from a ASP/PHP page? im not exactly sure how it works, but ill work it out if im told if its possible...

assuming i have a server, and a ASP page (called stats.asp for arguments sake), would I be able to get flash to retrieve fields from the asp page?

im not exactly sure how asp pages are laid out, so ill just do a sorta flash variable system here... assume this is what the asp page says:

[fields]
username="bob"
password="fish"
strength=10
health=6
xpos=29
ypos=102

would I be able to tell flash to retrieve the username and password field, and if they match the input textboxes in the flash movie, to retrieve and load from the other fields (ie: strength, health, etc)

thanks for readin. please help
by da way, this is my first post, so im glad to be with other flash maker peoples.
peas.
the waste.

Retrieve Flash Animation From Db
Hi.
I hope someone out there has an answer for me.I develope site with asp technology.How can I retrieve a flash swf movie from a db (access) into an asp page?

THX for your replies

Retrieve An Integer From An Array
how can i retrieve an integer from an array and assign that value to a different variable

Code:
myArray = new Array(3);
myArray[0] = testing;
myArray[1] = 2;
myArray[3] = done;

var intnum;

intnum = myArray[1];

if(intnum > 1)
{
play();
}
else if(intnum < 1)
{
stop();
}
something like that... but that's not working

Retrieve Current Frame
I want to display the current frame in a text field.

It will be used as a page counter. For example: Page X of 37 pages.

Retrieve Movieclip Contents
Hello all,

I've got a movie clip into which I load a random external jpg with loadmovie. How can I retrieve the name of the jpg later?

Thanks,

Retrieve Item Of A Listbox
If I want to retrieve the item in a listbox, what should be done? Basically Im trying to retrieve the items in a listbox then compare it with the word that I have keyed in earlier. So could anyone give me some idea? Thanks in advance.

Retrieve Instance Name Or Identifier
How can I retrieve instance name or identifier from an MC?
So if used an on(release) on the MC, how could I get the instance or identifier name of that MC?

How To Retrieve Data From Datagrid?
Hi

To add the data to DataGrid i used the following code:


Code:
var my_dg:mx.controls.DataGrid;
my_dg.addColumn("name");
my_dg.addColumn("score");
//
myData="name1,35,name2,50,name3,75,name4,100,name5,125,name6,150,name7,175,name8,200,name9,225,name10,250"

var myDP_array:Array = new Array();

function addData():Void {

var my_array:Array = myData.split(",");
for (var i = 0; i<my_array.length; i++) {
myDP_array.push({name:my_array[i], score:parseInt(my_array[i+1])});
i++;
}
my_dg.dataProvider = myDP_array;
}

//
addData()


If i click on button i want to retrieve the data from data grid. The retrieved data should be the same order the data i have provided to the DataGrid.

Can any one help
Thanks in advance

Retrieve Data From POST
Seems like it should be pretty straight forward, but I'm having some trouble. I have an HTML form on an admin page that POSTs variables r1,r2,r3...,rN that have intergers as values. The action page for the form is a review page (so administrator can confirm input before committing to a DB) that I'd like to simulate the actual user accessible page. The user page has a flash piece which draws it's data from the DB. So I want the administrator's review page to draw it's data from the form's POSTDATA, not the DB, since the DB isn't actually updated yet when viewing the review page. Can a .swf load from it's own pages existing POSTDATA. If so how.

Thanks for your input.

_b

[MX04] Retrieve Page URL
How do you retrieve the URL of the page a flash is located on (using actionscript)?

[F8] Scripting An Xml Search & Retrieve
What I'm trying to do is load some XML, then search it from top to bottom, stopping on a state that I choose - Montana, in this example - and populate a few dynamic textboxes with the data I find there. Below is my attempt at the actionscript but this is a bit out of my league! I can't make it work. I'm sure this is easy for y'all, but my boss will kill me if I spend another day on this!
code:
peoplexml = new XML();
peoplexml.load("contacts/states.xml");
peoplexml.onLoad = loadXML;
peoplexml.ignoreWhite = 1;

function loadXML(loaded) {
if (loaded) {
var mainnode:XMLNode = peoplexml.firstChild;
var peoplenodes:Array = peoplexml.firstChild.childNodes;
for (var i:Number = 0; i < peoplenodes.length; i++) {
var personnode:XMLNode = peoplenodes[i];
if (mainnode:XMLNode = "montana") {
my_function();
}
}
}
else {
trace('error reading XML');
}
}

function my_function() {
sdm.text = personnode[i].attributes.name;
email.text = personnode[i].attributes.email;
phone.text = personnode[i].attributes.phone;
}




My XML file that is broken up by states like this:
code:
<wyoming>
<sdm name="Joe Schmo"
phone="123-1235"
email="joe@123.com">
</sdm>
</wyoming>
<montana>
<sdm name="Brenda Daniels"
phone="123-1236"
email="daniels@us.costa.it">
</sdm>
</montana>


Thanks for taking a look...

Retrieve Data From SQL To Flash
Using Flash CS3 I need a search to go and find a licence plate and retrieve the data connected with that plate to back to Flash,



Data Base: in MYSQL (database name= cars / Table name= GPS



ID | Licence Plate | Brand | Year | Color |



How can connect, and run the query using PHP and send the results back to flash ??????



I will really appreciate your help whit this issue.



Best Regards



Gian

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