Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > Simple Stuff (Newbies)

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-26-2012, 04:24 PM   #1
padaben
Registered User
 
Join Date: Oct 2006
Posts: 3
Unhappy change status (color) of the state if it's given by the XML so if Data is On, and giv

Hi all,
It's been a while i didn't ask help,

In this script, flash get the datas by an XML conexion witch is working fine.
Have Ids (number) of states where datas are given by database. States only where Datas are specified.

Then on my stage, I have all the states in movieclips, with an Id.

I would like to change status (color) of the state if it's given by the XML so if Data is On, and give another status(color/ no button) for all other ones.

ActionScript Code:
RollOver = new Object(); RollOver = 0xFFC000; Actif = new Object(); Actif = 0xFF00CC; RollOut = new Object(); RollOut = 0xDD00EE; MovieClip.prototype.onRollOver = function(){  colored = new Color(this);  colored.setRGB(RollOver)}  MovieClip.prototype.onRollOut = function(){  colored = new Color(this);  colored.setRGB(RollOut)} // all this color works fine // then the hard part ! var i = new Object()for (i in _root){  if ( _root[i] instanceof MovieClip ) {  colored = new Color(_root[i])//trace (i);  for(var n=0; n=<table.length; n++){    if (i == x.childNodes[n].childNodes[0].attributes.number){    colored.setRGB(Actif);    trace('si '+ i + ' - ' + x.childNodes[n].childNodes[0].attributes.number)// by default, all movieclip is button  }  elseif ( i != x.childNodes[n].childNodes[0].attributes.number){  trace('no '+ i + ' - ' + x.childNodes[n].childNodes[0].attributes.number);  colored.setRGB(RollOut)//Here I also want to block the rollover possiblity ( delete the button status)  }  }  }}
trace(i) give me all the list of states (they are in my library, 1 movieclip = 1 state)

trace (x.childNodes[n].childNodes[0].attributes.numero) gives me all the numbers of states I have in my XML .

So far I have tested, I get where the last trace gives me only the elseif (no...)

Any Idea why this doesn't work ? and how I can define the " no click" possibility ?
is there something like in css : cursor : none; ?

I'm in AS1 flash player 6

Thanks for helping !
Ben
padaben is offline   Reply With Quote
Old 06-27-2012, 08:27 PM   #2
padaben
Registered User
 
Join Date: Oct 2006
Posts: 3
Exclamation

Hi all,

really nobody, to help to set this correctly,
I reay think it('s not so hard for somebody who knows good as !

So far i'm not doing so bad, but need help !

... tried again things but nothing works !

Thanks for helping !
padaben is offline   Reply With Quote
Old 06-29-2012, 09:02 AM   #3
Cocco Bill
Registered User
 
Join Date: Feb 2009
Posts: 32
Default

Hey Padaben, I just don't understand what your trying to do. Especially this part:
Quote:
I would like to change status (color) of the state if it's given by the XML so if Data is On, and give another status(color/ no button) for all other ones.
Change the status of a state?

Also, I guess there aren't that many AS1 devs anymore.
Cocco Bill is offline   Reply With Quote
Old 07-02-2012, 06:34 PM   #4
padaben
Registered User
 
Join Date: Oct 2006
Posts: 3
Default

Hello cocco Bill, thanks for your interest !

gonna try to explain better.
my XML gives me the array of id(number) for each state present in my database.
so I would like to have in my actionscript the way to change the status of the state(number) if present in the XML, means change the color of a state present in the XML and make all other states whom are not present in the XML, without a button roll over possibility ?
better to understand ?

this is my xml
Code:
<list>

	<state>
		<place number="17" />
	</state>

	<state>
		<place number="33" />
	</state>

	<state>
		<place number="31" />
	</state>
</list>
so, if number 31, want the color of the movieclip 31 (actif)
if not , then (Rolllout)

any idea ?
thanks

Last edited by padaben; 07-02-2012 at 07:01 PM.
padaben is offline   Reply With Quote
Reply


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:49 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.