Feeds:
Posts
Comments

This administration is totally out of control!

You just spent $20,000,000 to move members/supporters of Hamas, a
terrorist organization, to the United States. They get free housing, food, etc…. the whole enchilada!

HB 1388 PASSED

Whether you are an Obama fan, or not, EVERYONE IN THE U. S. needs to
know…..

Something happened…. H..R.. 1388 was passed behind our backs. You may want to read about it.

It wasn’t mentioned on the news…. just went by on the ticker tape at the
bottom of the CNN screen.

Obama funds $20M in tax payer dollars to immigrate Hamas Refugees to the USA . This is the news that didn’t make the headlines…
By executive order, President Barack Obama has ordered the expenditure of $20.3 million in “migration assistance” to the Palestinian refugees and
“conflict victims” in Gaza .
The “presidential determination”, which allows hundreds of thousands of Palestinians with ties to Hamas to resettle in the United States , was signed and appears in the Federal Register. Few on Capitol Hill, or in the media, took note that the order provides a free ticket replete with housing and food allowances to individuals who have displayed their overwhelming support to the Islamic Resistance Movement (Hamas) in the parliamentary election of January 2006. Let’s review……itemized list of some of Barack Obama’s most recentactions since his inauguration:

A)  His first call to any head of state, as president, was to Mahmoud Abbas, leader of Fatah party in the Palestinian territory.

B)  His first one-on-one television interview with any news organization was
with Al Arabia television.

C)  His first executive order was to fund/facilitate abortion(s) not just here
within the U. S. , but in the world, using U. S. tax payer funds.

D)  He ordered Guantanamo Bay closed and all military trials of detainees
halted..

E)  He ordered overseas CIA interrogation centers closed.

F)  He withdrew all charges against the masterminds behind the USS Cole
“terror attacks” .

Now we learn that he is allowing hundreds of thousands of Palestinian
refugees to move to and live in the US at Americans taxpayers  expense. These important, and insightful, issues are being “lost” in the blinding bail-outs and “stimulation” packages.

Doubtful? To verify this for yourself:

www.thefederalregister.com/d.p/2009-02-04-E9-2488

PLEASE PASS THIS ON…. AMERICA NEEDS TO KNOW……

WE are losing this country at a rapid pace!

On October 14, Lord Christopher Monckton, a noted climate change skeptic, gave a presentation at Bethel University in St. Paul, MN. In this 4 minute excerpt from his speech, he issues a dire warning to all Americans regarding the United Nations Climate Change Treaty, scheduled to be signed in Copenhagen in December 2009.

Lord Monckton served as a policy adviser to Margaret Thatcher. He has repeatedly challenged Al Gore to a debate, which Gore has refused. Monckton sued to stop Gore’s film “An Inconvenient Truth” from being shown in British schools due to its inaccuracies. The judge found in favor of Monckton, ordering 9 serious errors in the film to be corrected. Lord Monckton travels internationally in an attempt to educate the public about the myth of global warming.

Eleventh hour, at the fifty-ninth minute and fifty-ninth second – OBAMA POISED TO CEDE US SOVEREIGNTY, CLAIMS BRITISH LORD (repub X)

The Minnesota Free Market Institute hosted an event at Bethel University in St. Paul on Wednesday evening. Keynote speaker Lord Christopher Monckton, former science adviser to British Prime Minister Margaret Thatcher, gave a scathing and lengthy presentation, complete with detailed charts, graphs, facts, and figures which culminated in the utter decimation of both the pop culture concept of global warming and the credible threat of any significant anthropomorphic climate change.

A detailed summary of Monckton’s presentation will be available here once compiled. However, a segment of his remarks justify immediate publication. If credible, the concern Monckton speaks to may well prove the single most important issue facing the American nation, bigger than health care, bigger than cap and trade, and worth every citizen’s focused attention.

Here were Monckton’s closing remarks, as dictated from my audio recording:

At [the 2009 United Nations Climate Change Conference in] Copenhagen, this December, weeks away, a treaty will be signed. Your president will sign it. Most of the third world countries will sign it, because they think they’re going to get money out of it. Most of the left-wing regime from the European Union will rubber stamp it. Virtually nobody won’t sign it.

I read that treaty. And what it says is this, that a world government is going to be created. The word “government” actually appears as the first of three purposes of the new entity. The second purpose is the transfer of wealth from the countries of the West to third world countries, in satisfication of what is called, coyly, “climate debt” – because we’ve been burning CO2 and they haven’t. We’ve been screwing up the climate and they haven’t. And the third purpose of this new entity, this government, is enforcement.

How many of you think that the word “election” or “democracy” or “vote” or “ballot” occurs anywhere in the 200 pages of that treaty? Quite right, it doesn’t appear once. So, at last, the communists who piled out of the Berlin Wall and into the environmental movement, who took over Greenpeace so that my friends who funded it left within a year, because [the communists] captured it – Now the apotheosis as at hand. They are about to impose a communist world government on the world. You have a president who has very strong sympathies with that point of view. He’s going to sign it. He’ll sign anything. He’s a Nobel Peace Prize [winner]; of course he’ll sign it.

[laughter]

And the trouble is this; if that treaty is signed, your Constitution says that it takes precedence over your Constitution, and you can’t resign from that treaty unless you get agreement from all the other state parties – And because you’ll be the biggest paying country, they’re not going to let you out of it.

So, thank you, America. You were the beacon of freedom to the world. It is a privilege merely to stand on this soil of freedom while it is still free. But, in the next few weeks, unless you stop it, your president will sign your freedom, your democracy, and your humanity away forever. And neither you nor any subsequent government you may elect will have any power whatsoever to take it back. That is how serious it is. I’ve read the treaty. I’ve seen this stuff about [world] government and climate debt and enforcement. They are going to do this to you whether you like it or not.

But I think it is here, here in your great nation, which I so love and I so admire – it is here that perhaps, at this eleventh hour, at the fifty-ninth minute and fifty-ninth second, you will rise up and you will stop your president from signing that dreadful treaty, that purposeless treaty. For there is no problem with climate and, even if there were, an economic treaty does nothing to [help] it.

So I end by saying to you the words that Winston Churchill addressed to your president in the darkest hour before the dawn of freedom in the Second World War. He quoted from your great poet Longfellow:

Sail on, O Ship of State!
Sail on, O Union, strong and great!
Humanity with all its fears,
With all the hopes of future years,
Is hanging breathless on thy fate!

————————————- End of Speech ———–Some questions for Lord Monckton—–

Lord Monckton received a standing ovation and took a series of questions from members of the audience. Among those questions were these relevent to the forthcoming Copenhagen treaty:

Question: The current administration and the Democratic majority in Congress has shown little regard for the will of the people. They’re trying to pass a serious government agenda, and serious taxation and burdens on future generations. And there seems to be little to stop them. How do you propose we stop Obama from doing this, because I see no way to stop him from signing anything in Copenhagen. I believe that’s his agenda and he’ll do it.

Response: I don’t minimize the difficulty. But on this subject – I don’t really do politics, because it’s not right. In the end, your politics is for you. The correct procedure is for you to get onto your representatives, both in the US Senate where the bill has yet to go through (you can try and stop that) and in [the House], and get them to demand their right of audience (which they all have) with the president and tell him about this treaty. There are many very powerful people in this room, wealthy people, influential people. Get onto the media, tell them about this treaty. If they go to www.wattsupwiththat.com, they will find (if they look carefully enough) a copy of that treaty, because I arranged for it to be posted there not so long ago. Let them read it, and let the press tell the people that their democracy is about to be taken away for no good purpose, at least [with] no scientific basis [in reference to climate change]. Tell the press to say this. Tell the press to say that, even if there is a problem [with climate change], you don’t want your democracy taken away. It really is as simple as that.

Question: Is it really irrevocable if that treaty is signed? Suppose it’s signed by someone who does not have the authority, as I – I have some, a high degree of skepticism that we do have a valid president there because I know at least one judge who shares your opinion, sir, yes.

I don’t believe it until I see it. … Would [Obama's potential illegitimacy as president] give us a reasonable cause to nullify whatever treaty that he does sign as president?

Response: I would be very careful not to rely on things like that. Although there is a certain amount of doubt whether or not he was born in Hawaii, my fear is it would be very difficult to prove he wasn’t born in Hawaii and therefore we might not be able to get anywhere with that. Besides, once he’s signed that treaty, whether or not he signed it validly, once he’s signed it and ratified it – your Senate ratifies it – you’re bound by it. But I will say one thing; they know, in the White House, that they won’t be able to get the 67 votes in the Senate, the two-thirds majority that your Constitution has stipulated must be achieved in order to ratify a treaty of this kind. However, what they’ve worked out is this – and they actually let it slip during the election campaign, which is how I know about it. They plan to enact that Copenhagen treaty into legislation by a simple majority of both houses. That they can do. But the virtue of that – and here you have a point – is that is, thank God, reversible. So I want you to pray tonight, and pray hard for your Senate that they utterly refuse to ratify the [new] Treaty of Copenhagen, because if they refuse to ratify it and [Obama] has to push it through as domestic legislation, you can repeal it.

Regardless of whether global warming is taking place or caused to any degree by human activity, we do not want a global government empowered to tax Americans without elected representation or anything analogous to constitutional protections. The Founding Fathers would roll over in their graves if they knew their progeny allowed a foreign power such authority, effectively undoing their every effort in an act of Anti-American Revolution. If that is our imminent course, we need to put all else on hold and focus on stopping it. If American sovereignty is ceded, all other debate is irrelevant.

Verifying the treaty clauses Mockton made reference to:

Skimming through the treaty, I came across verification of Monckton’s assessment of the new entity’s purpose:

38. The scheme for the new institutional arrangement under the Convention will be based on three basic pillars: government; facilitative mechanism; and financial mechanism, and the basic organization of which will include the following:

World Government (heading added)
(a) The government will be ruled by the COP with the support of a new subsidiary body on adaptation, and of an Executive Board responsible for the management of the new funds and the related facilitative processes and bodies. The current Convention secretariat will operate as such, as appropriate.

To Redistribute Wealth (heading added)
b) The Convention’s financial mechanism will include a multilateral climate change fund including five windows: (a) an Adaptation window, (b) a Compensation window, to address loss and damage from climate change impacts [read: the "climate debt" Monckton refers to], including insurance, rehabilitation and compensatory components, © a Technology window; (d) a Mitigation window; and (e) a REDD window, to support a multi-phases process for positive forest incentives relating to REDD actions.

With Enforcement Authority (heading added)
© The Convention’s facilitative mechanism will include: (a) work programmes for adaptation and mitigation; (b) a long-term REDD process; © a short-term technology action plan; (d) an expert group on adaptation established by the subsidiary body on adaptation, and expert groups on mitigation, technologies and on monitoring, reporting and verification; and (e) an international registry for the monitoring, reporting and verification of compliance of emission reduction commitments, and the transfer of technical and financial resources from developed countries to developing countries. The secretariat will provide technical and administrative support, including a new centre for information exchange [read; enforcement].

I urge all Atlas readers immediately to contact your congressman NOW AND DEMAND that they do the job they were elected to do, keep America safe and protect her from her enemies, even if that enemy is in the White House.

Posted by Pamela Geller on Saturday, October 17, 2009 at 12:25 AM in Environ-MENTALISM, Global Warming uh cooling uh climate change, Relinguishing our Sovereignty to Islamicized UN | Permalink | Comments (17) | TrackBack (0) ShareThis

– All information contained within is from Flashtuts.com a great site where you can learn how to use flash to build your skills.  Great authors who have shared their knowledge for others to grow.

Thanks for all you guys do!!

www.flashtuts.com

– All information contained within is from Flashtuts.com a great site where you can learn how to use flash to build your skills.  Great authors who have shared their knowledge for others to grow.

Thanks for all you guys do!!

www.flashtuts.com

Step 1

Set up a new Flash AS3 document and a blank ActionScript file. We’ll create the main class first; name it “Gallery” and save it as “Gallery.as”. Below is the code to set up the first class:

  1. package
  2. {
  3. public class Gallery
  4. {
  5. public function Gallery() : void
  6. {
  7. }
  8. }
  9. }
package
{
	public class Gallery
	{
		public function Gallery() : void
		{
		}
	}
}

In Flash we can now set this as the base class by entering the name in the input box under the Publish settings of the document. You can try a “trace(‘hello world’)” in the Gallery function to test if it’s working.

Step 2

Before we continue with the main class, it’s best to start off with the slider. The code is fairly easy to understand and might shine some light on how things are done in AS3.

Create two new movieclips: a slider and a handle for the slider. The slider or seeker doesn’t need to be exported for ActionScript as we only need to apply some functions to the handle. Set the class for the handle as “Handle”. We can now create a new class called “Handle” and, if saved in the same directory, Flash will automatically use this class for the handle. Give both an instance name such as “slider” and “theHandle”.

Step 3

The following is the full code for the handle which I will explain in steps. It should be saved as “Handle.as” in the same directory as your .fla. This way, Flash will execute the code once an instance with a class name “Handle” is used.

  1. package
  2. {
  3. import flash.display.MovieClip;
  4. import flash.events.MouseEvent;
  5. import flash.events.Event;
  6. public class Handle extends MovieClip
  7. {
  8. public var goToX : Number = x;
  9. private var slider : MovieClip = MovieClip(parent).slider;
  10. private var mousePos : Number = 0;
  11. public function Handle() : void
  12. {
  13. buttonMode = true;
  14. addEventListener( MouseEvent.MOUSE_DOWN, moveHandle );
  15. stage.addEventListener( MouseEvent.MOUSE_UP, stopHandle );
  16. }
  17. private function moveHandle( _e : MouseEvent ) : void
  18. {
  19. mousePos = mouseX;
  20. stage.addEventListener( MouseEvent.MOUSE_MOVE, followHandle );
  21. }
  22. private function stopHandle( _e : MouseEvent ) : void
  23. {
  24. stage.removeEventListener( MouseEvent.MOUSE_MOVE, followHandle );
  25. }
  26. private function followHandle( _e : MouseEvent ) : void
  27. {
  28. var newPos : Number = stage.mouseX - mousePos;
  29. var orgX : Number = x;
  30. if ( newPos < slider.x )
  31. goToX = slider.x;
  32. else if ( newPos > (slider.x + slider.width) - width )
  33. goToX = (slider.x + slider.width) - width;
  34. else
  35. goToX = newPos;
  36. x = goToX;
  37. if( goToX != orgX ) dispatchEvent( new Event( ”sliding”, true ) );
  38. }
  39. }
  40. }
package
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.events.Event;

	public class Handle extends MovieClip
	{
		public var goToX : Number = x;
		private var slider : MovieClip = MovieClip(parent).slider;
		private var mousePos : Number = 0;

		public function Handle() : void
		{
			buttonMode = true;
			addEventListener( MouseEvent.MOUSE_DOWN, moveHandle );
			stage.addEventListener( MouseEvent.MOUSE_UP, stopHandle );
		}

		private function moveHandle( _e : MouseEvent ) : void
		{
			mousePos = mouseX;
			stage.addEventListener( MouseEvent.MOUSE_MOVE, followHandle );
		}

		private function stopHandle( _e : MouseEvent ) : void
		{
			stage.removeEventListener( MouseEvent.MOUSE_MOVE, followHandle );
		}		

		private function followHandle( _e : MouseEvent ) : void
		{
			var newPos : Number = stage.mouseX - mousePos;
			var orgX : Number = x;
			if ( newPos < slider.x )
				goToX = slider.x;
			else if ( newPos > (slider.x + slider.width) - width )
				goToX = (slider.x + slider.width) - width;
			else
				goToX = newPos;
			x = goToX;
			if( goToX != orgX ) dispatchEvent( new Event( "sliding", true ) );
		}		

	}

}

In the first few lines we create a few variables to hold data we can use in every function in this class. The slider variable holds a reference to the instance called “slider” on the parent. We need it to correctly calculate the x position to which the handle should be moved. In the constructor we set “buttonMode” to true so a hand cursor shows up when hovering over the handle. Additionally, we add two eventlisteners to listen for mouse events.

  1. public class Handle extends MovieClip
  2. {
  3. public var goToX : Number = x;
  4. private var slider : MovieClip = MovieClip(parent).slider;
  5. private var mousePos : Number = 0;
  6. public function Handle() : void
  7. {
  8. buttonMode = true;
  9. addEventListener( MouseEvent.MOUSE_DOWN, moveHandle );
  10. stage.addEventListener( MouseEvent.MOUSE_UP, stopHandle );
  11. }
public class Handle extends MovieClip
{
	public var goToX : Number = x;
	private var slider : MovieClip = MovieClip(parent).slider;
	private var mousePos : Number = 0;

	public function Handle() : void
	{
		buttonMode = true;
		addEventListener( MouseEvent.MOUSE_DOWN, moveHandle );
		stage.addEventListener( MouseEvent.MOUSE_UP, stopHandle );
	}

Once a mouse down event occurs, an extra listener is added. This listener stays active as long as the drag movement isn’t stopped and calls the “followHandle” function. It’s removed again when the mouse click is over.

  1. private function moveHandle( _e : MouseEvent ) : void
  2. {
  3. mousePos = mouseX;
  4. stage.addEventListener( MouseEvent.MOUSE_MOVE, followHandle );
  5. }
  6. private function stopHandle( _e : MouseEvent ) : void
  7. {
  8. stage.removeEventListener( MouseEvent.MOUSE_MOVE, followHandle );
  9. }
private function moveHandle( _e : MouseEvent ) : void
{
	mousePos = mouseX;
	stage.addEventListener( MouseEvent.MOUSE_MOVE, followHandle );
}

private function stopHandle( _e : MouseEvent ) : void
{
	stage.removeEventListener( MouseEvent.MOUSE_MOVE, followHandle );
}

This last function actually moves the handle around. The variable “newPos” stores the new position to which the handle should move. If, however, this position is further than the far left or right of the slider, the position should be set to the maximum possible value. If the handle is moved, we dispatch a new custom event called “sliding”, which we can later use to move around the images.

  1. private function followHandle( _e : MouseEvent ) : void
  2. {
  3. var newPos : Number = stage.mouseX - mousePos;
  4. var orgX : Number = x;
  5. if ( newPos < slider.x )
  6. goToX = slider.x;
  7. else if ( newPos > (slider.x + slider.width) - width )
  8. goToX = (slider.x + slider.width) - width;
  9. else
  10. goToX = newPos;
  11. x = goToX;
  12. if( goToX != orgX ) dispatchEvent( new Event( ”sliding”, true ) );
  13. }
private function followHandle( _e : MouseEvent ) : void
{
	var newPos : Number = stage.mouseX - mousePos;
	var orgX : Number = x;
	if ( newPos < slider.x )
		goToX = slider.x;
	else if ( newPos > (slider.x + slider.width) - width )
		goToX = (slider.x + slider.width) - width;
	else
		goToX = newPos;
	x = goToX;
	if( goToX != orgX ) dispatchEvent( new Event( "sliding", true ) );
}

Step 4

If everything’s gone well until now, you should have a nice functional slider like the one below. Add a dynamic textfield underneath it which will hold the image number. Give it an instance name like “countTxt” so we can address it later in ActionScript. Because there’s nothing to display yet I filled it with the text “Loading” which will also display while the script loads the first image.

Step 5

Next we’ll create the php backend script. Flash can’t read the contents of a local directory, so we need to pass the information from php to Flash. We’ll use XML since it’s easy to output with php and even easier to read again in AS3.

The following is the php backend code, save it as “backend.php”. The code loops through the directory “img” and writes a line of XML for each file in there. Before printing we need to filter out the “.” and “..” directories. As the directory only contains images there’s no further checking necessary.

  1. <xml>
  2. <?php
  3. $od  = opendir(‘img’);
  4. while ( $filename = readdir($od) )
  5. if( $filename != ”.” && $filename != ”..” ) echo ”<img>” . $filename . ”</img>\n”;
  6. ?>
  7. </xml>
<xml>
<?php
$od  = opendir('img');
while ( $filename = readdir($od) )
    if( $filename != "." && $filename != ".." ) echo "<img>" . $filename . "</img>\n";
?>
</xml>

This will output for example:

  1. <xml>
  2. <img>file1.jpg</img>
  3. <img>file2.jpg</img>
  4. <img>file3.jpg</img>
  5. </xml>
<xml>
	<img>file1.jpg</img>
	<img>file2.jpg</img>
	<img>file3.jpg</img>
</xml>

Step 6

Before we load this into Flash, let’s create a class to hold our images individually. In the same way we created the Handle class we can now create an Img class. Start off with creating a movieclip about the size you want your images to be displayed. Give it a margin of a few pixels and save some space on the bottom for the description text. Add a dynamic text field for the description and give it an instance name of “descr”. Make sure to set the registration point of the movieclip to the center so we can easily scale it later. Export it for ActionScript under the class name “Img”. Now delete the instance from the stage as we’ll call it directly from the library.

Step 7

Next we’ll load the information the php file returns into our Flash project using ActionScript. Open up the Gallery class again. The following code adds two functionalities to our project. First off, it creates “imagesClip”, an empty movieclip in which we’ll store the actual images later. Using “addChild” here adds the movieclip to the stage. Anything added to imagesClip later will also appear on the stage. To actually load the xml data, we create a “URLLoader”. This class can fetch the results and run a function when the results are in.

  1. package
  2. {
  3. import flash.display.MovieClip;
  4. import flash.events.Event;
  5. import flash.net.URLLoader;
  6. import flash.net.URLRequest;
  7. public class Gallery extends MovieClip
  8. {
  9. private var backend : String = ’http://localhost/…/backend.php’;
  10. private var xmlLoader : URLLoader = new URLLoader;
  11. private var xdata : XML;
  12. public var images : Array = new Array();
  13. public var imagesClip : MovieClip = new MovieClip;
  14. public function Gallery() : void
  15. {
  16. imagesClip.y = 180;
  17. addChild( imagesClip );
  18. xmlLoader.load( new URLRequest( backend + ”?” + new Date().valueOf() ) );
  19. xmlLoader.addEventListener( Event.COMPLETE, loadImages );
  20. }
  21. private function loadImages( _e : Event ) : void
  22. {
  23. xdata = new XML( _e.target.data );
  24. var i : Number = 0;
  25. for each( var img:XML in xdata.img )
  26. {
  27. images[i] = new Img();
  28. i++;
  29. imagesClip.addChild( images[i] );
  30. }
  31. }
  32. }
  33. }
package
{
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;

	public class Gallery extends MovieClip
	{
		private var backend : String = 'http://localhost/.../backend.php';

		private var xmlLoader : URLLoader = new URLLoader;
		private var xdata : XML;
		public var images : Array = new Array();

		public var imagesClip : MovieClip = new MovieClip;

		public function Gallery() : void
		{
			imagesClip.y = 180;
			addChild( imagesClip );

			xmlLoader.load( new URLRequest( backend + "?" + new Date().valueOf() ) );
			xmlLoader.addEventListener( Event.COMPLETE, loadImages );

		}

		private function loadImages( _e : Event ) : void
		{
			xdata = new XML( _e.target.data );
			var i : Number = 0;
			for each( var img:XML in xdata.img )
			{
				images[i] = new Img();
				i++;
				imagesClip.addChild( images[i] );
			}
		}
	}
}

Here we use the load function of the URLLoader class. To prevent caching of the results we can add a simple date to the end of the url. The eventlistener checks when the URLLoader is finished and then runs the loadImages function.

  1. xmlLoader.load( new URLRequest( backend + ”?” + new Date().valueOf() ) );
  2. xmlLoader.addEventListener( Event.COMPLETE, loadImages );
xmlLoader.load( new URLRequest( backend + "?" + new Date().valueOf() ) );
xmlLoader.addEventListener( Event.COMPLETE, loadImages );

This next function loops through all the <img> instances in the xml. For each of these it creates a new instance of the Img class. Next we add it to the imagesClip (this is just for testing as later on we only want the active images to be displayed).

  1. private function loadImages( _e : Event ) : void
  2. {
  3. xdata = new XML( _e.target.data );
  4. var i : Number = 0;
  5. for each( var img:XML in xdata.img )
  6. {
  7. images[i] = new Img();
  8. i++;
  9. imagesClip.addChild( images[i] );
  10. }
  11. }
private function loadImages( _e : Event ) : void
{
	xdata = new XML( _e.target.data );
	var i : Number = 0;
	for each( var img:XML in xdata.img )
	{
		images[i] = new Img();
		i++;
		imagesClip.addChild( images[i] );
	}
}

Step 8

To give our Img instances more functionality, create an Img class and save it as “Img.as”. In a similar way to loading the XML we can load the image itself and display it inside the Img movieclip. The loading should not occur in the constructor or all images would try to load at the same time; we’ll create a separate function for doing this.

  1. public class Img extends MovieClip
  2. {
  3. public var id : Number;
  4. private var src : String;
  5. private var imageLoader:Loader = new Loader();
  6. private var main : Gallery;
  7. private var orgWidth:Number = 0;
  8. private var orgHeight:Number = 0;
public class Img extends MovieClip
{
	public var id : Number;
	private var src : String;
	private var imageLoader:Loader = new Loader();
	private var main : Gallery;
	private var orgWidth:Number = 0;
	private var orgHeight:Number = 0;

In the constructor, we set a reference to the main Gallery class so we can later access elements on the stage or public variables and functions of the main class. The string “load” will contain the path to the image which php returned, we’ll save it to a variable so we can access it later.

  1. public function Img( load : String, m : Gallery ) : void
  2. {
  3. orgWidth = width;
  4. orgHeight = height;
  5. main = m;
  6. src = load;
  7. }
	public function Img( load : String, m : Gallery ) : void
	{
		orgWidth = width;
		orgHeight = height;
		main = m;
		src = load;
	}

The “loadImage” function loads the image and when finished runs the “displayImage” function.

  1. public function loadImage() : void
  2. {
  3. imageLoader.load( new URLRequest( ”img/” + src ) );
  4. imageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, displayImage );
  5. }
	public function loadImage() : void
	{
		imageLoader.load( new URLRequest( "img/" + src ) );
		imageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, displayImage );
	}

The displayImage function checks the images array we created and loads the next image. It sets the smoothing to true on the Loader (by default, smoothing is set to false on dynamically loaded images). Once you start scaling or rotating an image it’s important to set the smoothing so the image remains its quality. As the registration point of the Img movieclip is in the center we need to calculate the x and y position of where to place the image itself. In my example I’ve used a directory of images with the same width and height. If the width and height of the loaded image are variable this is the place to resize it on the fly. Just before adding it as a child we set the description text to “src”, which holds the name of the image.

  1. private function displayImage( _e : Event ) : void
  2. {
  3. if ( main.images[id + 1] != null && !main.images[id + 1].parent ) main.images[id + 1].loadImage();
  4. Bitmap( imageLoader.content ).smoothing = true;
  5. imageLoader.x = main.spaceBetween/2 - ( orgWidth /2 );
  6. imageLoader.y = main.spaceBetween/2 - ( orgHeight /2 );
  7. descr.text = src;
  8. addChild( imageLoader );
  9. }
	private function displayImage( _e : Event ) : void
	{
		if ( main.images[id + 1] != null && !main.images[id + 1].parent ) main.images[id + 1].loadImage();
		Bitmap( imageLoader.content ).smoothing = true;
		imageLoader.x = main.spaceBetween/2 - ( orgWidth /2 );
		imageLoader.y = main.spaceBetween/2 - ( orgHeight /2 );
		descr.text = src;
		addChild( imageLoader );
	}
}

Step 9

After the changes we made to the Img class we need to update the way the instances are called in the loadImages function of the Gallery class. We now need to pass two arguments when calling new Img().

The first is the path name of the image that needs to be loaded, we get this from the xml. The second is a reference to the main Gallery class; we can use “this” which points to the class we’re currently working in. Instead of adding the images with addChild to the imagesClip container we’ll create a new function “goTo”. This function will work out which images to place on the screen. The argument we need to pass is the id number of the image, the same number as the index key in the images array. When the images are loaded for the first time, we’ll set the focus on the first image, of which the id number is zero.

  1. private function loadImages( _e : Event ) : void
  2. {
  3. xdata = new XML( _e.target.data );
  4. var i : Number = 0;
  5. for each( var img:XML in xdata.img )
  6. {
  7. images[i] = new Img( img, this );
  8. images[i].x = 200 * i;
  9. images[i].id = i;
  10. i++;
  11. }
  12. goTo( 0 );
  13. }
private function loadImages( _e : Event ) : void
{
	xdata = new XML( _e.target.data );
	var i : Number = 0;
	for each( var img:XML in xdata.img )
	{
		images[i] = new Img( img, this );
		images[i].x = 200 * i;
		images[i].id = i;
		i++;
	}
	goTo( 0 );
}

Step 10

To use the goTo function we need to declare a variable “imagesToShow” first. This will set the amount of images we want to load at once on screen. To determine the direction in which the user is scrolling, we simply check if the image we’re going to had a higher or lower id number than the last one.

  1. private function goTo( imgId : Number ) : void
  2. {
  3. var direction : Number;
  4. if ( orgImgId != imgId )
  5. {
  6. if ( imgId > orgImgId  ) direction = 1;
  7. else direction = -1;
private function goTo( imgId : Number ) : void
{
	var direction : Number;
	if ( orgImgId != imgId )
	{
		if ( imgId > orgImgId  ) direction = 1;
		else direction = -1;

The next “for loop” loops all images needed on screen. For example: if we set imagesToShow to 5, it will loop from -2 to 2. This means that if we pass the value of i to the Img class we can determine where on the screen it should be positioned (-2 being far left, 0 center and 2 the far right). Therefore, we can scale the images larger the more centrally they are positioned.

There’s an additional check included so we don’t activate non-existing images (it stops at the first and the last one). For each of the active images we’ll run the “makeActive” function, which we’ll create later on.

  1. for ( var i : Number = - Math.floor(imagesToShow/2); i <= Math.floor(imagesToShow/2); i++ )
  2. {
  3. if( imgId + i < images.length && imgId + i >= 0 ) images[imgId + i].makeActive( i, direction );
  4. }
		for ( var i : Number = - Math.floor(imagesToShow/2); i <= Math.floor(imagesToShow/2); i++ )
		{
			if( imgId + i < images.length && imgId + i >= 0 ) images[imgId + i].makeActive( i, direction );
		}

Right after placing the images we need on screen, we’ll check which ones shouldn’t be there any more and get those off the stage. Since all images are added to the imagesClip container, we can easily loop through all children of that movieclip. If their id is not within those that should be active, we run the “deActive”.

  1. for( var j : Number = 0; j < imagesClip.numChildren; j++ )
  2. {
  3. var tile : Img = imagesClip.getChildAt(j) as Img;
  4. if ( tile.id < imgId - Math.floor(imagesToShow/2) || tile.id >  imgId + Math.floor(imagesToShow/2) ) tile.deActive( direction );
  5. }
		for( var j : Number = 0; j < imagesClip.numChildren; j++ )
		{
			var tile : Img = imagesClip.getChildAt(j) as Img;
			if ( tile.id < imgId - Math.floor(imagesToShow/2) || tile.id >  imgId + Math.floor(imagesToShow/2) ) tile.deActive( direction );
		}

The next line updates the text of the dynamic textfield we created earlier. Since the ids of the images start their count at 0 we add + 1 to the imgId so the first image is actually number 1 etc. We can get the total number of images from accessing the length of the images array.

  1. countTxt.text = imgId + 1 + ”/” + images.length;
		countTxt.text = imgId + 1 + "/" + images.length;
	}

Finally, we’ll set “orgImgId” so the next time the function is run, the direction being scrolled can be determined.

  1. orgImgId = imgId;
	orgImgId = imgId;
}

Step 11

We now need the “makeActive” and “deActive” functions in the Img class. These will either add the image to the stage, or take it off. For now we’ll just add them and place them correctly. Later on we’ll also tween them to their correct place.

The makeActive function first checks if it is added to the imagesClip already. If there is no parent found, it adds itself to to imagesClip container. The parent is then the imagesClip. Next we set the visible property to true. When deactivating, we set it to false so it’s only normal we want our image to show again when it’s made active.

  1. public function makeActive( position : Number, direction : Number ) : void
  2. {
  3. if ( parent == null )
  4. {
  5. main.imagesClip.addChild( this );
  6. }
  7. visible = true;
public function makeActive( position : Number, direction : Number ) : void
{
	if ( parent == null )
	{
		main.imagesClip.addChild( this );
	}
	visible = true;

There’s a chance that the image itself hasn’t yet loaded. To check this, I check if the amount of children is smaller than 3. This number can depend on the amount of shapes or other movieclips in your Img. If you feel uncertain about this method, a safer option would be to declare a boolean at the start and set it to true in the displayImage function.

  1. if ( numChildren < 3 ) loadImage();
	if ( numChildren < 3 ) loadImage();

There’s no depth in AS3, but once we start scaling and rotating our images we need to make sure the image in the center is on top of the others. Because we passed the position as an argument in the goTo function we can now use it to set the index of the image in the imagesClip. The index of a child can be compared to a depth, but there won’t be any issues when changing it since the other movieclips will move an index up or down. This step is unnecessary if you don’t plan to overlap the images.

  1. parent.setChildIndex( this, ( parent.numChildren-1 ) - Math.abs( position ) );
	parent.setChildIndex( this, ( parent.numChildren-1 ) - Math.abs( position ) );

Lastly, we determine the position of the image. The “extra” variable is used here to find out by how much the current image is away from the center. “DefaultWidth” and “spaceBetween” are public variables set in the main Gallery class so we can access them from anywhere. Since all the images in my directory have the same width, I set defaultWidth at 195 and spaceBetween to 20. To actually move the image to the new position we set the x property to the newly found x value.

  1. var extra : Number =  Math.round( position * ( main.defaultWidth + main.spaceBetween ) );
  2. var newX : Number = Math.round( ( main.stageWidth / 2 ) ) + extra;
  3. x = newX;
	var extra : Number =  Math.round( position * ( main.defaultWidth + main.spaceBetween ) );
	var newX : Number = Math.round( ( main.stageWidth / 2 ) ) + extra;
	x = newX;
}

Step 12

The deActive function is pretty straight forward, it changes the visibility to false. The direction is already set as an argument since we’ll need it later to know in which direction to send the image when taking it off the stage.

  1. public function deActive( direction : Number ) : void
  2. {
  3. visible = false;
  4. }
public function deActive( direction : Number ) : void
{
	visible = false;
}

Step 13

By now, the first few images should appear on stage. There’s only one functionality still missing. The slider is not connected to the goTo function yet. However, since we already dispatch a custom event once the handle is dragged, it’s not very hard to connect the two.

Add the following line to the Gallery constructor function. This eventlistener will run the slide function every time the “sliding” event is called by the handle.

  1. theHandle.addEventListener( ”sliding”, slide );
theHandle.addEventListener( "sliding", slide );

All we need the slide function to do is to calculate which image should be shown in the center depending on where the handle is. In the function “slider” and “theHandle” are the instance names we set earlier on the movieclips on the stage. To find out which image to go to we first determine the percentage of the handle’s position over the slider’s length. Then, multiplying that by the total of images brings us to the right image id.

  1. private function slide( _e : Event ) : void
  2. {
  3. var percent : Number = ( theHandle.goToX - slider.x ) / ( slider.width - theHandle.width );
  4. var imgId : Number = Math.round( percent * ( images.length - 1 ) );
  5. goTo( imgId );
  6. }
private function slide( _e : Event ) : void
{
	var percent : Number = ( theHandle.goToX - slider.x ) / ( slider.width - theHandle.width );
	var imgId : Number = Math.round( percent * ( images.length - 1 ) );

	goTo( imgId );
}

Step 14

If you’ve managed to follow this far and kept track of which classes to import and which variables to declare (or followed the source files) you should by now have a working example.

Step 15

To finish this tutorial we’ll add tweening to the images using TweenLite, a free and lightweight tweening engine. The standard tweening classes provided by Adobe do not perform well when there’s a lot going on. When trying those out they used to crash or freeze a lot, while I have yet to discover such problems with TweenLite. The syntax of TweenLite is very easy. I’ll demonstrate this by comparing it to a normal Flash tween; tweening an object from its current x to 100 and changing the alpha to 0:

  1. new Tween( object, ’x', Linear.easeOut, object.x, 100, 2, true );
  2. new Tween( object, ’alpha’, Linear.easeOut, object.alpha, 0, 2, true );
new Tween( object, 'x', Linear.easeOut, object.x, 100, 2, true );
new Tween( object, 'alpha', Linear.easeOut, object.alpha, 0, 2, true );

Now here’s the TweenLite alternative syntax:

  1. TweenLite.to( object, 2, { x:100, alpha:0, easing:Linear.easeOut } );
TweenLite.to( object, 2, { x:100, alpha:0, easing:Linear.easeOut } );

Step 16

Let’s create a new function in which we can place all of the tweening actions. Name it “flyTo” and place it in the Img class.

  1. private function flyTo( newX : Number, removeAfter : Boolean, scale : Number = 1 ) : void
  2. {
  3. var tweeningOptions : Object = new Object;
  4. tweeningOptions.x = newX;
  5. if ( removeAfter )
  6. {
  7. tweeningOptions.ease = Linear.easeIn;
  8. tweeningOptions.alpha = 0;
  9. tweeningOptions.scaleX = tweeningOptions.scaleY = 0.3;
  10. tweeningOptions.visible = false;
  11. }
  12. else
  13. {
  14. tweeningOptions.ease = Back.easeOut;
  15. tweeningOptions.alpha = 1;
  16. tweeningOptions.scaleX = tweeningOptions.scaleY = scale;
  17. tweeningOptions.rotation = (Math.random() * 20) - 10;
  18. }
  19. TweenLite.to ( this, 0.4, tweeningOptions );
  20. }
private function flyTo( newX : Number, removeAfter : Boolean, scale : Number = 1 ) : void
{
	var tweeningOptions : Object = new Object;
	tweeningOptions.x = newX;

	if ( removeAfter )
	{
		tweeningOptions.ease = Linear.easeIn;
		tweeningOptions.alpha = 0;
		tweeningOptions.scaleX = tweeningOptions.scaleY = 0.3;
		tweeningOptions.visible = false;
	}
	else
	{
		tweeningOptions.ease = Back.easeOut;
		tweeningOptions.alpha = 1;
		tweeningOptions.scaleX = tweeningOptions.scaleY = scale;
		tweeningOptions.rotation = (Math.random() * 20) - 10;
	}
	TweenLite.to ( this, 0.4, tweeningOptions );
}

There are 3 arguments needed for this function: the x value we calculated earlier, whether it should be removed after the tween and the scale. The “removedAfter” parameter will be used in the deActive function, so the visibility of the image can be set to false once it’s reached the end of the stage. The scaling parameter is only used for the center image; we’ll display it slightly larger than the rest.

Let’s check out the tweening options for when the image is removed from the stage. First we choose an easing option, in this case “Linear.easeIn” which gives normal, linear movement. Secondly, we fade the alpha value to zero so the image fades away. Then we scale it to only a small percentage of its width and height so it becomes smaller as it reaches the end. Lastly, when the tween is completed, we set the visibility to false.

  1. tweeningOptions.ease = Linear.easeIn;
  2. tweeningOptions.alpha = 0;
  3. tweeningOptions.scaleX = tweeningOptions.scaleY = 0.3;
  4. tweeningOptions.visible = false;
tweeningOptions.ease = Linear.easeIn;
tweeningOptions.alpha = 0;
tweeningOptions.scaleX = tweeningOptions.scaleY = 0.3;
tweeningOptions.visible = false;

When an image is made active, the tweening options are different. We set the easing to “Back.easeOut” so the images seem to fly slightly too far and then bounce back; a very subtle effect. Next we change the alpha back to 1 and scale the image to the scale value we passed to the function. Lastly, we set a random rotation of -10 to 10 degrees. If your description text fails to load after this action you need to make sure the font is embedded.

  1. tweeningOptions.ease = Back.easeOut;
  2. tweeningOptions.alpha = 1;
  3. tweeningOptions.scaleX = tweeningOptions.scaleY = scale;
  4. tweeningOptions.rotation = Math.round( (Math.random() * 20) - 10 );
tweeningOptions.ease = Back.easeOut;
tweeningOptions.alpha = 1;
tweeningOptions.scaleX = tweeningOptions.scaleY = scale;
tweeningOptions.rotation = Math.round( (Math.random() * 20) - 10 );

Step 17

Now we need to update the makeActive and deActive functions so they make use of the new flyTo function.

In the makeActive function we need to add an x value to the image so it can be tweened from that original value. The defaultWidth needs to be set in the main Gallery class and contains the width of the stage.

  1. public function makeActive( position : Number, direction : Number ) : void
  2. {
  3. deactivating = false;
  4. if ( parent == null )
  5. {
  6. x = ( direction == 1 ? main.stageWidth + main.defaultWidth * 2 : - main.defaultWidth * 2 );
  7. alpha = 0;
  8. main.imagesClip.addChild( this );
  9. }
  10. visible = true;
  11. if ( numChildren < 3 ) loadImage();
  12. parent.setChildIndex(this, ( parent.numChildren-1 ) - Math.abs( position ) );
  13. var extra : Number =  Math.round( position * ( main.defaultWidth + main.spaceBetween ) );
  14. var newX : Number = ( Math.round( ( main.stageWidth / 2 ) /* - ( main.defaultWidth / 2 )*/ ) + extra );
  15. flyTo( newX, false, ( position == 0 ? 1.2 : 1 )  );
  16. }
public function makeActive( position : Number, direction : Number ) : void
{
	deactivating = false;
	if ( parent == null )
	{
		x = ( direction == 1 ? main.stageWidth + main.defaultWidth * 2 : - main.defaultWidth * 2 );
		alpha = 0;
		main.imagesClip.addChild( this );
	}
	visible = true;
	if ( numChildren < 3 ) loadImage();
	parent.setChildIndex(this, ( parent.numChildren-1 ) - Math.abs( position ) );

	var extra : Number =  Math.round( position * ( main.defaultWidth + main.spaceBetween ) );
	var newX : Number = ( Math.round( ( main.stageWidth / 2 ) /* - ( main.defaultWidth / 2 )*/ ) + extra );
	flyTo( newX, false, ( position == 0 ? 1.2 : 1 )  );
}

In the deActive function all we need to add is a moveTo value which contains the x value to which the image should tween. If we locate this to outside the stage width, the image will disappear just outside the stage.

  1. public function deActive( direction : Number ) : void
  2. {
  3. if ( ! deactivating )
  4. {
  5. active = false;
  6. var moveTo : Number = ( direction != 1 ? main.stageWidth + main.defaultWidth * 2 : parent.x - main.defaultWidth * 2 );
  7. flyTo( moveTo, true );
  8. deactivating = true;
  9. }
  10. }
public function deActive( direction : Number ) : void
{
	if ( ! deactivating )
	{
		active = false;
		var moveTo : Number = ( direction != 1 ? main.stageWidth + main.defaultWidth * 2 : parent.x - main.defaultWidth * 2 );
		flyTo( moveTo, true );
		deactivating = true;
	}
}

Step 18

After updating everything, we now have a functional gallery. To see the movieclips disappearing from the stage check out the full version.

Conclusion

The final version is still low on functionality. The loaded images all need to be the same size and do not have a larger preview. You could add a resizing function and an option to view a larger preview of the image when clicked. Furthermore, an option to browse left or right with buttons or with a keyboard event could be added.

Once you understand the concept of using classes to separate and structure your code it will help in development and make things easier in the long run. I hope you enjoyed following along!

– All information contained within is from Flashtuts.com a great site where you can learn how to use flash to build your skills.  Great authors who have shared their knowledge for others to grow.

Thanks for all you guys do!!

www.flashtuts.com

Introduction

There are two main ways I can think of to power a guest book; the more commonly used MYSQL database driven, or the less common XML type. They both rely on server-side scripting to work, however the advantage that I see from using the XML version, is the simple fact that you need not worry about whether your host supports MYSQL and you also don’t have to program in 3 different languages. So what will you gain from reading this tutorial I hear you ask?

  • You’ll learn how to program in ActionScript 3.0 (which took me a long time to learn…)
  • You’ll learn how to get data from an XML file and convert it into arrays to work within Flash.
  • You’ll learn how to use these arrays to populate the text field.
  • You’ll learn how to program buttons and a scroll bar.
  • Finally, you’ll also learn how to convert text into xml and send it to a php file where it will be written to the xml file.

Quite a mouth full! Let’s get started.

Step 1 – Getting Started

You should already know how to open flash, or at least I hope you do… You can set up flash however you choose, there are no specific requirements for Frame Rate or Stage Dimensions, however, make sure you have set it to “Action Script 3.0″. If you want to go ahead and copy me word for word I will show you how mine is set up (how nice).

Setup Screen

Step 2 – Stylize

As you can tell from the image below, I have fantastic creative skills! This is the point where we design the guest book, or moving into the modern era, a guest computer or guest phone. I’m sure you’ll do a better job in making yours look more professional than mine does, but just for those who are new to flash, I’ll quickly run through how I created my unique design.

Select the “Rectangle tool”, click on “Properties”, set the “Stroke” to be “3″ and the “Corner Radius” to be “10″. Then click and drag to create your rectangle. Make another smaller one on top of that in a different color, this is where the messages will be displayed. Select the new shape and hit “F8″ to convert it to a Movie Clip. Then go to “Filter” and apply a “Drop Shadow”. Then draw yet another rectangle off to the side; this is where the input fields will go.

Guestbook Design

Step 3 – Loading the XML

So we venture into the unknown for the first time! Start by creating a new file with the extension “.xml”. Then inside that write the following:

  1. <messages>
  2. </messages>
<messages>
</messages>

Save the file as “messages.xml” in the same folder as your flash file. Now, back in flash, create a new Layer called “Actions” and hit “F9″ to bring up the “Actions Panel”. It will be much more beneficial to you if you type in the code I give you by hand rather than copying and pasting it, so by hand type:

  1. var urlRequest:URLRequest = new URLRequest(“messages.xml”);
  2. var urlLoader:URLLoader = new URLLoader();
  3. urlLoader.addEventListener (Event.COMPLETE,fileLoaded);
  4. urlLoader.load (urlRequest);
var urlRequest:URLRequest = new URLRequest("messages.xml");
var urlLoader:URLLoader = new URLLoader();
urlLoader.addEventListener (Event.COMPLETE,fileLoaded);
urlLoader.load (urlRequest);

This bit of code is setting up a variable called “urlRequest” which is holding the path to our “.xml” file. It then creates another variable called “urlLoader” which will be used to load our file. The “addEventListener” is telling flash to wait until the “url” has been loaded before running the “fileLoaded” function. The final line is just telling the “urlLoader” to load “urlRequest” which is our “.xml” file.

  1. var myXML:XML = new XML();
  2. myXML.ignoreWhitespace = true;
  3. var xmlList:XMLList;
var myXML:XML = new XML();
myXML.ignoreWhitespace = true;
var xmlList:XMLList;

These lines create a new variable called “myXML” which is going to store all of the data from our “.xml” file. It then tells the variable to “ignoreWhitespace” which doesn’t do much, but it helps with validation. The last line creates a variable called “xmlList” which will store the messages and information which we will extract into arrays.

Step 4 – Arrays

  1. var arrayName:Array = new Array();
  2. var arrayTitle:Array = new Array();
  3. var arrayDate:Array = new Array();
  4. var arrayFull:Array = new Array();
var arrayName:Array = new Array();
var arrayTitle:Array = new Array();
var arrayDate:Array = new Array();
var arrayFull:Array = new Array();

This bit of code is setting up the arrays which will hold all of the data. For now it would be best to keep yours the same as mine so you don’t get any errors later. You should note that “Full” is what I have used to represent the long message that the user writes.

  1. function fileLoaded (event:Event):void {
  2. myXML = XML(event.target.data);
  3. xmlList = myXML.children();
function fileLoaded (event:Event):void {
	myXML = XML(event.target.data);
	xmlList = myXML.children();

This is the function “fileLoaded” which is called when the “.xml” file has been loaded. In the function we give the “myXML” variable the data from the “.xml” file. We then give “xmlList” the data stripped from “myXML” which is everything except from the “messages” holder we wrote earlier. Obviously there is nothing else apart from that so “xmlList” will be empty.

  1. for (var i:int=0; i<xmlList.length(); i++) {
  2. var xmlName:String = xmlList[i].name;
  3. var xmlTitle:String = xmlList[i].title;
  4. var xmlDate:String = xmlList[i].date;
  5. var xmlFull:String = xmlList[i].full;
  6. arrayName.push (xmlName);
  7. arrayTitle.push (xmlTitle);
  8. arrayDate.push (xmlDate);
  9. arrayFull.push (xmlFull);
	for (var i:int=0; i<xmlList.length(); i++) {
		var xmlName:String = xmlList[i].name;
		var xmlTitle:String = xmlList[i].title;
		var xmlDate:String = xmlList[i].date;
		var xmlFull:String = xmlList[i].full;
		arrayName.push (xmlName);
		arrayTitle.push (xmlTitle);
		arrayDate.push (xmlDate);
		arrayFull.push (xmlFull);

This is the main part of the function. It goes through the data stored in “xmlList” and places it into different arrays. The code starts with a “for” loop, which is saying: while the variable “i” is smaller than “xmlList.length()’, run this code. “xmlList.length()” will be how many people have submitted messages, so if it is equal to 5, this code will run 5 times.

Then, for each attribute (name, title, date and the message) we create a “String Variable” equal to the corresponding attribute inside the “xmlList”. The first time the code is run, providing there are some entries, “i” will be equal to 1 and “xmlName” will be equal to which ever name is first in “xmlList”. The second time it goes through, “i” will be equal to 2 and “xmlName” will be equal to which ever name is second in “xmlList”.

What then happens is that each of the variables is added to the arrays. The value of “xmlName” will be added to “arrayName” by the “.push” method. This means that as the code is run through, all of the names that are stored in “xmlList” are added into the array. The same applies for title, date and full.

  1. if (i == xmlList.length() - 1) {
  2. updateText ();
  3. }
  4. }
  5. }
		if (i == xmlList.length() - 1) {
			updateText ();
		}
	}
}

This is the ending part of the function. It states that if “i” is ever equal to the total amount of entries – 1, run the function “updateText”.

Step 5 – Showing the Messages

Now, after that grueling piece of coding, we get to something a little easier, he says…

On a new layer called “textBox” use the “Text Tool” to create an “Input Text” field over the lighter rectangle. Make sure that you select the “Render text as HTML” box under “Properties > Character” and give it an “Instance Name” of “messageText”.

Text Field

Go back to the actions window and underneath all of the code type the following:

  1. messageText.htmlText = ”Be the first to post!”;
  2. var maximumMessages:Number = 5;
  3. var currentMessages:Number = 0;
  4. function updateText () {
  5. messageText.htmlText = ”";
messageText.htmlText = "Be the first to post!";
var maximumMessages:Number = 5;
var currentMessages:Number = 0;
function updateText () {
	messageText.htmlText = "";

The first line is incase no one has written anything. The variable “maximumMessages” is the amount of messages the we want to be displayed at one time. The “currentMessages” is the last message that has been displayed in the text field. Then we start the function which is called after the arrays have finished being created. The first thing this does is to clear the text field as we don’t always want that message to be at the top.

  1. for (var i = currentMessages; i<maximumMessages; i++) {
  2. messageText.htmlText += (“<b><u>Name:</u></b> ” + arrayName[i]);
  3. messageText.htmlText += (“<b><u>Title:</u></b> ” + arrayTitle[i]);
  4. messageText.htmlText += (“<b><u>Date:</u></b> ” + arrayDate[i]);
  5. messageText.htmlText += (“<b><u>Message:</u></b> ” + arrayFull[i]);
  6. messageText.htmlText += (“……………………………………………..”);
  7. }
  8. currentMessages=i;
  9. }
	for (var i = currentMessages; i<maximumMessages; i++) {
		messageText.htmlText += ("<b><u>Name:</u></b> " + arrayName[i]);
		messageText.htmlText += ("<b><u>Title:</u></b> " + arrayTitle[i]);
		messageText.htmlText += ("<b><u>Date:</u></b> " + arrayDate[i]);
		messageText.htmlText += ("<b><u>Message:</u></b> " + arrayFull[i]);
		messageText.htmlText += (".....................................................");
	}
	currentMessages=i;
}

This is another “for” loop. This time we are using it to populate the “messageText” field. Here we are setting “i” to equal “currentMessages” which at the moment is equal to 0. Then if “i” is less than “maximumMessages” which is equal to 5 we run this code. It will therefore run 5 times.

The first time it runs it will add “Name:” to “messsageText” and then whichever name is in the arrayName array at the place of “i” which will be equal to 0. It will do this for title, date and full before ending with a line of dots to separate the messages. The second time it runs through, “i” will be one greater, so it will add more text with results after the first set in the arrays. At the end we set “currentMessages” to equal “i”.

Step 6 – Components

At this point you’re probably doing well if you don’t have a head-ache. So let’s do something easy. Go to “Window > Components” and from the list drag out two “Buttons” and one “UIScrollBar”. Position them like so:

Components

Then go to “Window > Component Inspector” and with the left button selected, click on the “label” and rename it “Previous”. With the button on the right, rename it “Next”. Then define the “Previous” button’s instance name as “prevBt”, the “Next” button’s as “nextBt” and the “UIScrollBar’s” instance name as “scroller”.

Now, under the “currentMessage=i;” piece of code write the following:

  1. scroller.scrollTarget = messageText;
scroller.scrollTarget = messageText;

This tells the “UIScrollBar” to act as a scroller for “messageText”, incase there are too many words to fit in the designated space. We now need to check if the buttons are being pressed, so underneath all of the code write:

  1. nextBt.addEventListener (MouseEvent.MOUSE_UP,nextFunc);
  2. prevBt.addEventListener (MouseEvent.MOUSE_UP,prevFunc);
nextBt.addEventListener (MouseEvent.MOUSE_UP,nextFunc);
prevBt.addEventListener (MouseEvent.MOUSE_UP,prevFunc);

This adds a listener to see if the mouse cursor has been released over the buttons (if they have been pressed) and if they have, the listener calls a function which we’ll write in the next step.

Step 7 – Coding the buttons

If the “Next” button has been pressed we want the “messageText” to remove what’s in it and load the next messages. If the “Previous” button is pressed we want it to load the previous messages. At the bottom of all of the code write:

  1. function nextFunc (event:MouseEvent) {
  2. messageText.htmlText=”";
  3. maximumMessages+=5;
  4. updateText ();
  5. prevBt.enabled=true;
  6. }
function nextFunc (event:MouseEvent) {
	messageText.htmlText="";
	maximumMessages+=5;
	updateText ();
	prevBt.enabled=true;
}

This is the “Next” function. When triggered, it clears the text field, adds 5 to “maximumMessages”, runs the function “updateText” and enables the “Previous” button. By adding 5 to “maximumMessages” and running the “updateText” function, it loads the next 5 messages into the text box because now, “maximumMessages” is equal to 10 and “currentMessage” is still equal to 5 from the last time the function ran. Therefore, this time the text field will display the next 5 messages in the arrays.

  1. function prevFunc (event:MouseEvent) {
  2. messageText.htmlText=”";
  3. maximumMessages-=5;
  4. currentMessages-=10;
  5. nextBt.enabled = true;
  6. updateText ();
  7. if (currentMessages<=5) {
  8. prevBt.enabled=false;
  9. }
  10. }
function prevFunc (event:MouseEvent) {
	messageText.htmlText="";
	maximumMessages-=5;
	currentMessages-=10;
	nextBt.enabled = true;
	updateText ();
	if (currentMessages<=5) {
		prevBt.enabled=false;
	}
}

This is the function for the “Previous” button. This again clears the text field, it also subtracts “maximumMessages” by 5 and “currentMessages” by 10. This is so that when the “updateText” function runs, it displays the previous 5 entries. It also enables the “Next” button. If “currentMessage” is less than or equal to 5, the “Previous” button is disabled so that the user can’t display false information; there are no messages lower than 0.

Just under “function updateText () {” write:

  1. if (arrayName.length <= maximumMessages) {
  2. maximumMessages = arrayName.length;
  3. nextBt.enabled = false;
  4. }
  5. if (currentMessages < 0) {
  6. currentMessages = 0;
  7. maximumMessages = 5;
  8. nextBt.enabled = true;
  9. }
	if (arrayName.length <= maximumMessages) {
		maximumMessages = arrayName.length;
		nextBt.enabled = false;
	}
	if (currentMessages < 0) {
		currentMessages = 0;
		maximumMessages = 5;
		nextBt.enabled = true;
	}

The first “if” is checking if the total number of messages is less than or equal to the maximum. If this is the case, we are displaying the last entry and don’t want the user to be able to click the “Next” button, so we disable it. It also makes “maximumMessages” equal the total amount of messages so that we do not display extra unneccesary information.

The second “if” is checking if we have gone into minus numbers. If we have, it defaults back to the start and displays the first 5 entries. Also after this code:

  1. if (i == xmlList.length() - 1) {
  2. updateText ();
  3. }
if (i == xmlList.length() - 1) {
	updateText ();
}

add the following:

  1. if (i > 4 ) {
  2. nextBt.enabled = true;
  3. }
if (i > 4 ) {
	nextBt.enabled = true;
}

This is checking if there are more than 5 entries. If there are then we enable the “Next” button. Remember that it’s 4 because “i” starts at 0 not 1. Finally, at the top enter the following:

  1. nextBt.enabled = false;
  2. prevBt.enabled = false;
nextBt.enabled = false;
prevBt.enabled = false;

This is disabling both buttons.

Step 8 – First Test

Okay, open your “.xml” file and type:

  1. <message>
  2. <name>Chris</name>
  3. <title>Hello</title>
  4. <date>7th</date>
  5. <full>this is very complicated =-(</full>
  6. </message>
	<message>
		<name>Chris</name>
		<title>Hello</title>
		<date>7th</date>
		<full>this is very complicated =-(</full>
	</message>

Type it between the tag we wrote earlier, so the whole “.xml” file should only contain:

  1. <messages>
  2. <message>
  3. <name>Chris</name>
  4. <title>Hello</title>
  5. <date>7th</date>
  6. <full>this is very complicated =-(</full>
  7. </message>
  8. </messages>
<messages>
	<message>
		<name>Chris</name>
		<title>Hello</title>
		<date>7th</date>
		<full>this is very complicated =-(</full>
	</message>
</messages>

Save the “.xml”, then test the flash file and you should see this:

First Test

Step 9 – Submit Boxes

Now that we have the first part working, without a break, let’s steam into the second section.

It’s time to create the area that the user fills in to submit a message. Use the “Text Tool” and create 4 “Static Text Fields” saying “Post a Message”, “Name:”, “Title:” and “Message:”.

Then create 3 “Input Text Fields” and put one next to each element that you want to be filled in. Be sure to make the “Message:” input box larger than the others.

Select the text field where the user will enter their name and give it an “Instance Name” of “inputName”. Do this for the title and message boxes, giving their Instance Names “inputTitle” and “inputFull”. On all of my three boxes I have selected the “Selectable” and “Show border around text” boxes. Then, open the “Components” panel again and drag out another Button. This time open the “Component Inspector” panel and change its “label” to “Submit” and its “enabled” to false. Give it an Instance Name of “submitBt”.

Input Box

Step 10 – Setting Up Variables

  1. inputName.text = ”";
  2. var newName:String = ”";
  3. inputTitle.text = ”";
  4. var newTitle:String = ”";
  5. inputFull.text = ”";
  6. var newFull:String = ”";
inputName.text = "";
var newName:String = "";
inputTitle.text = "";
var newTitle:String = "";
inputFull.text = "";
var newFull:String = "";

Place this code under all of your other code. This is saying that each of the “Input Fields” which we created in the previous step are blank. It’s also creating a variable for each element and specifying it as a “String” with the value of nothing.

  1. function onEnterFrame (ev:Event):void {
  2. if (inputName.text != ”" && inputTitle.text != ”" && inputFull.text != ”") {
  3. submitBt.enabled = true;
  4. }
  5. }
function onEnterFrame (ev:Event):void {
	if (inputName.text != "" && inputTitle.text != "" && inputFull.text != "") {
		submitBt.enabled = true;
	}
}

Place this function after all of the code. This function is checking that all of the “Input Fields” contain text. “!=” means does not equal and “&&” is saying “and”. So the function is saying: if all of the “Input Fields” are not blank (meaning that the user has filled them in) enable the “submitBt” button. Now we need to be able to call this function all of the time so we need another listener.

  1. addEventListener (Event.ENTER_FRAME, onEnterFrame);
addEventListener (Event.ENTER_FRAME, onEnterFrame);

This is saying that every time flash enter the frame (which for me is 30 times a second) call the “onEnterFrame” function.

Step 11 – Date

Now that the submit button is active we need to check if it’s been clicked, so we need another listener.

  1. submitBt.addEventListener (MouseEvent.MOUSE_UP,sendData);
submitBt.addEventListener (MouseEvent.MOUSE_UP,sendData);

When released, this listener will call the function “sendData”, so now we need to write the function.

  1. function sendData (event:MouseEvent):void {
  2. var dateToday:Date = new Date();
  3. var thismonth:uint = dateToday.getMonth();
  4. var month:Array = new Array(‘January’,'February’,'March’,'April’,'May’,'June’,'July’,'August’,'September’,'October’,'November’,'December’);
  5. var dateStr:String = (dateToday.getDate()+” ”+month[thismonth]+” ”+dateToday.getFullYear());
function sendData (event:MouseEvent):void {
	var dateToday:Date = new Date();
	var thismonth:uint = dateToday.getMonth();
	var month:Array = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
	var dateStr:String = (dateToday.getDate()+" "+month[thismonth]+" "+dateToday.getFullYear());

The first line is opening the function. We then set “dateToday” as a variable and if I then immediately trace “dateToday” it would show “Fri May 5 10:07:32 GMT+0100 2009″.

The next line sets the variable “thismonth” as the number which is equal to the current month stored inside “dataToday” As we’re currently in May which is the 5th month, if I traced “thismonth” it would reply 4, because it starts at 0, not 1. We then create a new array, storing all of the months in order. Then the “dateStr” is going to store the final date which will be displayed on the guest book.

“dateToday.getDate()” extracts the integer of the current day, so for the 5th, it will extract 5. Then we put in the value of the “month” array that is equal to “thismonth”, so it swaps a number for a string of the month. Then the “getFullYear()” extracts the current year in 4 digit format. So if we now trace “dateStr” we get “5 May 2009″.

Step 12 – Creating new XML

Now that the user has hit submit, we need to transform the details into xml format so they can be written to the “.xml” file.

  1. newName = inputName.text;
  2. newTitle = inputTitle.text;
  3. newFull = inputFull.text;
	newName = inputName.text;
	newTitle = inputTitle.text;
	newFull = inputFull.text;

This is turning the variables we defined earlier to equal what the user has entered into the boxes.

  1. var newItem:XML = XML(“<message><name>” + newName + ”</name><title>” + newTitle + ”</title><date>”+ dateStr+ ”</date><full>” + newFull + ”</full></message>”);
	var newItem:XML = XML("<message><name>" + newName + "</name><title>" + newTitle + "</title><date>"+ dateStr+ "</date><full>" + newFull + "</full></message>");

This daunting piece of code is creating a new variable called “newItem” which is going to store xml data. We then set it to equal an xml formatted string. We start the string with “<message>” which is going to hold all of the details for the user. We then put in the Name, Title, Date and Full variables that we created before, closing it with “</message>”.

  1. myXML.appendChild (newItem);
	myXML.appendChild (newItem);

We are now using “appendChild” to add a “newItem” to the “myXML” which is storing all of the information for the xml file.

Step 13 – Sending The XML.

Now that “myXML” is updated with the new message we need to send it to php.

  1. var request:URLRequest = new URLRequest(“messages.php”);
  2. request.data = myXML;
  3. request.contentType = ”text/xml”;
  4. request.method = URLRequestMethod.POST;
	var request:URLRequest = new URLRequest("messages.php");
	request.data = myXML;
	request.contentType = "text/xml";
	request.method = URLRequestMethod.POST;

Here we are creating a new variable called “request” which is holding the location of our php file. We haven’t created this file yet, but I can tell you what we will call it (lucky you!). We’ll save it in the same folder as all of our files and call it “messages.php”. The next line is telling the “request” that it’s sending off the information inside “myXML”. We are then telling it that this data is in “XML” format and that we are using “post” to send the data.

  1. var loader:URLLoader = new URLLoader(  );
  2. loader.load ( request );
  3. loader.addEventListener ( Event.COMPLETE, loaderDone );
	var loader:URLLoader = new URLLoader(  );
	loader.load ( request );
	loader.addEventListener ( Event.COMPLETE, loaderDone );
}

Now we are creating a new “loader” to handle the sending of the data, just like earlier when we were receiving the data. We add a listener to check if the data has been sent and if so, it triggers the “loaderDone” function.

Step 14 – Refresh Flash.

Before we move into php there is one last thing we must do inside flash:

  1. function loaderDone (evt:Event):void {
  2. arrayName = [];
  3. arrayTitle = [];
  4. arrayDate = [];
  5. arrayFull = [];
  6. inputName.text = ”";
  7. inputTitle.text = ”";
  8. inputFull.text = ”";
  9. submitBt.enabled = false;
  10. maximumMessages = 5;
  11. currentMessages = 0;
  12. messageText.htmlText = ”";
  13. urlLoader.load (urlRequest);
  14. }
function loaderDone (evt:Event):void {
	arrayName = [];
	arrayTitle = [];
	arrayDate = [];
	arrayFull = [];
	inputName.text = "";
	inputTitle.text = "";
	inputFull.text = "";
    submitBt.enabled = false;
	maximumMessages = 5;
	currentMessages = 0;
	messageText.htmlText = "";
	urlLoader.load (urlRequest);
}

This function is clearing the arrays, clearing the Input Text Fields and clearing the messages from the message box. It is also telling “urlLoader” to reload the xml file. This will then trigger the guest book to go back to the start, reload the xml file which has our new entry, populate the arrays and display the first 5 messages once again.

Step 15 – Moving to PHP

Now that we’ve finished in flash save it and publish the new version. Open up a new php file called “messages.php”.

  1. <?php
  2. if (isset($GLOBALS["HTTP_RAW_POST_DATA"])){
  3. $xml = $GLOBALS["HTTP_RAW_POST_DATA"];
  4. $file = fopen(“messages.xml”,”wb”);
  5. fwrite($file, $xml);
  6. fclose($file);
  7. }
  8. ?>
<?php
if (isset($GLOBALS["HTTP_RAW_POST_DATA"])){
    $xml = $GLOBALS["HTTP_RAW_POST_DATA"];
    $file = fopen("messages.xml","wb");
    fwrite($file, $xml);
    fclose($file);
}
?>

This code creates the variable “xml” and assigns it the value of the data that has been sent from flash. It then creates the “file” variable which stores the location of the xml file. “fopen” tells php to open the file, “fwrite” then uses “file” to write the contents of the variable “xml” into it. “fclose” then closes the xml file with the new message safely stored in it, ready to be read by the flash guest book once again.

Conclusion

Finally, upload the files onto your server! Remember these will not work on your hard drive unless you have php installed. Locate the guest book and see if it works, hopefully it will! Thanks for your time, I hope you learned something useful!

Finished

A lady named pat in texas lost her father, and then two weeks later she had lost her brother.

While away her husband who had to stay back home for work, was laid off.  From the emense pain that his wife was dealing with he did not want to tell her until she got home.  So of course what most would call bad luck, did in fact get worse.

Not to long after all the above had occured, she had gone to the doctor and had a ecocardogram done which returned bad news.

She recieved a call from the doc and he told her that she had a whole in her heart in the size of about 1.5cm.  She has the xray of her heart to show the whole which is in fact there.

She was going to have to have surgery to attempt to fix the issue, and prior to the surgery her and her family, church, and friends all prayed and prayed and prayed.  One of her friends told her that God was going to heal the whole, and that when they went in to operate that it would not be there, that God would have healed it.

So pat went on to surgery and was awakened soon after going under and the doctor said that the whole was behind her two artery’s and that when they went in to fix the whole, it was no lnger ther.  That it was gone, and since then her medical case has been close labeled a medical mystery.

TELL ME GOD IS NOT REAL….TELL ME GOD DOES NOT TAKE CARE OF HIS CHILDREN… TELL ME THAT GOD DOES NOT DO MIRACLES…

I tell you what, My God is Alive, and My God is a healer, he hears our prayers and My God is My King and Savior!!!! Glory To You Lord

This little thingy has made me loose some hair, but

it is now done, and well I am very proud of this.

Check out the final product here — View Live Demo

I will putting a tutorial up later on how this came about.

I have found a way to list images in a server, and give you the ability to delete them.

Simple.. just copy the code below and your good.

Code starts for (showimages.php)

<?php
$thumbs_dir = “../uploads/images/”;
$dir = opendir($thumbs_dir);

while ($file = readdir($dir)) {
if ($file != “.” && $file != “..” ) {
echo “<tr><td class=’divider’><img src=’$thumbs_dir$file’ border=’0′ /></td><td class=’divider’>$file</td><td class=’divider’><a href=\”deleteimage.php?imageid=$file&action=delete\”>&raquo; Delete</a></td></tr>”;
}
}
?>

CODE STOPS

CODE STARTS FOR (‘DELETEIMAGE.PHP’)

<?php
$thumbs_dir = “../uploads/images/”;
$dir = opendir($thumbs_dir);

if (isset($action) && ($action == “delete”))
{
$imageid = $_GET['imageid'];
unlink($thumbs_dir.$imageid);
}
?>

code stops

Hope this helps some.

“The church is showing Gods love poorly.”
- Craig Groshel

Topic of discussion, Gay’s and Church.
how we fail the homosexual people along with the lost of our world.

 We should as Jesus Christ would, show unconditional love to people who say they are gay.  Get your attention?
 We should show them that even though the lifestyle that they say they where born into, is not the case.  In the bible
it is taught that living the lifestyle is a sin, but not a greater sin than any other.  There are no rankings on what sin is
worse than another.  That was mans doing… possibly the catholics, but we wont go there.

However, since we are ALL born into sin, because of our long ago beginnings, (adam & eve) we are ALL BORN SINNERS. 
Thus, just as someone is an alcolholic they are not born that way, they are born into sin nature, which if not lead away from
and lead to Christ it could lead you or cause you to turn to that lifestyle.  Just as gay people say they were born that way, that
is 1/2 true and 1/2 false.  REGARDLESS, of why someone says they are gay, its our job as christians to show them love, UNCONDITIONALLY
and see them just as we do the rest of the ‘lost’ people in our world.  Sad thing is, most ‘churhces’ and most ‘christians’ do actually see them and
treat them as they do the rest of the world, like CRAP.  Like they are worthless, and are only shown hatred and basically everything else besides
God’s amazing love.

Someone that calls themselves a christian can not do so and be engulfed into a lifestlye that does not show conviction.  If you can live your life with
out any difference than what we see in the world today, was there or has there ever been any change in your heart?

What I am saying is this… Gay people who are saved may struggle with homosexuality.  But that is no different than someone who struggles with porn,
or masterbation, or lust, or theft, ect.  If someone falls to their tempation and sins, and they are convicted of that and try to escape the grasp of that sin,
its not up to the so called christians of today to decide if that person is a saved child of God.  It is up to Christ himself to decide that fact, and just because
someone does not turn instantly from their sin does not mean that they are not saved.  There are tons of pepole who struggle with sin and yet still are saved
children of God that take years to defeat their tempations, their weaknesses.  God does not give you a pill and you are instantly over your struggles.  Sin can
grab you so slowlly and so easily, that in time with out warning you find yourself somewhere, someplace you never thought you would be.  The climb out of that
whole is so hard, and so many are found to be doing it alone thanks to the failure of some churches and some christians.  Some turn back and just give in falling back
to the septic tank they were out of, and others do make it out and are for ever changed.

Listen christians out there who read this, remember its not up to us to judge, but it is up to God to do so.  There is not a single person on the face of this earth that can look
at another person and say you did something wrong, your not a christian….. There are so many people out there who need God and the free
gift that God has given us in his son Christ Jesus.  But to many times we demolish what we preach by our actions, and our failure to realize that we too were where that person
is.  We fail to realize that we are now called to be different, when we have bad days, its a chance to rejoice, when our lives are falling apart, its a chance to rejoice.  We have to
remember that we are supposed to be here for the lost, for Gods glory, and to encourage and lift up others so that we can show Gods love in how we treat each other.  What has
happend to the fire that is within us?  Where has it gone?  Remeber the gift you were given, when you where a sinner, when you did not diserve it which we still dont now… but
the price that was paid all so that WHO SO EVER BELIVES IN HIM, SHALL NOT PERISH BUT….. BUUUUUT…. HAVE EVER LASTING LIFE.  We put so many restrictions upon
Gods perfect plan, that we again are bringing a set of LAWS to what God sent his son to destroy.  Thats for a nother time, but take some time, sit back and just think.. Just think
about the amount of people you have come across in your lifetime since you have been a child of God.  How many of them have you even tried to be there for regardless of what
they did, or have done.  To show them that there are people who see past the junk they are going through and do not judge them.  Those people who show them unconditional love
regardless if they are gay, straight, a murder, a adulter, additcted to porn, liar, theif, a…….SINNER, just as most of us are everyday.  We know that sin is sin, and thats not to say that
we should not show the lost the error of their ways, but show them through Gods word, not your fist, not your anger, not your loud voice, ect.

Its time to check your heart and make sure that your not only letting Jesus out of his box on sundays, and quickly stuffing him back in when you leave the
parking lot.

this is real. this is our purpose. this is my heart. 

Jesus died for us, he DIED.  For people he did not know, for those who could care less if he was real or not.
remember…… children remember….. Isnt it time we stand together, instead of being divided.

In Him-

05 nissan sentra

use at own risk

so first off you’ll need some window switches from a 02-06 altima (coudl also be maxima to i just stubbled across these one day at the junker)
Image
you can see ours on the left (non transparent switch and the right transparent switch
Image
take yer switch out
Image
unscrew the 3 aroudn the whote cap
Image
pop the top off the white cap, firstly take the window lock button off carefuly otherwise it won’t release from the bottom portion of the unit
Image
Image
pop your switches off
Image
now get your altima switch out, and gently shave the plastic nubs down on the back and middle pieces, this is so you can still go up and down without the switch sticking, trial and error just don’t shave off alot at first
Image
drill holes in the base front of each switch area
Image
fit for leds
Image
wire your leds up, i wried all 3 up in series to the master auto button light that is already attached to the board
Image
so now the lights will all come on when you turn the lights on to your car
for the pass and back seat lights i wired them to a power source (cig lighter) so they are always on but you could do that and put a switch somewhere so you can turn them on off on your own
pass & back switch
Image
now my leds were freakin’ bright so i used 2 1.5k ohm resistors on the wires (this is what i had in the house), depends what you want to for brightness)
put it all back together
Image
Image
Image
Image

i also just replaced all the bulbs in the hvac with leds
Image

Older Posts »