Beating My Head Against A Wall Over Mappings And External Data
Ok, here's what I need to do.
I have a set of options, such as eye color. There are a variety of choices.
The choices are based on a previous variable.
What I would like to do is have an external file contain these choices in a mapping, such as eyecolor = (["blue", "green"])
In flash, I'll have a dynamic text box to display the choices (one at a time), and a left and right arrow to cycle through the various possibilities.
What's driving me crazy is turning those externally defined mappings into something flash can use, probably an array. That way I can have the buttons control a function that cycles through the array's indexes.
Any suggestions are greatly appreciated.
FlashKit > Flash Help > Flash ActionScript
Posted on: 09-08-2001, 10:31 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
- GAH {bangs Head On Wall}
- Banging Head On Wall
- Please Help.. Banging Head Against Wall...
- Head, Brick Wall, Banging Etc Etc...
- Hi I Am Banging My Head Against Brick Wall
- Loading A .jpg Dynamic "I'm Beating My Head Here"
- I Just Broke My Head From Repeated Wall Banging... Please Help
- Head Meet Wall... This Is Driving Me Nuts (Tween Bug?)
- Multi Loaded Vars To Multi MC's...Banging My Head Against The Wall
- Help With Loading External Movie Clip(beating A Dead Horse)
- Help With Loading External Movie Clip(beating A Dead Horse)
- FMX I Can't Get My Head Around LoadVars For Saving Data
- FMX I Can't Get My Head Around LoadVars For Saving Data
- Thumbnail Wall (external Images)
- Mozilla Transparency And Keyboard Mappings
- Key.getAscii() Ignores Int'l Keyboard Mappings?
- Wmode Transparent Screws Up Character Mappings
- Load External Swf, Buttons Don't Work, Tried Everything, Head Hurts.
- Load External Swf, Buttons Don't Work, Tried Everything, Head Hurts.
- Importing External Text File Problems.... My Head Hurts Now...
- Beating The Login
- Mx.data.components - Unable To Declare Data Component Types In External Class Files
- Converting Internal Array Data Into External XML Data [renamed]
- Ok, I've Been Beating Around The Bush But I Can't Figure It Out
- I Know Im Beating A Dead Horse.....
- Delay Action Is Beating Me
- Beating The Popup Blocker
- Heart Beating Tween
- Scroll Bar Works For External Data But Not Internal Data
- Beating The 16,000 Frame Barrier Without LoadMovie()
- XML Resize Thumbs (hope I'm Not Beating A Dead Horse)
- Loading External Data Into An External Swf
- Loading External Data Into An External Swf
- Creating Text File - Or - "Beating A Dead Horse"
- Beating Heart With Variable Heart Rate?
- CSS And External Data
- External Data
- External Txt Data
- [F8] External Data
- External Data Into A Swf
- External Data
- External Data
- External Data
- Data - XML Vs. External AS, Or Both?
- External IP Data Help
- Linking External Data
- Loading External Data
- Loading External Data
- External Data File
GAH {bangs Head On Wall}
I apologize for the amateur hour below, but appreciate any help. Long story short:
I have a movieclip(mcCategory1) that scales up and down during onRollOver/Out. Within that movie clip is another movie clip which is meant to slide down as if opening a drawer (mcDrawer) as mcCategory1 scales up and then slide back as mcCategory1 scales back to its original size; during a roll over and out, respectively
The kicker? If I put the twSlideDown/Up into the symbol's timeline, the sliding efffect works when tested and placed on the stage. But when I apply the twScaleUp/Down to the instance (as shown below), the scale will work, but the mcDrawer stays put. So I move all the functions, etc. to what's shown below, only to have the same effect (scale, no slide)
What on earth is this amateur doing wrong? Thanks!
Attach Code
//import
import mx.transitions.Tween;
import mx.transitions.easing.*;
//variables and instances
var mcCategory1:MovieClip;
var mcDrawer:MovieClip;
//functions
function twScaleUp():Void
{
//trace("insert xscale here");
var tween1 : Tween = new Tween(this, "_xscale", Strong.easeOut, this._xscale, 120, 10, false);
//trace("insert yscale here");
var tween1 : Tween = new Tween(this, "_yscale", Strong.easeOut, this._yscale, 120, 10, false);
}
function twScaleDown():Void
{
//trace("insert -xscale here");
var tween2 : Tween = new Tween(this, "_xscale", Strong.easeOut, this._xscale, 100, 10, false);
//trace("insert -yscale here");
var tween2 : Tween = new Tween(this, "_yscale", Strong.easeOut, this._xscale, 100, 10, false);
};
//slide the drawer up
function twSlideUp():Void
{
//trace("insert yslide here");
var tween3 : Tween = new Tween(this, "_y", Regular.easeOut, this._y, -10, 10, false);
stop();
};
//slide the drawer down
function twSlideDown():Void
{
//trace("insert -yslide here");
var tween4 : Tween = new Tween(this, "_y", Regular.easeOut, this._y, 2, 10, false);
stop();
};
//events
mcCategory1.onRollOver = twScaleUp;
mcCategory1.onRollOut = twScaleDown;
mcCategory1.mcDrawer.onRollOver = twSlideDown;
mcCategory1.mcDrawer.onRollOut = twSlideUp;
Banging Head On Wall
I've been working on this for sometime, and I am starting to clench my teeth...Could someone take a look at this and tell me why if I substitute [i] with [1] I can get the next image to pop in to the loader, but otherwise I get error 2007: Parameter url must be non-null...
Code:
var imageContainer:Loader=new Loader();
addChild(imageContainer);
var loader:URLLoader=new URLLoader();
loader.addEventListener(Event.COMPLETE, xmlLoaded);
var request:URLRequest=new URLRequest("images.xml");
loader.load(request);
function xmlLoaded(event:Event):void{
var xml:XML=new XML(loader.data);
trace(xml.pic[0]);
var picRequest:URLRequest=new URLRequest(xml.pic[0]);
var picLength:Number=xml.pic.length();
var picLoader:Loader=new Loader();
picLoader.x=picLoader.y=50;
this.addChild(picLoader);
picLoader.load(picRequest);
var myTimer:Timer = new Timer(5000,2);
myTimer.addEventListener(TimerEvent.TIMER, nextImage);
myTimer.start();
function nextImage():void{
picLoader.unload();
for(var i:int=0; i<=picLength; i++){
var nextPicRequest:URLRequest=new URLRequest(xml.pic[i]);
picLoader.load(nextPicRequest);
}
}
}
thanks.
Please Help.. Banging Head Against Wall...
i could really use some help...
this is what i would like to do.
i would like to have a box where i could have scrollable images...
but i would also like it so that those images where clickable buttons.
then.. i would like it so that whatever image you clicked there was a text box that would give information on that image.
is this possible.. please help.. ive have tried looking for tuts on this.. and i came up dry.. and if i did find one.. it was not very helpful.
------------------------------------------------------------------------------
this is another thing i would like to try... i have an animation that i would like to start by a click of a button. if there is any tuts on that.. that would be helpful to.
Thanks so much for all your help guys.
thank you very much for you time.
Head, Brick Wall, Banging Etc Etc...
Ok does anyone know of a Flash 4 actionscript command that does the same as the Flash 5 indexOf ?
I'm trying to detect ' within a string so as to convert it to ' before puting it into a dynamic text instance.
If anyone could help it would save my bacon
Hi I Am Banging My Head Against Brick Wall
hi there i am trying to create a database in flash (reading from an acsess filwe) whih is going well but i want it to return movie mpeg or flash files... can this be done if so please can u let me know how
Many thanks
LOuis
Loading A .jpg Dynamic "I'm Beating My Head Here"
I've done this many times before and suddenly It won't work.
I'm loading a .jpg dynamically during runtime into a MC.
the clip is named "container"
the .jpg is in the same directory
here's the code I'm using..
container.loadMovie("logo.jpg");
The movie clip will disapear during runtime as if it was being replaced with the .jpg, but not image appears.....
any idea?
thanks,
I Just Broke My Head From Repeated Wall Banging... Please Help
I'm trying to set up a dynamic News area for the upcoming version of my site and am testing it out using a dummy Flash movie with just the news display area. However, it's just not working right.
I wanted to set up a series of arrays inside Flash, one for each field: Title, Date, URL, and Content. The way I outputted was:
"fieldname=row1,row2,row3" etc.
You can see the actual output here:
http://www.wickedpenguin.com/codetest/Loadnews.cfm
When I run it LOCALLY using a text file copied directly from the URL above, the display works fine and displays both of the current news items.
HOWEVER, when I upload and run it live on my site, I get this result:
http://www.wickedpenguin.com/codetest/site.cfm
The original strings (prior to splitting) show up in the upper left corner. As you can see, there are TWO titles ( "BandCode..." and "Tribute..." ) but only ONE shows up in the main body of the page.
Any ideas why the movie would be producing two different outputs from identical data? I've been at this for eight hours and I'd really appreciate any help!
Many thanks!
Head Meet Wall... This Is Driving Me Nuts (Tween Bug?)
So here's the problem. I have a few timeline tweens that act as transitions for UI elements when I enter or leave a specific section in the file that all work fine... except one set of transitions. These tweens work fine animating in the UI elements, but using the same technique animating out these elements half of them won't tween, they just disappear. Now I thought about having multiple objects on the same layer, but nothing is added to that layer and if that were the case the in animation wouldn't work either... but it does.
So here is my question, does anyone know of a bug when applying a timeline tween in Flash 8? Is there some theoretical limit where Flash bugs out and stops applying tweens?
Multi Loaded Vars To Multi MC's...Banging My Head Against The Wall
OK I'm banging my head against the wall because this is probably too simple, and I've been working on too many things lately *L*
OK so I've loaded a bunch of vars... let's say var1, var2, var3...var6 from a txt file.
Now I want to send each var to a MC whit similar names - but1, but2, but3...but6
code:
varsFile.onLoad = function(success:Boolean) {
trace("loaded");
for (i=0;i<=6; i++) {
buttonClip.but[i].htmlText = varsFile.var[i];
}
};
I've tried a bunch of different syntaxes, but can't seem to get it to work... HELP!!!!!! LOL
Thanks!!!!
Help With Loading External Movie Clip(beating A Dead Horse)
Hello folks, I seem to have run into some problem with a project of mine. I have a Main movie which loads multiple external movies. I am using an empty movie clip called contents to load them into.
one of my external movies has a button in it that launches a centered pop up window(kirupa tutorial). This external movie named site works perfectly by itself, but when loaded into the main movie, the button does not work. I'm using:
on (release) {
_root.contents.loadMovie("site.swf");
}
any input would be greatly appreciated.
Help With Loading External Movie Clip(beating A Dead Horse)
Hello folks, I seem to have run into some problem with a project of mine. I have a Main movie which loads multiple external movies. I am using an empty movie clip called contents to load them into.
one of my external movies has a button in it that launches a centered pop up window(kirupa tutorial). This external movie named site works perfectly by itself, but when loaded into the main movie, the button does not work. I'm using:
on (release) {
_root.contents.loadMovie("site.swf");
}
any input would be greatly appreciated.
FMX I Can't Get My Head Around LoadVars For Saving Data
I'm using Flash MX (2002) and I need to get my variable values saved to a server each time my test subjects run and finish my swf/fla (PHP scripts and a .txt file on the server are being worked on, but that's a different nightmare!). I'm pretty sure I should use LoadVars, NOT SharedObject for this data capture right?. The data must not be overwritten each time over the course of a few months of data collection.
The 3 variables are: username (name of the user), counter (this keeps track of which version the user chooses from the start menu), numcorrect (keeps track of the number of times the <right> arrow key is pressed).
2 main problems:
I don't know where to put in the LoadVars obj (in the AS code of "finaldisplay" frame?) AND I don't know how to build/format the LoadVars object to capture the data in the 3 variables I listed above.
I've got several Flash books and have done online tutorials, so for something so simple (3 lousy variables!)...why is my life so miserable?
Here's my zipped .fla. Will greatly appreciate any help.
pepperman
FMX I Can't Get My Head Around LoadVars For Saving Data
I'm using Flash MX (2002) and I need to get my variable values saved to a server each time my test subjects run and finish my swf/fla (PHP scripts and a .txt file on the server are being worked on, but that's a different nightmare!). I'm pretty sure I should use LoadVars, NOT SharedObject for this data capture right?. The data must not be overwritten each time over the course of a few months of data collection.
The 3 variables are: username (name of the user), counter (this keeps track of which version the user chooses from the start menu), numcorrect (keeps track of the number of times the <right> arrow key is pressed).
2 main problems:
I don't know where to put in the LoadVars obj (in the AS code of "finaldisplay" frame?) AND I don't know how to build/format the LoadVars object to capture the data in the 3 variables I listed above.
I've got several Flash books and have done online tutorials, so for something so simple (3 lousy variables!)...why is my life so miserable?
Here's my zipped .fla. Will greatly appreciate any help.
pepperman
Thumbnail Wall (external Images)
I've found several tutorials and scripts with galleries but nothing about what I'm trying to do.
The closest thing I saw was Biochimistu's Photo Gallery that after a few teaks it became what I was aiming for: a thumbnail grid with links to other websites, you can see it here.
The problem started when I tried to integrate it in my site... after some research I found it was due to different AS versions - gallery AS3 and my site's AS2.
I started looking at how to make it myself: I don't need the fancy effects, just plain images with links. I could do this quiet easily if I just integrated everything in the flv but I'm trying to make it more flexible and dynamic where I can just add a few lines to the xml file and get another image.
After this long winded explanation I'll say that I found several examples of scroll menus that give me the scripts to make it work but nothing about grids
Does anyone used dynamic grids as containers in some project? I'm almost to the point of just giving up and making an half assed flv
Mozilla Transparency And Keyboard Mappings
I have a flash file with transparency, so i am using the wmode="transparent" command in the html embed.
however, in mozilla, when you type a @, you get a " (as in uk/us keyboard layouts)
when i remove the wmode="transparent", it works properly !
Any solutions?
Key.getAscii() Ignores Int'l Keyboard Mappings?
has anyone here experienced weird getAscii results using international keyboards? it seems that getAscii always returns codes for english/american keyboard layouts, no matter what keyboard you use. i am using a german keyboard, it has the " on shift-2 for example. getAscii returns 64, the code for @, instead of 34.
anyone?
gx.
claus.
Wmode Transparent Screws Up Character Mappings
Yep, this has been discussed extensively before: http://www.5etdemi.com/blog/archives...ks-textfields/ , and I just ran into it again. I need wmode=transparent for a project I am doing, and the input text fields are screwed up for non-english keyboards on BOTH FF1.5 and IE6 (that I tried). When switching to cyrillic, on FF1.5 the US keyboard layout appears to be in effect instead, while on IE6 the characters that reach the text field are some strange gobbly-gook like "@CAA:89". Copying and pasting works just fine, though. Well, I am not expecting a workaround to magically appear, but if anyone knows please do mention it
Load External Swf, Buttons Don't Work, Tried Everything, Head Hurts.
I've been banging my head against the wall on this one.
I have my main site (index.swf) that I put a button on one of the sections and the actionscript on the timeline.
Here is the AS on the timeline of my main site (index.swf):
Code:
pgroup1.onPress = function(){
createEmptyMovieClip("picgroup1", 1);
picgroup1.loadMovie("http://rberry883.home.comcast.net/petpics.swf");
picgroup1._x = 0;
picgroup1._y = 160;
picgroup1.border=false;
}
** this will load the external swf (petpics.swf) just fine but the buttons don't work. The button instance name is "pgroup1".
And here is the AS code that is on the movie clip of my external swf (petpics.swf) that is supposed to let the buttons function:
Code:
onClipEvent(load){
this._x = 200;
this._y = 50;
this.div = 5;
}
onClipEvent(enterFrame){
this._x += (endX-_x)/div;
this._y += (endY-_y)/div;
_parent.btnp1.onRelease=function(){
this.endX= 200;
this.endY= 50;
};
_parent.btnp2.onRelease=function(){
this.endX= -50;
this.endY= 50;
};
_parent.btnp3.onRelease=function(){
this.endX= -300;
this.endY= 50;
};
_parent.btnp4.onRelease=function(){
this.endX= 200;
this.endY= -150;
};
_parent.btnp5.onRelease=function(){
this.endX= -50;
this.endY= -150;
};
_parent.btnp6.onRelease=function(){
this.endX= -300;
this.endY= -150;
};
}
Now this swf works on its own if I take the "_parent" tags off ( I also tried with this.) but same results. The buttons have instance names btnp1 - btnp6 and are used to move the movie clip with an instance name of "se" but the buttons don't work when loaded into my main site.
Here is my page I uploaded it to, Once loaded, click on the Photos button and then on the #1 button on the right and you'll see the external swf load but the buttons won't work.
My site: http://rberry883.home.comcast.net
Any help is appreciated.
rberry88
Load External Swf, Buttons Don't Work, Tried Everything, Head Hurts.
I've been banging my head against the wall on this one.
I have my main site (index.swf) that I put a button on one of the sections and the actionscript on the timeline.
Here is the AS on the timeline of my main site (index.swf):
Code:
pgroup1.onPress = function(){
createEmptyMovieClip("picgroup1", 1);
picgroup1.loadMovie("http://rberry883.home.comcast.net/petpics.swf");
picgroup1._x = 0;
picgroup1._y = 160;
picgroup1.border=false;
}
** this will load the external swf (petpics.swf) just fine but the buttons don't work. The button instance name is "pgroup1".
And here is the AS code that is on the movie clip of my external swf (petpics.swf) that is supposed to let the buttons function:
Code:
onClipEvent(load){
this._x = 200;
this._y = 50;
this.div = 5;
}
onClipEvent(enterFrame){
this._x += (endX-_x)/div;
this._y += (endY-_y)/div;
_parent.btnp1.onRelease=function(){
this.endX= 200;
this.endY= 50;
};
_parent.btnp2.onRelease=function(){
this.endX= -50;
this.endY= 50;
};
_parent.btnp3.onRelease=function(){
this.endX= -300;
this.endY= 50;
};
_parent.btnp4.onRelease=function(){
this.endX= 200;
this.endY= -150;
};
_parent.btnp5.onRelease=function(){
this.endX= -50;
this.endY= -150;
};
_parent.btnp6.onRelease=function(){
this.endX= -300;
this.endY= -150;
};
}
Now this swf works on its own if I take the "_parent" tags off ( I also tried with this.) but same results. The buttons have instance names btnp1 - btnp6 and are used to move the movie clip with an instance name of "se" but the buttons don't work when loaded into my main site.
Here is my page I uploaded it to, Once loaded, click on the Photos button and then on the #1 button on the right and you'll see the external swf load but the buttons won't work.
My site: http://rberry883.home.comcast.net
Any help is appreciated.
rberry88
Importing External Text File Problems.... My Head Hurts Now...
Ok I posted this on another board, gonna copy and paste it here... you guys might be able to help me.
::wo0pz::
My problem is I'm trying to load a text file inside of a flash movie in my home page... my home page is located at the root and the text file is located a few folders up... I can't help the text files location and if it were at the same level as teh swf and my home page it works just fine... but the text file has to be located in the folder where it's at cause it's updated frequently there from my msg board and my msg board doesnt give options to store the information at any other location.
your importing an external text file tutorial says "this works best when all the files are stored in the same directory" how can I get around this?
:ldnewbie::
Don't see why using the full & exact path (even if it's in another folder!) with the loadVariables action, would cause any particular problem!
Have you tried it and had problems?
Regards,
:Thought::
The "your tute" implication isn't quite correct... Unless the authour of the particular tutorial posts here, then we're not necessarily going to be familiar with anything written - as this is a message board that relies on people volunteering their knowledge and help.
Sometimes it gets frustrating, like when people don't bother to at least check some of the previous posts and ask the same damned questions again and again.
Sometimes it is really rewarding, like when a major issue or problem is resolved.
And all the time, it is done for free and in everyone's respective spare moments.
So as long as you take that to heart, you'll get more out of it. It may also be useful to post a reference to the tute which you've been using. (-:
If you learn enough to be able to put in what you've gotten out of the board, then everyone benefits (-:
::wo0pz::
I've gone through and searched the board before hand but I didn't find anything to solve this problem but heres the link to the tutorial I was mentioning
http://www.virtual-fx.net/tutorials/...adtextfile.htm
I've been doing some trial and error stuff with my problem... if I place the swf file in the same directory as the text file and make the changes for it, it'll open up the text file just fine so I know i'm not doing anything wrong i cant even be doing my paths wrong cause with the flash file and text file together there are no paths to make, it's just a straight up "text.txt"
If I open up that swf file in that folder with my home page at the root, the flash file will open on the page and all but it won't import the text file... the flash file opens just fine on my page, and all the graphics in it and all, but the bloody text file doesn't.... now I made a new web page in the same directory with the flash file and text file and when it opens the flash file it DOES open the external text file..... but that doesnt help me much cause I need flash in my home page to open it... the only think I can think of get it to do what I want is to move my home page into that directory but then I have to do a whole site makeover and do a lot of link changing... I'll find a way yet!
Hope you guys can help
Beating The Login
I have a flash movie that starts out with a login. It's purpose is just to give the user a username. I want them to be able to use spaces, but I don't want them to just hit the spacebar a bunch of times. How do I make sure they use some combination of letters and numbers and not just a bunch of spaces and making it look like there is no name?
I restricted what they can input by using:
myText_txt.restrict = "A-Z a-z 0-9";
And, I can use the code below, but it won't help if they hit the spacebar.
if (myText_txt != "") {
//login;
}
Any suggestions?
Mx.data.components - Unable To Declare Data Component Types In External Class Files
Hi all,
FlashMX 2004, v7.2:
I am trying to declare instances of data-components (DataSet and DataHolder) in external classfiles, but Flash can't find the sourcefiles for any of the data component classes in the classpath.
According to the help-files, the classname for the DataHolder component is:
Code:
mx.data.components.DataHolder
Similarly, the classname for the ComboBox component is:
mx.controls.ComboBox
Code:
mx.data.components.DataHolder
In the following, the ComboBox gets declared, and the DataHolder generates a "Class can't be loaded" error:
Code:
class my_class extends MovieClip {
var my_cbox:mx.controls.ComboBox;
var my_data:mx.data.components.DataHolder;
function my_class() {
// constructor function
}
}
Sure, it fails because there is no "components" folder in the mx.data folder (at least on my system), and I have been unable to find any DataHolder.as file anywhere either, even though the documentation gives examples that reference the mx.data.components-folder for various data components. I even tried re-installing to make sure I had not accidentally deleted any classfiles, but still no luck.
Am I missing something really obvious here? Does anyone know how to successfully import, declare or otherwise make use of data-components in external class files? Any help greatly appreciated.
Converting Internal Array Data Into External XML Data [renamed]
I have this code inside my flash to name my navigation menu. Now I want to put this outside flash and load it via XML. How do save my different arrays into a variable for later use in my code?
In my nav fla (what i want to load from XML):
Code:
// MAIN MENU ARRAY
var mm_array:Array = ["MAIN1", "MAIN2", "MAIN3", "MAIN4"];
// SUB MENU ARRAY
var sm1_array:Array = ["sub1", "sub2"];
var sm2_array:Array = ["sub1", "sub2", "sub3"];
var sm3_array:Array = ["sub1", "sub2", "sub3"];
var sm4_array:Array = ["sub1", "sub2", "sub3", "sub4"];
var submenu_array:Array = [];
XML loading code
Code:
// LOAD MY XML
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success:Boolean):Void {
if (success) {
// what goes here to define: mm_array, sm1_array, sm2_array etc
myXML.load("myXML.xml")
XML file something like this:
PHP Code:
<navigation>
<menu>
<mm_array>main1</mm_array>
<sm_array>sub1</sm_array>
<sm_array>sub2</sm_array>
</menu>
<menu>
<mm_array>main2</mm_array>
<sm_array>sub1</sm_array>
<sm_array>sub2</sm_array>
<sm_array>sub2</sm_array>
</menu>
</navigation>
Ok, I've Been Beating Around The Bush But I Can't Figure It Out
I've been trying to get ideas to help me with what I'm trying to do, and everyone HAS helped me a lot... but I still can't figure it out! What I'm trying to do is have a ball always moving right; when it reaches a certain point... say frame 15 or getTimer()+whatever, then it will start over (moving right) but the rotation will be random and it will resume from the position that the last frame was at. So it's constantly moving, after a while it will turn a random direction and go that way, after a while it will turn... you get it. I've tried everything! OY!! If you want me to say what I've tried so that you have a starting point or so that you can see what I was doing wrong, please say so. Thanks
I Know Im Beating A Dead Horse.....
But someone has to have an idea
Here we go
Ok, I have a flash movie, this flash movie is a map with 52 movie clips, they all have an instance name of "section" with a number after it IE: section0 section1 and so on. Ok, In the main coding of my movie I have XML that passes thru ASP that changes the color of the movie clips depending on the variable that is in my database. I use SQL. Here is the coding in my movie
"
/* function sectorArray(){
var msectors, varColor, sid, ftxt
for(i=0;i<=rcrXML.childNodes.length;i++){
if(this.childNodes[i].nodeValue == null && this.childNodes[i].nodeName =="sectors"){
msectors=this.childNodes[i];
}
}
var msector
for (q=0;q<=msectors.childNodes.length;q++){
if(msectors.childNodes[q].nodeName=="sector"){
msector=msectors.childNodes[q];
sid=msector.attributes["id"];
for(j=0;j<=msector.childNodes.length;j++){
if(msector.childNodes[j].nodeName=="color"){
varColor=msector.childNodes[j].firstChild.nodeValue;}
}
changecolors(varColor,sid)
}
}
}
function changecolors(varColor,sid){
ftxt=new Color("section"+sid)
ftxt.setRGB("0x"+varColor)
}
rcrXML = new XML();
rcrXML.ignoreWhite = true;
rcrXML.onLoad = sectorArray;
rcrXML.load("zRcrXml.asp?mdsid=2")
stop ();
||||||
That is the code INSIDE the movie. My actual xml/asp file has this
"
<%option explicit
dim cn, rs, sql
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Response.Buffer = true
sql="SELECT * FROM vw_RCR_Mapdata WHERE mdsid = " & request.QueryString("mdsid") & "; "
'Response.Write sql
'Response.End
cn.Open "provider = SQLOLEDB.1;Initial Catalog = OGToolsDb; Data source = Webapps; user id=fsfxsb07; password = "
rs.Open sql,cn
%><?xml version="1.0" encoding="iso-8859-1"?>
<sectors>
<%
do until rs.EOF%>
<sector id="<%=rs("secid")%>">
<rcr>"<%=rs("Rcr_Value")%>"</rcr>
<secname>"<%=rs("Name")%>"</secname>
<%'Check for runway surface conditions for this secid
'Response.Write rs("secid") & ", "
'Response.Write rs("Rcr_Value") & ", "
'Response.Write rs("Takeoff_Landing") & ", "
'Response.Write rs("WaiverThreshold") & ", "
'Response.Write rs("TaxiThreshold") & ", "
if rs("secid") = 0 or rs("secid") = 5 then
'Comparison between takeoff threshold for the runway and rcr
if rs("Rcr_Value") < rs("Takeoff_Landingcaution") then
if rs("Rcr_Value") >= rs("Takeoff_LandingRed") then
'Assign yellow as the color
%><color>ffff00</color><%
else
'Assign red as the color
%><color>ff0000</color><%
end if
else
'Assign green as the color
%><color>00ff00</color><%
end if
else
'Comparison between taxi threshold for the rest of the airfield
if rs("Rcr_Value") < rs("Taxicaution") then
if rs("Rcr_Value") >= rs("TaxiRed") then
'Assign yellow as the color
%><color>ffff00</color><%
else
'Assign red as the color
%><color>ff0000</color><%
end if
else
'Assign green as the color
%><color>00ff00</color><%
end if
end if
rs.Movenext
%></sector><%
loop
%></sectors><%
rs.Close
cn.Close
set cn = nothing
set rs = nothing
*/
||||||||
My question being, there has to be some way possible, to make a code that allows me to mouseover any of the movie clips, and they display the variable in the database that corresponds to their individual section number
Or am I just not going to get it cuz its not possible????
Delay Action Is Beating Me
I have a movie clip that comes to meet the mouse when the mouse hovers over the botom portion of the stage. The clip is scripted to move only along the x axis. When the mouse leaves that bottom area, The movie clip flies off the stage to the left or right, depending on which is closer.
What I want the movie clip to do is wait a few seconds before it flies off the stage when the mouse leaves the bottom area. That way if the mouse wanders from that area for a second or two, the movement of the movie clip won't be annoying. Here is my code:
onClipEvent (enterFrame) {
if (_root._xmouse<795 && _root._xmouse>05 && _root._ymouse>405 && _root._ymouse<445) {
var distance = _root._xmouse-this._x;
if (this._x != _root._xmouse) {
this._x += .15*distance;
}
} else if (this._x<401) {
var homing_distance = -120;
if (this._x != homing_distance) {
this._x += .15*homing_distance;
}
} else if (this._x>400) {
var homing_distance= 820;
if (this._x != homing_distance) {
this._x += .02*homing_distance;
}
}
}
I have been messing with gettimer, but I can only get the delay to work once. I think set interval might be the key. Please help, this is driving me nuts!
Thanks
Beating The Popup Blocker
I have an aspx form that I need to load from a button as a popup but the blocker catches it. We tried to load it with getURL(javascript:window.open()), but the popup blocker(IE and a google popup blocker) caught it. Is there a way to make something popup on a user driven event like this? The thing is is that we could do it with "_blank" just fine but we also need to limit the size of the window scallability menubar and all that other stuff you can do with window.open. What do you guys suggest?
Heart Beating Tween
How can I implement a tween simulting the heart beating.
var myTweenX:Tween=new Tween(myShiningLogo,"scaleX",Bounce.easeOut,1,0.6, 1,true);
var myTweenY:Tween=new Tween(myShiningLogo,"scaleY",Bounce.easeOut,1,0.6, 1,true);
this is almost what I want. But I would like the object to come back to initial dimensions. Should I use other 2 tweens ?
Scroll Bar Works For External Data But Not Internal Data
Howdy,
I have a dynamic text box named 'outputbox'. This is set for multiline. I have an associated scroll bar.
I make a lot of these kind of calls:
PHP Code:
history.onPress = function() {
outputbox._visible = true;
loader = new LoadVars();
loader.load("history.txt");
loader.onLoad = function() {
outputbox.text = this.history;
};
This works great, the scrollbar becomes active when the text goes beyond the outputboxes boarders.
In addition, this 'outputbox' also has a variable (Var) associated with it named 'myTally'. At some particular frames I am generating content for this variable thusly:
PHP Code:
for (receipt = 0; receipt<23; receipt++) {
description = _root["config"+receipt][1];
price = _root["config"+receipt][2];
if (description != 0) {
mytally = (mytally+"
" +description+" "+ price); }
}
Indeed, the outputbox certainly gets populated but the scrollbar does not work. When I select-and-drag the text it definitely goes beyond the boarders of the outputbox. If I change the font size of this outputbox (8pt to 16pt) then the scrollbar *does* work.
Why does the scrollbar react to an external file and not my dynamically generated variable? Is something not scoped or in focus? I really have no idea. Anyhow, any suggestions of where to look for resolution would be greatly appreciated.
Thanks,
Cheez
Beating The 16,000 Frame Barrier Without LoadMovie()
Heya folks.
I've been working ona personal Flash project for quite some time now. I was oblivious to the 16,000 frame limit until now. My movie is running at 30 fps and is between 10-12 minutes long, so as it turns out I'll be exceeding this limit by a fair amount. Cutting stuff out of my film or reducing the fps is not an option at this point in development, and this all need to be contained in one SWF. I really want to beat the barrier, and I have an idea, but I wanted to throw it out there to make sure it will work before I go through the trouble of doing it.
I'm assuming 16,000 frames is the limit for the main timeline, but the timelines of movie clips exist outside of this barrier. Could you realistically compile half the movie into an 8000 frame movie clip, put the other half of the movie into another 8000 frame movie clip, and then put these two movie clips on a 2-frame movie? The first movie clip would have actionscript that moved the main timeline to the second frame (and the second half of the movie) when it completed its 8000 frame run.
I've never tried this before. Would this work without defying any of the frame limits? If this idea is even theoretically sound but I'm missing something important, any advice is greatly appreciated. Thanks for your time.
XML Resize Thumbs (hope I'm Not Beating A Dead Horse)
Hello everyone! I've been all through these 60 some pages on this subject and didn't find what totally what I was looking for... of course eye strain might be a problem so if there is a thread to something I ask please tell me. I apologize in advance if I do. This is my first ever thread also.
Here is a zip of all my files so far. http://marazita.com/funstuff/gallery.zip First here is the link to Scotty's thumb resize that I've put into my .fla. V3_with_thumbs zip Mine doesn't work because what I'm trying to do is make the thumbs replace the mc's that I've added (each with an instance name thumb1, thumb2, etc.). As an artist I like to group images that belong in a group. Sometimes a group can have 3 sometimes 4, etc.. This is what's been wrong with what I've found in the threads so far. They've just been lumped into a certain amount to columns and rows. If you look at my files you'll understand better. I was also hoping that the thumbs would load like this zipped file http://marazita.com/funstuff/gallery_preloadthumbs.zip (which is another nice dynamic loaded one that you don't have control over either). Any help will be greatly appreciated and at the end I'll post my finished file to share with everyone since I've gained so much from this site I would like to also give back. This will help a lot of artists out there I'm sure. Thanks to all that help in advance. I have other questions... but lets do baby steps at first.
-Justin-
www.marazita.com
Loading External Data Into An External Swf
I have a main interface where I'm loading an external swf's but I'm also trying to load text dynamically from a database from the external swf but the text will not show up,
but the text will load if it's in the main interface.
This is my code:
on (release) {
_level0.section = "about.swf";
_level200.play();
section = "contact";
loadVariablesNum("http://www.myurl.com/get_text.php", 0, "POST");
}
The swf will Load properly but the text won't.
Any help would be greatly appreciated.
ps.I hope what I'm asking for makes sense
Loading External Data Into An External Swf
I have a main interface where I'm loading an external swf's but I'm also trying to load text dynamically from a database from the external swf but the text will not show up,
but the text will load if it's in the main interface.
This is my code:
on (release) {
_level0.section = "about.swf";
_level200.play();
section = "contact";
loadVariablesNum("http://www.myurl.com/get_text.php", 0, "POST");
}
The swf will Load properly but the text won't.
Any help would be greatly appreciated.
ps.I hope what I'm asking for makes sense
Creating Text File - Or - "Beating A Dead Horse"
Hey Folks,
Please forgive me for revisiting this often-asked question, but...
I just installed Flash MX 2004, and was wondering if there was
any new functionality that allows the developer to create and
write to an external text file.
From what I've read, this is possible using PHP, ASP, etc... Though,
that requires access ta a PHP or ASP web server - something I don't
want to set up at this time. So, I guess I'm asking if there is any
way to create/write a text file without the help of PHP, ASP, or
a web server?
I'm inserting the movie in VB and using FSCommand to communicate
between the two - Flash input, VB create the file. This works, but
is not very elegant, not efficient, can't run it in IE, etc...
Can you do it using XML? Any other suggestions?
Thanks A Lot,
Beating Heart With Variable Heart Rate?
Okay everyone. Put your thinking caps on.
I need to create a beating heart. I need to be able to have control over the heart rate... and therefore, the speed at which the heart beats.
Any clever ideas?
CSS And External Data
My project incorporates importing vast amount of text from external sources. I noticed that Flash MX2004 (which I just bought) can handle CSS tags, sweet!
Does anyone have a tutorial on how I can code it so that my fields recognize the CSS tags?
Do I need to set all of my styles in flash somewhere or can I reference an outside CSS file?
Thanks
External Data
I have a flash movie, within that movie I have several nested movies.
In one of the nested movies I want to get external data and display it. I.e an photo slider that loads the photos from a folder.
Simple.
The problem is it doesnt work when I nest this photo viewer within my movies several layers down. It only works if its at the root. Is there anyway of solving this.
External Txt Data
is it possible to read data from an external .TXT file while there are no variables specified? here is the source of data:
ftp://weather.noaa.gov/data/observat...coded/LKPR.TXT
and I need to read the temperature value and write it in a simple flash file.
second question: can anybody tell me if it’s even possible to read data from different domain?
thanks for all comments.
[F8] External Data
Hi
Thanks for reading this, i am trying to combine a C# program with Flash, where the flash movie needs to read a sets of data that is continuously changing and fed by the C# program. Does anyone has a good reference and suggestion to what would be the most efficiant approach to this? e.g. C# -> txt->flash read, C#->xml->flash read, or C#->(data)flash.
it's been a while since i used flash, thanks for your suggestions.
Best Regards
Jas
External Data Into A Swf
im running a music site over at welshsound.com, and a couple of nights ago i thought up this cool idea for my front page..
The idea
i want to put a flash movie at the top of my home page which displays a picture of the "featured" artist, under i was thinking about havin some kinda of little media player which played 1 of the featured artists mp3's. Since the featured artist / mp3 is going to change on a regular basis. it wouldnt make sence to hardcode them into the flash movie. could anyone help me
dynamicly load an image
dynamicly load an mp3
parse ID3/2 tags from the dynamicly loaded mp3 to flash
any help would be amazing - im a n00b
External Data
I followed the loading external data tutorial fine, is there any way to load pictures too? Right now, I added
Code:
myText_txt.html=true;
myText_txt.htmlText = this.frontpage;
However, when I do a <img src="asdf.jpg">, it doesn't show up. Any ideas?
External Data
Hi all,
I want to load some links from an ASP file like the attachment. How can I do this? I need a small sample... Thank you
External Data
Anyone know how can I store data like movieClip loaded by swf(if for example you use small loader to menage few bigger files)
SharedObject in my experience works only with text/simple vars data so I cant put there bitmap/music unles i will translate it to bytesArray
- can I merge loaded swf with my loader?
- can I change properties of SharedObject to support more complex objects without "manual" translations to bytes/Array?
- have you any other idea?
Thanx alot for any answer
Best regards
Data - XML Vs. External AS, Or Both?
I will probably seem a little help-less with this, but I am hitting a wall and need some knowledgeable help to guide me in the next step(s) so I don't realize after 20 more hours of work, that I should have done something differently. Here is the story so far, I appreciate any help or advice.
I have created a 2 player board-style game, with questions associated to each box the players land on, as a result of having rolled a random number.
The mechanics of all that were a real challenge, but thanks to the books I have, and moreover the help I found in this (and other similar) forum(s) I now have a gameboard with randomly generated numbers, accurately moving the appropriate token on the board, without landing on the same box as the other player. At set points in the game (based on total die rolls) each players questions get harder (Trivial Pursuit Style, but with Levels). All of this works well.
I get buggered-up with how to access the questions info from the data sources. Initially I though XML was the answer, I have created XML files, for each category (there are 13 categories of questions) and each XML file is devided by player and then by level, for each player. Additionally, I need the "data" to include scoring var info, and in some cases True or False answer results as well. So the amount and type of data in each file will vary enormously.
I have now done, what I feel is exhaustive testing, to get my script to properly get node information, by setting an "interactive" root node value. in a test movie, where I have created buttons to manually call different level node info.
But XML natively doesn't offer as much flexibility or manipulativity (if that's a word) so Arrays seem to be the answer. Two major functionalities, I want the game to have are:
1. I don't want the same question to appear twice in the same game.
2. I want the questions to be selected randomly.
I think I have scoured every forum I am subscribed to for a solution for this, but each solution has considerable draw-backs for me.
The most promising technique I can find or figure, is to go with Arrays. But which is better then?
Using XML files imported into arrays, or loading the array data from external AS files. The Movie is a local application, no internet or network connectivity, all data resides locally on the HD with the Movie.
Any suggestions on how to approach this, I have chapters upon chapters of great books I can refer to for help, but I guess I need a little "Here try this".
I look forward to reading any ideas or options anyone can put forth.
External IP Data Help
I'm hoping someone here can help me. It's been a long time since I've done any decent programming. I'm trying to re-learn everything I've forgoten.
I've built a website that has to forward the user to a seperate server in order to access a database. However, this database is on a dynamic IP and I have written a program to save the IP when it changes to "IP.TXT" in UTF-8 format of course.
However, I am having difficulty retrieving the IP in flash. Can someone help me with a script such as loadvars that would bring in the IP (ip=000.000.000.000) as a variable that can be converted to the getURL function later?
IE. this is the final statement to retreive the database login screen...
else {
getURL ("http://"+ip_text+"/ccWeb/login.aspx?AccNo="+AccNo.text+"&UserID="+UserID.text+"&Passwd="+Passwd.text+"&flag=1");
gotoAndStop(1);
}
Any help would be appreciated.
Linking External Data
I am developing a promotional cd-rom for my webdesign company with Flash MX, and I wanted to include something like, "Your Pictures". What I am doing is taking 5 "promotional" pictures for them at the event, and they will be able to view their pictures through the cd-rom. What I am thinking, is I want to stick "filler" pictures that are in a folder external from the flash library into the places where their pictures will be. That way I can just place their pictures into the folder, with the same names as the "filler" pictures. Now, is this possible to do? I'm not sure if I am just confusing myself enough that I can't figure this out. If this is possible, how would go write the actionscript for it? And, would have to publish the movie everytime.. or once and just have it linked? (If that is possible)
Can someone please help me! If you have anymore questions about my very confusing post, you can leave a reply to this post, or e-mail me at shannon@xkko.com. Any help will be greatly appreciated.
Thank you!
Shannon
Loading External Data
hi there,
i have en empty mc containing a textfield. by pushing a button an external text file is loaded. so far so good. by pushing another button an image is loaded into the same mc.
the problem is, after loading the img, it's not possible to load the text again.
has anyone an idea how this could work or do i have to use different empty mcs?
every help appreciated
Loading External Data
I made a movie, that loads external swf files, but when i published it o the web, it crashes and after the forth movie it restarts
what should i do?
External Data File
hi | i've got a main movie which serves as a shell to load all my submovies (external .swf files). the submovies are called thru an empty movie clip that i gave an instance name of 'placeholder'. to load external movies i do: placeholder.loadMovie("mySubMovie.swf");
now, one of my submovies calls an external data file (it's a dynamic text field that loads text from a .txt file -- it loads the variable text which is specified in the .txt file). i use this code: loadVariablesNum("html.txt",0);
when i test the submovie apart from the main shell, it works fine. but when i test it within it, the text from the external .txt file doesn't load. why is this? is it because i'm specifying level '0', or am i just not using the correct path to find the variable?
thanks, matt.
|