PhpObject & Fmx04 Components
Anyone using phpObject have this same problem??
If I set up the gateway that connects to my data (which uses #include phpObject.as) and then drop a ComboBox component (or button, or anything...) onto the stage, when I test the movie all I get is a white box with a black border...
Do I need to include another file to get them to show?? I'm wondering if phpObject is stepping on some toes and breaking them... Or, I may just be missing something, any ideas?
I've also noticed that some third party components break the mx04 components... I got a colorpicker component from the flash exchange, and it causes the same problem if I use them together. (Even within different mc's on different layers.)
I've given all my components unique names, and they still just won't show...
Thanks in advance.
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 09-19-2003, 04:31 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
[FMX04/AS2.0]Customizing FMX04 Components (label)
Hello, I'm trying to find a clear and concise book or online referece that can assist me in customizing the components that come with FMX04.
Namely the label component. I know how to change the "halo" theme in general to get the buttons and text boxes to change color, but beyond that I am at a lost.
I have tried Macromedia, searched here/Flash Kit/google, but nothing that I can learn from. Live Docs has a feedback part where someone posted some code and while I can cut and paste it, I'm not completely sure how it all worked.
And if I can't figure it out then its just not as fun.
Any help would be greatly appreciated. Focusing on the label component, but any and all are welcome!
Thanks.
Customizing FMX04 Components (label)
Hello, I'm trying to find a clear and concise book or online referece that can assist me in customizing the components that come with FMX04.
Namely the label component. I know how to change the "halo" theme in general to get the buttons and text boxes to change color, but beyond that I am at a lost.
I have tried Macromedia, searched here/Flash Kit/google, but nothing that I can learn from. Live Docs has a feedback part where someone posted some code and while I can cut and paste it, I'm not completely sure how it all worked.
And if I can't figure it out then its just not as fun.
Any help would be greatly appreciated. Focusing on the label component, but any and all are welcome!
Thanks.
Customizing FMX04 Components (label)
Hello, I'm trying to find a clear and concise book or online referece that can assist me in customizing the components that come with FMX04.
Namely the label component. I know how to change the "halo" theme in general to get the buttons and text boxes to change color, but beyond that I am at a lost.
I have tried Macromedia, searched here/Flash Kit/google, but nothing that I can learn from. Live Docs has a feedback part where someone posted some code and while I can cut and paste it, I'm not completely sure how it all worked.
And if I can't figure it out then its just not as fun.
Any help would be greatly appreciated. Focusing on the label component, but any and all are welcome!
Thanks.
PHPObject Help Me Please
I have done everything and more that the Ghostwire site has given to make phpObject work.
However it doesn't seem to work for me.
I have made a class in php for pulling records from a little mySQL db.
PHP Code:
<?php
class records
{
function getrecords() {
$db_name = "roisport_ROICharts";
$connection = mysql_connect("localhost", "roisport", "missalic") or die("Could not connect to database");
mysql_select_db($db_name, $connection) or die("Could not select database");
$query = "SELECT * FROM ROI_Data WHERE 1";
$results_query = mysql_query($query);
if ($results_query) {
echo("query completed successfully");
} else {
echo("An error has occured");
}
return $results_query;
mysql_close($connection);
}
}
// a function to debug the ho
function debugObject($ob) {
echo "<pre>
";
print_r($ob);
echo "</pre>
";
}
$myObject = new records();
debugObject($myObject);
?>
When i run the class my debug code only prints out
records Object
(
)
Is something wrong with my debug code?
I know its getting the data I have used the same connection data and sql query on another page and it pulls the data no problem.
I need to make sure my class is doing what it was meant to do before I can even mess with the flash part, this I know but I am totally stumped.
Anyone???
PHPObject Problem.. Please Help
I'm trying to display database query results in flash using PHPObject extension but can not succeed.. php and flash file is attached.
thanks for your time..
Flash And PHPObject
Hi, I’m new to all the PHPobject stuff and was hoping that maybe somebody here can help me sort out my problem.
Basically I administer the website for a Wheelchair Basketball Team in Dublin Ireland, called the Dublin Celts. At the moment we are just using Dream Weaver and creating HTML files but I am looking at transferring the site to flash and am trying out a few things. What I want to do is display the result of our last game and our next game (not the result). At the moment I have a table with all the fixtures and results in it on our server. I have written a PHP file which has the mysql statements in it and gives me the results I want. I’ve tested it by accessing it on the web using www.dublincelts.com/test.php (this file is still there, if you want to see the results) and the results appear on the screen, but I want the results to appear in a flash file and have tried using PHPObject but can’t seem to get it working.
The test.php is as follows:
<?php
$link = mysql_connect("#####", "#####", "#####")
or die("Could not connect: " . mysql_error());
mysql_select_db('phpbb2-198461') or die ('Can't use phpbb2-198461 : ' . mysql_error());
$table = "dc_results_0304";
$team = "'Dublin Celts'";
$result = mysql_query("SELECT date, h_team, h_score, a_team, a_score, time FROM $table
WHERE h_score - a_score <> 0 and h_team = $team
or h_score - a_score <> 0 and A_team = $team
order by date desc
limit 1")
or die("Invalid query: " . mysql_error());
while (list($date, $h_team, $h_score, $a_team, $a_score, $time) = mysql_fetch_row($result)) {
echo "$h_team $h_score - $a_score $a_team <br>
";
}
?>
the flash file has a text field called result and I want to populate it with the results from the above php. Can someone please help me. I know I have to create an Action script and have done so, but I can’t get it to work. I’ve copied and edited the test.php file to the following:
<?php
class LNMatch {
function Match() {
$link = mysql_connect("#####", "#####", "#####")
or die("Could not connect: " . mysql_error());
mysql_select_db('phpbb2-198461') or die ('Can't use phpbb2-198461 : ' . mysql_error());
$table = "dc_results_0304";
$team = "'Dublin Celts'";
$result = mysql_query("SELECT date, h_team, h_score, a_team, a_score, time FROM $table
WHERE h_score - a_score <> 0 and h_team = $team
or h_score - a_score <> 0 and A_team = $team
order by date desc
limit 1")
or die("Invalid query: " . mysql_error());
return mysql_fetch_row($result);
}
}
?>
The Action Script file is as follows.
#include "PHPObject.as"
_global.defaultGatewayUrl = "http://www.dublincelts.com/phpBB2/Gateway.php";
_global.defaultGatewayKey = "secret";
myFoo = new PHPObject("LNMatch");
myFoo.Match_onResult = function(result)
{
result.text = result[0];
}
If anyone out there can help me by correcting the code I’d be truly grateful. I can upload the fla file if needs be.
Phpobject - Can't Get Referer
hi,
I would like to track referer. I tried using loadVariables and loadMovie but none of them will trap referer.
Does anyone know a way to get around? Thanks in advance!
Justin
Web-Services & PhpObject
Hi All,
I'm learning about web-services and the phpObject.
I did my first test with the google API, and it seemed to work pretty good.
My question is:
Where do you find all the web-services available? I would specifically like to find a weather web-service that gives out info for my area, and also has a week forecast. But I don't know what to search for...any time I search I end up with what web-services are about...not the webservices themselves.
Can anyone point me to a good resource link to get a bunch of different web-services? Also, are all of them free? or do you have to pay for some? I'm looking for good free ones.
Cheers.
AMFPHP Or PHPObject ?
Hi
I would like to start to learn server side program , I read document about on AMFPHP and PHPObject (ghostwire.com) but I not have the skill to understand what is the different and what is the best to developper Applications with Flash 2004 .
can someone help me ?
all the best
Ernesto
PhpObject Extension
It appears that the phpObject extension download at macromedia is broken or down, does anybody know anywhere else that I can download it ? Or , happen to have a copy of it? Thanks in advance.
Php To PHPObject Problem
I have a php script that prints out
&title=My Title&comments=my comments&
what I want to do is pass title and comments into a PHPObject in flash, but I only get one or the other, not both
PHP Code:
class MyClass {
var $title = '';
var $comments = '';
function MyClass() {
$this->init();
}
function init() { }
function setTitle($vTitle) { $this->title = $vTitle; }
function setComments($vComments) { $this->comments = $vComments; }
function addToDb() {
// [mysql connect code]
$addTitle = $this->title;
$addCom = $this->comments;
$insert = "INSERT INTO my_table VALUES($addTitle, $addCom)";
// [more mysql code]
}
}
and in the first frame...
ActionScript Code:
phpMyClass = new PHPObject("MyClass");
phpMyClass.onInit = function() {}
myData = new LoadVars();
myData.onLoad = function(){
getInfo();
};
function getInfo() {
phpMyClass.setTitle = myData.title;
phpMyClass.setComments = myData.comments;
}
myData.load("http://localhost/flashremote/test.php");
btnSave.onRelease = function() {
phpMyClass.addToDb();
}
if I leave the code as is, only the title gets added to the db.
if I comment out phpMyClass.setTitle = myData.title then the comments
will get added, so it seems like it can't handle more than one variable.
if I take out the phpMyClass functions and set to a dynamic text
or whatever, I'll get both variables
PHPObject Question
i managed to understand how phpobject works, but now i have a question. for example this is the actionscript code:
ActionScript Code:
myTest = new PHPObject("test");
myTest.modInfo_onResult = function () {
textvar = this.info;
};
buton.onRelease = function()
{
myTest.modInfo(text);
}
textvar and text are some vars.
the php code is:
PHP Code:
<?php
class Test {
var $info;
function modInfo($var)
{
$this->info = $var;
}
};
?>
now if there are 2 diferent persons, that are viewing the swf, when someone presses the button it modifies the $info by changing it to whatever the text variable is. but it only modifies HIS variable. how can i do in order to whenever a user that is using the swf (or any swf linked to test.php), to modify the $info for ALL other users ? how touse a mysql table in order to perform that (if required). i thought of a global variable beetween swf's or something, but i couldn't find something like that. please help me.
thanks
PHPObject Or AMFPHP
Pros and Cons of each ?
I see PHPObject has past version 1 which could be considered a pro. Does anyone here use either of them?
PHPObject Or AMFPHP
Pros and Cons of each ?
I see PHPObject has past version 1 which could be considered a pro. Does anyone here use either of them?
How To Extend A PHPObject Class
hello,i wrote the flashObject class as follows:[code]
Code:
class flashObjects extends PHPObject {
//descrive il tipo dell'oggetto
private static var tipi:Array= new Array("router","linea","oggetto","cursore","segnaposto","gruppo","proprietà","contenitore");
private var tipo:String;
//parte router
private var id:Number;
private var sid:String;
private var colore:String;
ETC....
...
.....
but flash gives me the following error
**Errore** C:document_rootprove2004novembrephpobjectsfla shObjects.as: Linea 1: Impossibile caricare la classe 'PHPObject'.
class flashObjects extends PHPObject {
Totale errori ActionScript: 1 Errori segnalati: 1
Help With AddEventListener To OnResult PHPObject?
Hi all - happy new year!
I am in need of help and am an extreme beginner to AS.
below is a sample code snipet
<code>
import com.ghostwire.phpobject.*;
PHPObject.defaultGatewayKey = "key";
// CHANGE THIS TO WHATEVER SECRET KEY YOU SET IN config.php
PHPObject.defaultGatewayUrl = "http://devserver/ddv/server/Gateway.php";
function Get_Flds ()
{
_get_flds = this;
var prop:String = "init";
db1 = new PHPObject ("db1");
db1.get_fields_onResult = function (result)
{
trace(result);//returns data so far so good.
_get_flds.prop = result;
trace(_get_flds.prop);//still returns the correct data
};
db1.get_fields ("Debug_Pg", "Site_Db");//call to php
trace(_get_flds.prop);//No data here???
}
var db_Pg = new Get_Flds ();
<code>
So I beleive the reasone the last trace is not being populated is because PHP has not returned the results.
So I am looking for any help on how I might rewrite this with some sort of event handler so I can better use the data. I have done a bit of research but I am not clear.
I am under a bit of a deadline so any help would be appreciated.
I am sure this has been covered and I have been on this for over a week.
thanks all for this and all the great posts.
PS. This is not the only way I have tried to do this but I have never been able to get an evenListener to work.
I included this code incase a listener is not the right way to go.
Questions About Remoting And PHPObject
Hey all
I'm just starting to play with flash remoting and the PHPObject extension and I"ve got a couple questions I hope someone can help me with:
Does PHPObject allow some kind of real-time interaction between users using only a PHP page? Or do you have to use a storage system like MySQL to store data consistently so that all users viewing the site can see the current data?
(for example a chat program or multiplayer game that requires users to be viewiing synchronised data).
Any help / suggestions / comments would be cool.
cheers
oka
And && ?fmx04
Hi
I have this script:
code:
on (release) {
with (this._parent.mc_wv) {
gotoAndStop(1);}
}
and i have many mcs in the same location that i want to do the same thing
can i use and "&&" (and) function?
I tryed this but not worked:
code:
on (release) {
with (this._parent.mc_wv) && (this._parent.mc_va) {
gotoAndStop(1);}
}
Thank you very much
Cya
[FMX04] Possible Help Anyone?
Hello friends,
I am using the fla's that were posted on Kirupa.com regarding the image gallery where the box scales and resizes depending on what it loads(using XML) within it. The boxe's top left stays static which is the goal and the rest resizes according to what loads. Now inside the actionscript it has spacing of 10 which puts space around the bottom and right sides of the image that is loaded but does not put spacing on the left and top. So, my question is and needed help is to try to get the space so it is on the top and left also, basically so the image loaded is centered within the border. If anyone could help that would be extremely pleasant.
To clarify more simply I just want a even border around the images that it loads.
Here is a link to the files being used:
http://www.jacobwiechman.com/help.htm
Also for some reason when I tried testing to download the .fla myself from the above link it loaded a page with a whole lot of characters. Please let me know if someone out there would like to help, anything would be greatly appreciated, thanks again!
Css And CreateTextField In Fmx04
hi,
if I use the new feature css in fmxo4 it works fine until I try do
create a textfield with createTextField() it doesnt display anymore my css style. by the way I load my text from a xml file.
here my code:
//---------------------------------------------------------------
var newStyle = new TextField.StyleSheet();
var css_url = "firstStyle.css";
newStyle.load(css_url);
newStyle.onLoad = function(ok) {
if (ok) {
this.createTextField("meinText", 1, 100, 100, 300, 100);
meinText.multiline = true;
meinText.wordWrap = true;
meinText.styleSheet = newStyle;
meinText.text = myXML["info"].childNodes[0].nodeValue;
}
};
what is wrong?
the same code without createTextField() works fine.
Please Help With A Particular Effect [FMX04 0r FMX]
I need big time assistance with a particular effect. I have seen this on other sites where there is a picture. Then as you mouse moves over the picture it reveals a picture beneath the first picture. Almost like you are wiping off the the first image. If someone knows where an open source, tutorial or even knows how to do it. Please help me out and post a link or some code.
Thanks a bunch in advanced
Help With Zoom In [FMX04 Or FMX]
Okay I have a picture with a hotspot (button) that when clicked I want the the movie to zoom in on that region. I was able to get the movie to zoom in but not on the region designated. Example I have a image with 20 bottles all are the same except one. The user clicks the bottle that is different which is located in the lower right section of the image, then the movie will zoom in on the region bringing the bottle close up to the user. If anyone could help I would greatly appreciate it.
thx
[FMX04] Key.addlistener?
I'm having trouble getting this part of Sen's code to function! I attached his tutorial fla! I've searched in the AS help in Flash and tried modifying the Key.addlistener object but it still won't respond to the arrow keys!
Sen's code
PHP Code:
// set the ball to recognize key presses and move based on them
Key.addListener(ball);
ball.onKeyDown = function(){
var xmove, ymove;
if (Key.isDown(Key.UP)){
ymove = 1;
}else if (Key.isDown(Key.DOWN)){
ymove = -1;
}else if (Key.isDown(Key.LEFT)){
xmove = -1;
}else if (Key.isDown(Key.RIGHT)){
xmove = 1;
}
// update new position based on ball's current
xmove += this.x;
ymove += this.y;
if (IsValidTile(xmove, ymove)){
moveToGridSpace(xmove, ymove);
}
}
My attempt
PHP Code:
// set the ball to recognize key presses and move based on them
ball = new Object ();
ball.onKeyDown = function(){
var xmove, ymove;
if (Key.isDown(Key.UP)){
ymove = 1;
}else if (Key.isDown(Key.DOWN)){
ymove = -1;
}else if (Key.isDown(Key.LEFT)){
xmove = -1;
}else if (Key.isDown(Key.RIGHT)){
xmove = 1;
}
Key.addListener(ball);
// update new position based on ball's current
xmove += this.x;
ymove += this.y;
if (IsValidTile(xmove, ymove)){
moveToGridSpace(xmove, ymove);
}
}
What is wrong?
[FMX04] Movement
Now, I was wondering: Is it possible to have this occur:
-User selects a button
-a box slides over
-when the user selects said button again, box slides back to original position
I was able to do this with motion tweening, but I keep reading about how you can do this in AS to keep it efficient. Any help would be appreciated.
FMX04: Why Does CSS Work Alone But Not In App?
Hi all
I think I'm missing something simple and trivial in my coding (AS2), please have a look and come with suggestions to a solution. Thank's. :-)
Problem:
When I use the code below it works fine and loads the CSS-file and shows the the html-textarea as it should be CSS-formatted. BUT when I try to put the SAME code into a movieclip within another fla-movie it does not work (loads text but not css) and I get un "undefined" all the time.
After trying a lot of different things I've come to the conclusion that it MIGHT have soemthing to do with the .onLoad that gets "undefined" in some way.
As you can see below I'm getting two vars from input textfields and then use a button to activate the function loadCSS().
ActionScript 2 code:
function loadCSS() {
trace("funktion loadCSS started")
// Create a new style sheet and LoadVars object
var myVars:LoadVars = new LoadVars();
var styles = new TextField.StyleSheet();
// Location of CSS and text files to load
var txt_url = textUrl.text // "myText.txt";
var css_url = cssUrl.text // "html_styles.css";
// Load text to display and define onLoad handler
myVars.load(txt_url);
myVars.onData = function(content) {
storyText = content;
};
// Load CSS file and define onLoad handler:
styles.load(css_url);
styles.onLoad = function(ok) {
if (ok) {
// If the style sheet loaded without error,
// then assign it to the text object,
// and assign the HTML text to the text field.
trace(this.getStyleNames())
news_txt.styleSheet = styles;
news_txt.text = storyText;
trace("css laddat ok!")
} else {
// If something whent wrong
news_txt.text = "Error loading css."
}
}
}
(End of AS2 code)
The css-file (html_styles.css) content:
p {
color: #000000;
font-family: Arial,Helvetica,sans-serif;
font-size: 12px;
display: inline;
}
a:link {
color: #FF0000;
}
a:hover{
text-decoration: underline;
}
.headline {
color: #000000;
font-family: Arial,Helvetica,sans-serif;
font-size: 18px;
font-weight: bold;
display: block;
}
.byline {
color: #666600;
font-style: italic;
font-weight: bold;
display: inline;
}
(End css-file)
The Textfile (myText.txt) content (just some swedish testtext):
<p class='headline'>Kolla detta är en headline som funkar!</p><p><span class='byline'>En liten byline från Rimbo</span>--Kul att testa och se om detta fungerar som vanlig paragraftext... Undrar om åäöÅÄÖ funkar eller om det bara är fel teckenkodninmg på textfilen? Provar nu med textfilsformatet Unicode UTF-8, kanske det funkar bättre? (Ja det gjorde det :-)
Detta skall vara början på ett nytt stycke hoppas jag. Om du vill se hur bra länkar blir så kan du prova att "hovra" över denna länk: <a href='http://ideplanket.se'>Idéplankets hemsida</a>
Nästa stycke, i css-filen som används så är endast följande definerat; p, a:link, a:hover, .headline, .byline .</p>
(End of textfile)
[FMX04] Tween Being Ignored
I have a class that extends MovieClip to load images. In it, I attach an existing movie that acts as a border around the image, and create a MovieClipLoader clip to actually load the JPEG.
One of the things I have in the class is some code like this:
clip.onRelease = function() {
...
}
where I handle clicks on the image. One thing I want to do is rotate the image itself when the user clicks on it, so I tried something like this in the above onRelease function:
var theClip = scope.clip;
trace("rotation = " + theClip._rotation);
new mx.transitions.Tween(theClip, "_rotation", mx.transitions.easing.Strong.easeInOut, 0, 5, 1, true);
but the Tween is being completed ignored. But if I do something simple like:
theClip._rotation = 5;
the image/clip rotates as expected, but obviously without any smooth tweening.
Is there anything "special" I have to do to get my Tween to actually work in this scenario?
[FMX04]loadVariables Need To Be Run Twice
i'm calling a php file, which is supposed to make an xml file. whenever i call the php file using this syntax, most of the time i get "cannot load file" in the xml loading section, but this updates the xml file.
ActionScript Code:
loadVariables("http://localhost/file.php",this,"POST");
but when i do it this way.
ActionScript Code:
loadVariables("http://localhost/file.php",NONE,"POST");
the "cannot load file" messge doesn't get displayed, and the file loads perfectly, but this doesn't update the xml file.
so everytime i have to first use "this" and then "none".
what am i doing wrong? what can i do so that whenever php is called, it'll update the xml file, and still load in the swf. please help, i've been trying to solve this problem for a long time.
[FMX04] Urgent - Please Help.
Hi. Hoping someone can help me here. I have created a "banner" which cycles (using masks) a series of pictures on the main timeline. I also have 5 movieclips which move some text across (at different times) and then fade out (done with AS). All works great - the FIRST time thru. After that the images transition as expected but the AS movieclips, altho they start at the right time, seem to be already running and fading out the text as it comes on the screen - rather than fading as the setInterval did the first time thru. I am thinking that I need a Stop() somewhere but have tried everything (except the right thing obviously ), but alas!
My main movie controls the images / masking using shape tweens etc. The code for my movieclips is below:
HTML Code:
// RealInvest
this._alpha = 100;
this._visible = true;
this._x = 1050;
this._visible = true;
this.onEnterFrame = function() {
// move the text across the stage until it reaches it's target
if (this._x > _global.target) {
_global.speed = (_global.target - this._x)/_global.speedVar;
this._x += _global.speed;
// clear, then set a Timer and call function fadeImage
clearInterval(alpha_interval);
var alpha_interval:Number = setInterval(fadeClip, _global.timeBeforeFade, this);
}
else {
delete this.onEnterFrame;
this.gotoAndStop(1);
}
};
// functions
// Fade
function fadeClip(target_mc:MovieClip):Void {
if (_alpha > 0) {
target_mc._alpha -= _global.fadeRate;
}
else {
target_mc._visible = false;
}
}
I can send the .fla if necessary.
[FMX04]Help W/ XML Caption
This is probably too simple, but I've been trying to figure this out for too long. I finally figured out how to get a scrolling thumbnail photo gallery to work with an imbedded bonus array. What I can't figure out is how to change the caption on the photos so that when I click on the bonus thumbnails (b2, b3, b4, etc) the text/caption changes on the website.
I can upload the flash file if anyone is interested in helping. I really would appreciate it!
Here is some of the partial xml file:
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic bonus="http://www.jbclandscapes.com/photos2008/1 mal 1.jpg"
b1="http://www.jbclandscapes.com/photos2008/1 mal 3.jpg"
b2="http://www.jbclandscapes.com/photos2008/1 mal 4.jpg"
b3="http://www.jbclandscapes.com/photos2008/1 mal 5.jpg"
b4="http://www.jbclandscapes.com/photos2008/1 mal 2.jpg"
b5="http://www.jbclandscapes.com/photos2008/1 mal 6.jpg"
b6="http://www.jbclandscapes.com/photos2008/1 mal 7.jpg"
b7="http://www.jbclandscapes.com/photos2008/1 mal 8.jpg"
b8="http://www.jbclandscapes.com/photos2008/1 mal 9.jpg"
b9="http://www.jbclandscapes.com/photos2008/1 mal 10.jpg"
b10="http://www.jbclandscapes.com/photos2008/1 mal 11.jpg" >
<image>http://www.jbclandscapes.com/photos2008/1 mal 1.jpg</image>
<caption>This front yard renovation features a formal courtyard, framed by tumbled concrete block columns topped with lantern lights and a custom picket fence painted to match the house trim, and is highlighted with an inviting paving stone entrance walkway. The installation of paving stones at the front stoop along with matching sconce lantern lights adjacent to the front door extends this home's architecture into the landscape.</caption>
<thumbnail>http://www.jbclandscapes.com/photos2008/thumbnails/1thumb.jpg</thumbnail>
<t>sampletextmal1||sampletextmal3||sampletextmal4||sampletextmal5||sampltextmal2||sampletextmal6||sampletextmal7||sampletextmal8||sampletextmal9||sampletextmal10||sampletextmal11</t>
</pic>
<pic bonus="http://www.jbclandscapes.com/photos2008/2 mal kitch 1.jpg"
b1="http://www.jbclandscapes.com/photos2008/2 mal kitch 2.jpg"
b2="http://www.jbclandscapes.com/photos2008/2 mal kitch 3.jpg"
b3="http://www.jbclandscapes.com/photos2008/2 mal kitch 4.jpg"
b4="http://www.jbclandscapes.com/photos2008/2 mal kitch 5.jpg"
b5="http://www.jbclandscapes.com/photos2008/2 mal kitch 6.jpg"
b6="http://www.jbclandscapes.com/photos2008/2 mal kitch 7.jpg"
b7="http://www.jbclandscapes.com/photos2008/2 mal kitch 8.jpg"
b8="http://www.jbclandscapes.com/photos2008/2 mal kitch 9.jpg" >
<image>http://www.jbclandscapes.com/photos2008/2 mal kitch 1.jpg</image>
[FMX04] Conditionals Are Being Ignored
I seem to having an issue with conditionals. I have this fla I made that modifies the code in the infinite menu tutorial. Basically instead of it being two movieclips attached together, each movieclip does it's own moving across the stage (there are 7 boxes).
I want to get these things to go across and then appear on the opposite side when they get off of the stage on either side. I set up the conditionals, but they are just ignored and nothing happens. the movie clips just move back and forth without the jumping I'm looking for.
This is my onClipEvent for each movieclip:
Code:
onClipEvent(enterFrame)
{
// This calculates the distance the mouse is from the center.
// We're sticking this here because _xmouse doesn't like to react anywhere else.
var distance = _root._xmouse - _root.xcenter;
// Start moving according to our speed variables
_x += distance * _root.init_spd;
// This will check the location of things and move items accordingly to trick people into thinking it's an infinite loop.
// This checks going left.
if(_x == -65) { _x = 914; }
// This checks going right.
if(_x == 915) { _x = -64; }
}
The last two "if" statments are the issue. The movieclips will get the the specified place, and then just keep going as if nothing was put there.
If anyone could point me in the right direction, that's be great. I also attached the fla file in case that makes it easier on anyone.
Thanks in advance,
Bryan
[FMX04] Newbie Needs AS2 Help
Hi all!
I am creating a navigational menu in flash and decided importing HTML with CSS formatting would be the easiest way to go. I took a GREAT tutorial called Using CSS Styles in Flash MX 2004 and got it all working well if I followed the instructions exactly.
The catch is that I need to import a second external .txt file (that uses the same CSS) because it needs 2 columns. I simply gave the new text box an instance name of "kirupa2" and duplicated the AS code provided in the tutorial. But when I did so, the first column disappeared.
I think it's just an easy AS fix, so here's the code:
Code:
var format = new TextField.StyleSheet();
var path = "flash.css";
format.load(path);
format.onLoad = function(loaded) {
if (loaded) {
output.styleSheet = format;
myLoadVar = new LoadVars ();
myLoadVar.load("kirupa.txt")
myLoadVar.onLoad = function (success){
if (success == true) {
output.variable = "kirupa"
output.htmlText=myLoadVar.kirupa;
}
}
} else {
output.text = "Error loading CSS file!";
}
};
format.load(path);
format.onLoad = function(loaded) {
if (loaded) {
output2.styleSheet = format;
myLoadVar = new LoadVars ();
myLoadVar.load("kirupa2.txt")
myLoadVar.onLoad = function (success){
if (success == true) {
output2.variable = "kirupa2"
output2.htmlText=myLoadVar.kirupa2;
}
}
} else {
output.text = "Error loading CSS file!";
}
};
You can view the movie as it stands here.
Let me know if you need me to upload the .fla file!
Thank you in advance for you help!!!
Please Help With A Particular Effect [FMX04 0r FMX]
I need big time assistance with a particular effect. I have seen this on other sites where there is a picture. Then as you mouse moves over the picture it reveals a picture beneath the first picture. Almost like you are wiping off the the first image. If someone knows where an open source, tutorial or even knows how to do it. Please help me out and post a link or some code.
Thanks a bunch in advanced
Help With Zoom In [FMX04 Or FMX]
Okay I have a picture with a hotspot (button) that when clicked I want the the movie to zoom in on that region. I was able to get the movie to zoom in but not on the region designated. Example I have a image with 20 bottles all are the same except one. The user clicks the bottle that is different which is located in the lower right section of the image, then the movie will zoom in on the region bringing the bottle close up to the user. If anyone could help I would greatly appreciate it.
thx
[FMX04] Key.addlistener?
I'm having trouble getting this part of Sen's code to function! I attached his tutorial fla! I've searched in the AS help in Flash and tried modifying the Key.addlistener object but it still won't respond to the arrow keys!
Sen's code
PHP Code:
// set the ball to recognize key presses and move based on them
Key.addListener(ball);
ball.onKeyDown = function(){
var xmove, ymove;
if (Key.isDown(Key.UP)){
ymove = 1;
}else if (Key.isDown(Key.DOWN)){
ymove = -1;
}else if (Key.isDown(Key.LEFT)){
xmove = -1;
}else if (Key.isDown(Key.RIGHT)){
xmove = 1;
}
// update new position based on ball's current
xmove += this.x;
ymove += this.y;
if (IsValidTile(xmove, ymove)){
moveToGridSpace(xmove, ymove);
}
}
My attempt
PHP Code:
// set the ball to recognize key presses and move based on them
ball = new Object ();
ball.onKeyDown = function(){
var xmove, ymove;
if (Key.isDown(Key.UP)){
ymove = 1;
}else if (Key.isDown(Key.DOWN)){
ymove = -1;
}else if (Key.isDown(Key.LEFT)){
xmove = -1;
}else if (Key.isDown(Key.RIGHT)){
xmove = 1;
}
Key.addListener(ball);
// update new position based on ball's current
xmove += this.x;
ymove += this.y;
if (IsValidTile(xmove, ymove)){
moveToGridSpace(xmove, ymove);
}
}
What is wrong?
[FMX04] Movement
Now, I was wondering: Is it possible to have this occur:
-User selects a button
-a box slides over
-when the user selects said button again, box slides back to original position
I was able to do this with motion tweening, but I keep reading about how you can do this in AS to keep it efficient. Any help would be appreciated.
FMX04: Why Does CSS Work Alone But Not In App?
Hi all
I think I'm missing something simple and trivial in my coding (AS2), please have a look and come with suggestions to a solution. Thank's. :-)
Problem:
When I use the code below it works fine and loads the CSS-file and shows the the html-textarea as it should be CSS-formatted. BUT when I try to put the SAME code into a movieclip within another fla-movie it does not work (loads text but not css) and I get un "undefined" all the time.
After trying a lot of different things I've come to the conclusion that it MIGHT have soemthing to do with the .onLoad that gets "undefined" in some way.
As you can see below I'm getting two vars from input textfields and then use a button to activate the function loadCSS().
ActionScript 2 code:
function loadCSS() {
trace("funktion loadCSS started")
// Create a new style sheet and LoadVars object
var myVars:LoadVars = new LoadVars();
var styles = new TextField.StyleSheet();
// Location of CSS and text files to load
var txt_url = textUrl.text // "myText.txt";
var css_url = cssUrl.text // "html_styles.css";
// Load text to display and define onLoad handler
myVars.load(txt_url);
myVars.onData = function(content) {
storyText = content;
};
// Load CSS file and define onLoad handler:
styles.load(css_url);
styles.onLoad = function(ok) {
if (ok) {
// If the style sheet loaded without error,
// then assign it to the text object,
// and assign the HTML text to the text field.
trace(this.getStyleNames())
news_txt.styleSheet = styles;
news_txt.text = storyText;
trace("css laddat ok!")
} else {
// If something whent wrong
news_txt.text = "Error loading css."
}
}
}
(End of AS2 code)
The css-file (html_styles.css) content:
p {
color: #000000;
font-family: Arial,Helvetica,sans-serif;
font-size: 12px;
display: inline;
}
a:link {
color: #FF0000;
}
a:hover{
text-decoration: underline;
}
.headline {
color: #000000;
font-family: Arial,Helvetica,sans-serif;
font-size: 18px;
font-weight: bold;
display: block;
}
.byline {
color: #666600;
font-style: italic;
font-weight: bold;
display: inline;
}
(End css-file)
The Textfile (myText.txt) content (just some swedish testtext):
<p class='headline'>Kolla detta är en headline som funkar!</p><p><span class='byline'>En liten byline från Rimbo</span>--Kul att testa och se om detta fungerar som vanlig paragraftext... Undrar om åäöÅÄÖ funkar eller om det bara är fel teckenkodninmg på textfilen? Provar nu med textfilsformatet Unicode UTF-8, kanske det funkar bättre? (Ja det gjorde det :-)
Detta skall vara början på ett nytt stycke hoppas jag. Om du vill se hur bra länkar blir så kan du prova att "hovra" över denna länk: <a href='http://ideplanket.se'>Idéplankets hemsida</a>
Nästa stycke, i css-filen som används så är endast följande definerat; p, a:link, a:hover, .headline, .byline .</p>
(End of textfile)
Things I Hate About FMX04
I "finally" decided to try out FlashMX04 and I'm hating it. Here are the things currently bothering me:
You can have any color you like as long as it's gray. I like my comments in the Actions panel to be pink/magenta/0xFF00FF. They've always been that way on my system. I like it that way and as far as I can tell there's no reason I shouldn't be able to keep it that way but MX04 has different ideas. It'll let me select pink comments in the preferences panel and it'll even show the color in the selected box but when I press the "OK" button the comments in my script revert back to the standard gray. I can pick red, but not pink. Does someone at Macromedia not like pink?
Why are the undo and align buttons in the Window/Toolbars/Main panel rather than the Windows/Tools panel? I probably use these "tools" more than any others especially the Undo button, if you're like me the undo button is the most utilitarian button of them all. As it is, I'm forced to have both the Main panel and the Tools panel open which leads to my next peeve...
I can no longer dock the Window/Toolbars/Main panel and the Window/Tools panel on top of each other on the left side of the screen. They'll nest side by side and waste a ton of space, but no matter how hard I try I can't get them to stack. I used to be able to do this in MX but not anymore. Apparently this is one feature MX no longer supports.
And speaking of "lost" features where'd the right-click-a-keyframe-to-show-the-actions-panel function go. Granted that was a fairly convoluted workaround for giving the Actions panel focus but it was better than the current Window/DevelopmentPanels/Actions route I'm forced to take now.
I'd much rather prefered to have spent my time extolling the virtues of the new and improved FMX04 but as it stands now, it's just getting on my nerves.
I'm done ranting... for now. Tomorrow's another day.
-PiXELWiT
http://www.pixelwit.com
[fmx04] Extending Xml Class
hey guys... got a question for more of an advanced user... i have a class that extends xml class and i added another simple function there... testme() which just traces a helloworld msg , but when i call it from another class (after i created the object ofcourse) says there is no method with that name... can anyone help? ---> http://pastebin.neod.com/?id=1560
[FMX04] Dynamic ISOMETRY
OK I have followed Sen's iso dynamic grid creation tutorial and basic iso movement, but know I'm trying to combine the two making the placement of the object which will be controlled on the grid also dynamically through AS.
This is the code for the dynamic grid creation:
ActionScript Code:
spacing=10;depth=0;this.createEmptyMovieClip("isoPlane",0);for(x=0;x<5;x++){for(y=0;y<5;y++){isoTile=isoPlane.attachMovie("isoTile","isoTile"+depth,depth++);isoTile._x=spacing*(x+y);isoTile._y=spacing/2*(x-y);isoTile.x=x;isoTile.y=y;}}
OK now I want to add a library item with linkage ID isoObject to isoPlane so that I can later write the code for the movement along the plane.
ActionScript Code:
//dynamic grid creationspacing=10;depth=0;this.createEmptyMovieClip("isoPlane",0);for(x=0;x<5;x++){for(y=0;y<5;y++){isoTile=isoPlane.attachMovie("isoTile","isoTile"+depth,depth++);isoTile._x=spacing*(x+y);isoTile._y=spacing/2*(x-y);isoTile.x=x;isoTile.y=y;}}//isoObject attached to isoPlaneisoPlane.attachMovie("isoObject","isoObject"+depth,depth++);
Ok it does attach to isoPlane, but I don't know how to reference to the isoObject in my movement script!
In Sen's tutorial on iso movement this is the setup using MC:
STAGE
isoPlane
isoObject
actionscript
IE: the isoObject is within the isoPlane, and so is the AS controlling the movement!
Is my approach correct using AS to place the MC from the library?
[FMX04] HitTest And If() Problems
well actually i have a variety of problems, but i'm just too confused and stumped that i can't really figure out what the problem is.
i'm experimenting and trying to come up with a game whereby the player has to coordinate his keys with the visuals on screen, but i'm having trouble with everything executing fine.
here is my .fla file, please take a look
the main problems i can think of is that
when the player presses the correct key at the correct time, the word "ok" does not show up.
the original mc that gets duplicated doesn't get removed accordingly, but i've managed to work around this by moving it off the stage.
the hitTest isn't too accurate
sorry for the vague descriptions, it's 140 am now and i've been at this for at least the past 5 hours...so i cant really think properly. gotta go Zz . i'll try to post up more detailed stuff about the problems tomorrow morning (or later, rather)
do take a look at my .fla and help me point out/correct any mistakes in the meantime
edit: problem fixed. manage to find the solution after a good night's rest
FMX04 OnClipEvent (data) Help Need
This is my action scripting,
onClipEvent (data) {
if (bytes_loaded == bytes_total) {
gotoAndPlay(6);
}
What I'm trying to do is load an external movie into my main flash site, but I want the main flash site to wait till the movie is loaded then the main time line starts to play again. I would told that the onClipEven(data) would give me this option. So I thought I said that when it's loaded go and play frame 6 of the main time line. What am I doing wrong?
My external movie works fine, and it has a preloader, just want the main timeline to wait till that movie is loaded to start to play again
[FMX04] Image Preloaders
I'm trying to create a preloader for jpg's that are selected from a menu and then being loaded using:
img.loadClip("file:///img/imagename.jpg");
However I don't know the proper usage of the img.getProgress code or how to get the proleader to display the status of the .jpg loading.
Thanks.
[FMX04/AS2.0]Hiding The Scrollbar
Hello,
I hope that this is in the correct forum. I want to hide my scrollbar unless needed. When the data loaded into the dynamic text box fills up the scroll bar will appear as needed.
This is what I have so far...kinda stuck.
body_sb._visible = false;
body_sb._visible = body_txt.maxscroll > 1;
Thanks.
[FMX04] No Duplication On Firing? Help...
Hi
I’m making my first flash game so forgive me if there is anything with my actionscript or my explaining that is messed up.
This game is a 4 player (<--will be) tank game that fires bullets and stuff. so far its working just how i want it to apart from one thing... the duplication for the bullet. This snippet of the script is the bit that should make the bullet firing. if you look at these to bits of script "_root.depth += 1;", "duplicateMovieClip(_root.bullet, "bullet"+depth, depth);" to my understanding the "depth" should increase BUT it doesn't? does anyone know what is going on? please help
Cut out from script:
onClipEvent (load) {
bulspeed = 30;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.DOWN)) {
//depth var should increace but doesn't for some strange reason
//proved by traced message
_root.depth += 1;
trace(this.depth);
angle = this._rotation+180+90;
duplicateMovieClip(_root.bullet, "bullet"+depth, depth);
_root.bullet._x = this._x;
_root.bullet._y = this._y;
_root.bullet.xbulspeed = Math.cos(angle*Math.PI/180)*bulspeed;
_root.bullet.ybulspeed = Math.sin(angle*Math.PI/180)*bulspeed;
_root.bullet.onEnterFrame = function() {
this._x += this.xbulspeed;
this._y += this.ybulspeed;
if (this._x<0 || this._x>750 || this._y<0 || this._y>550) {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
}
}
Anyway if that sounded very confusing then the .fla file is attached so you can have a look at it for your self and see whats up if you want.
thanks
[FMX04] Preloader Question
Greetings,
I've got some preloader action script that I would appreciate someone to look at.
It is currently set to cause the target clip to play after the load is 100% complete. I want the clip to begin after only 20% has downloaded.
Unfortunately its not at all the normal method that I use when creating my own preloaders so I'm lost.
thanks!
------------------
/*
Loader.as
*/
class com.macromedia.flashvideogallery.Loader extends MovieClip
{
var loadTarget:MovieClip;
var right:MovieClip;
var middle:MovieClip;
var left:MovieClip;
var track:MovieClip;
var middleOriginalWidth:Number;
var middleOriginalX:Number;
var rightOriginalX:Number;
var middleMaxWidth:Number;
var handlerClip:MovieClip;
var method:String;
var lbl:TextField;
function Loader()
{
init();
}
private function init():Void
{
middleOriginalWidth = middle._width;
middleOriginalX = middle._x;
rightOriginalX = right._x;
middleMaxWidth = track._width - right._width;
}
function setLoadTarget(t:MovieClip):Void
{
loadTarget = t;
setStatus(0);
onEnterFrame = function()
{
monitorLoadProgress();
}
}
private function monitorLoadProgress():Void
{
var bl:Number = loadTarget.getBytesLoaded();
var bt:Number = loadTarget.getBytesTotal();
if (bl > 4 && bt > 4 && bl >= bt)
{
delete onEnterFrame;
setStatus(1);
handlerClip[method]();
}
else
{
setStatus(bl / bt);
}
}
function setLoadHandler(m:String, hc:MovieClip)
{
handlerClip = hc;
method = m;
}
function reset():Void
{
middle._width = middleOriginalWidth;
middle._x = middleOriginalX;
right._x = rightOriginalX;
}
function setLabel(s:String):Void
{
lbl.text = s;
}
private function setStatus(delta:Number)
{
middle._width = Math.round(delta * middleMaxWidth);
right._x = this.middle._x + middle._width;
}
}
------------
[FMX04]duplicatemovieclip And Path
I have following lines inside a function
var u = clips.clip1.getDepth();
clips.clip1.duplicateMovieClip("clip1clone", u-1);
the problem is that clip1clone is not generated. I think it has to do something with path, I have to add somehow a path to clip1clone?
I tried 0 instead of u-1 but it didnt work so I guess the problem is with path?
Please help!
[FMX04] Transition From Child Swf - Help
Hi there!
I've just successfully followed the tutorial on transitions http://www.kirupa.com/developer/mx2004/transitions.htm
As a bit of a junior at AS I am struggling to work out how to now use this code in one of the child swfs. ie if I wanted to use this code within a loaded child swf how can I modify the code? I have it all set up with a main swf and a few external swfs to load into this parent.
Is it just a case of changing the _root.currMovie to the parent movie?
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "1";
container.loadMovie("1.swf");
} else if (_root.currMovie != "1") {
if (container._currentframe>= container.midframe) {
_root.currMovie = "1";
container.play();
}
}
}
Thanks for your help in adv.
Andy
|