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:
  #1  
Old October 2nd, 2002, 01:00 PM
BobMallett BobMallett is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: France
Posts: 190 BobMallett User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 5 h 44 m 6 sec
Reputation Power: 8
multiple rows from DB to php to flash Again!

Hi,

I'm referring to a previous post but want some more input and I'm not sure how to follow up on an older post dealing with this issue.

http://forums.devshed.com/showthrea...0&highlight=php

The essence of this is creating variables in php and then reading the variables into Flash and creating duplicate movies for each loop. Problem being in the example of the quoted post we get a syntax error.

x=1;

position=0;

while(x<=numberRows){

duplicateMovieClip( "movieClip", "post" + x, x);

setProperty("post" + x, _y, position);

this["post" + x].flashVarTitle = _root.["varTitle" + x];

position = position + 64;

x++;

}



Can anyone explain the Flash ActionScript of this line:

this["post" + x].flashVarTitle = _root.["varTitle" + x];



Error message when we run this line in Flash 5 or MX

Symbol=text, Layer=actions, Frame=10: Line 17: Expected a field name after '.' operator.

this["post" + x].flashVarTitle = _root.["varTitle" + x];


However if we remove the _root from ["varTitle" + x]; then the script runs. See below.

this["post" + x].flashVarTitle = ["varTitle" + x];


However this means that if we want to embed the script in a movieClip we need to put _root or _parent etc back in front of the ["varTitle" + x]; when it will fail again.

Can anyone help?

Reply With Quote
  #2  
Old October 2nd, 2002, 03:10 PM
freddydoesphp freddydoesphp is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2000
Posts: 669 freddydoesphp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Code:
this["post" + x].flashVarTitle = _root.["varTitle" + x];


Just needs the dot taken out after _root

Code:
this["post" + x].flashVarTitle = _root["varTitle" + x];


Notice how this[ is different from _root.[


When refrencing a member of the _root object you just need the brackets and not the dot syntax.

Reply With Quote
  #3  
Old October 4th, 2002, 11:38 AM
BobMallett BobMallett is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: France
Posts: 190 BobMallett User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 5 h 44 m 6 sec
Reputation Power: 8
Thanks

Thanks a lot

Bob

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > multiple rows from DB to php to flash Again!


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


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway