Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #16  
Old March 27th, 2003, 10:10 AM
Den the Puzzled Den the Puzzled is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 25 Den the Puzzled User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
can i bring up the output box from the flash movie without doing the 'test'?

test doesnt want to grab the data from my asp page. I guess i could make it a text file instead, until i get it working...

Reply With Quote
  #17  
Old March 27th, 2003, 10:25 AM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
unfortunately the output window is restricted to within Flash... you can use getURL to alert a variable from within Flash if you want... If you know which .asp file outputs this variable though, you can easily tell where the path should be...

Reply With Quote
  #18  
Old March 27th, 2003, 10:27 AM
Den the Puzzled Den the Puzzled is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 25 Den the Puzzled User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
made static copies of my data sources to i can test.

Ok. confused again!
This code at the top of my pulldown:

this.loadvariables("flashagenttable.txt");
trace("the variable is on the movieclip: "+this.CurrentAgentNumber);
trace("the variable is on the _level0 or _root:"+_level0.CurrentAgentNumber);
trace(_root.CurrentAgentNumber)
trace(CurrentAgentNumber)


returns this in the output box:

the variable is on the movieclip:
the variable is on the _level0 or _root:
undefined
undefined

Almost like its not seeing the variable at all, yet this:

_root.CurrentAgentNumber

in the variable field of my textbox populates the textbox with the correct value. What am i missing here?!!!

Reply With Quote
  #19  
Old March 27th, 2003, 10:28 AM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
getURL("javascript:alert('"+this.CurrentUserAgent+"');");
getURL("javascript:alert('"+_root.CurrentUserAgent+"');");

Reply With Quote
  #20  
Old March 27th, 2003, 10:30 AM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
in that particular code, it's looking for the variable and tracing the values before the data has a chance to get loaded in (even locally)...

Reply With Quote
  #21  
Old March 27th, 2003, 10:40 AM
Den the Puzzled Den the Puzzled is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 25 Den the Puzzled User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yup.. i was just going to post that i put:
trace("the variable is on the movieclip: "+this.CurrentAgentNumber);
trace("the variable is on the _level0 or _root:"+_level0.CurrentAgentNumber);
trace(_root.CurrentAgentNumber)
trace(CurrentAgentNumber)
trace(curagt)

on a button which returns:

the variable is on the movieclip:
the variable is on the _level0 or _root:0615
0615
undefined
undefined

OK. so let me get this clear.
should I load my variables in frame 1, and have my controls in frame 2? Because it looks like im trying to evaluate a variable before its been defined (remember i'm new to this flash!!)

Reply With Quote
  #22  
Old March 27th, 2003, 10:43 AM
Den the Puzzled Den the Puzzled is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 25 Den the Puzzled User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Do layers make a difference as well?

Reply With Quote
  #23  
Old March 27th, 2003, 10:59 AM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
well if your CurrentUserAgent variable is loaded in on your movieclip (i think it's on the scrollbar) then your onClipEvent(data) takes care of the waiting... what it does is evaluates when a data stream has been completely loaded into whatever movieclip the onClipEven exists on. That's what you'll need to create (it's called an onData event handler). If you're using Flash MX, i would use the new LoadVars object like so:

Code:
myLoader = new LoadVars();
myLoader.onLoad = function(){
	trace("data loaded");
	trace(this.CurrentUserAgent);
}
myLoader.load("mydata.txt");


when you create a LoadVars object, all of the variables lie within the myLoader Object. it's a change of approach, but if you can use MX code, i would suggest you use the LoadVars object. It helps you organise where your variables are, and you don't need onClipEvents any more... Also, you don't have to do frame checks (like you're proposing). The problem with evaluating on the 2nd frame is that the variable might not always be loaded by then (especially live with .asp pages). If you use LoadVars, you can set up the onLoad function to process the variables and it will only run once the data is actually loaded.. i can post a simple LoadVars example, if you want.

cheers,

bret

Reply With Quote
  #24  
Old March 27th, 2003, 11:01 AM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
and layers make absolutely no difference... They are the authoring stacking order, but the depth (or z-index) can be changed at run time using swapDepths(target)

Reply With Quote
  #25  
Old March 27th, 2003, 11:10 AM
Den the Puzzled Den the Puzzled is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 25 Den the Puzzled User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

Would loadvars replace the code for loading the data for the combo box as well? Would i put it on the frame or on the combo box... I think its time to buy that book on Flash MX...

Reply With Quote
  #26  
Old March 27th, 2003, 11:20 AM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
heeh right, LoadVars should be put on a frame, and could replace both the loadVariablesNum and loadVariables on your ClipEvents... the only difference would be that you would have to target your movieclip where you want all the things to happen as opposed to an onClipEvent, where the actions happen to the clip it's attached to. i must say, you're tackling a pretty heavy subject for only learning Flash days ago

i find that the actionscript reference does a wonderful job explaining what most of the code does... but if you are looking for Flash books that cover dynamic data generation/manipulation/server side integration, i would check out Flash MX Applications by the Friends of Ed. Although their parent company recently went down, their books are great! and they have a really strong support forum(who knows for how long though...)

cheers,

bret

Reply With Quote
  #27  
Old March 27th, 2003, 11:44 AM
Den the Puzzled Den the Puzzled is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 25 Den the Puzzled User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
if you could throw together a small sample of how loadvars would work, i would be extreamly greatful.

Reply With Quote
  #28  
Old March 27th, 2003, 12:12 PM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
sure, here's a small example of using a LoadVars object to load in from a text file. notice i'm setting a variable on the _root timeline equal to the variables from the text file. If i didn't do this, i'd have to refer to myLoader before i got the the loaded variables. If you run the movie, you'll notice that the first output is "undefined". This is because the variables haven't loaded yet, but once they load, it displays the right thing. So, here's a couple of things to keep in mind when using LoadVars

it's an Object, so it can have properties (and is basically indexable like an associative array with dot or bracket notation)

any variables that get loaded into the object can (using .load) be accesed be first referencing the LoadVars object itself.

you can specify where you want the variables to load into by using sendAndLoad (but i haven't done that for simplicity's sake)

the LoadVars object has a built in handler called onData that determines when the data stream has been completely loaded

check out the file and write back with questions

cheers,

bret
Attached Files
File Type: zip load.zip (2.1 KB, 194 views)

Reply With Quote
  #29  
Old March 27th, 2003, 02:31 PM
Den the Puzzled Den the Puzzled is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 25 Den the Puzzled User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry loosing my hair over this...

If i define a variable in code on the frame , then at what point does the variables become usable? It seems that they are unavailable when im trying to use them. i'm just not getting this!

Its hard to get me mindset off VB\ASP coding.

Reply With Quote
  #30  
Old March 27th, 2003, 02:49 PM
bret bret is offline
flash junkie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: CO, USA
Posts: 172 bret User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 38 sec
Reputation Power: 6
Send a message via Yahoo to bret
well, when you're loading the variables in from an external source, the variable becomes defined (and usable) the moment. Otherwise, it's available right after you declare it...

the only time that you should have issues with availability of variables is when you are loading them in. Otherwise, it's guaranteed to be either a naming or a pathing problem...

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Flash as a database frontend


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump