Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Is This Possible? Setting Variables Content On Click Of A Picture Laoded From Mysql?



Hello there,

I am currently trying to build up an image page. There will be about 150 thumbnails loaded from a mysql database which stores the ID, Name, URL of thumbnail, URL of Main picture and Price.

What i would like to know:

is it possible to tell flash HOW MANY images it needs to load (depending on how many are in the DB) and so when you click on the image, it opens the correct main picture, BUT ALSO it places a "Select this one" button next to each image. So when this button is pressed, it changed the value of a variable to the ID of the photo.

I would just like to know if this is possible before i continue trying to figure out how to do it! Of course, if anyone has some sample code... that would be just amazing. I have no idea how i would tell flash to create as many images as it finds in the DB, then arrange them nicely, AND give them all unique names WITH a unique selection button next to each. I feel as though this might be impossible...

regards and really thanks for any help!

UKguy



FlashKit > Flash Help > Flash ActionScript
Posted on: 04-04-2007, 01:16 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Setting Variables To Load Different Content
I'm creating a menu for an archive. There are two important variables which determine what is being viewed. The archive_url, which specifies the folder from which to retrieve the external data, and the year_display variable which loads the appropriate year.

What I need is to be able to link to the page with the same swf and some how specify which archive and which year to load. I know Dreamweaver has a set variable option but this requires making multiple HTML pages with different values being set.... and it also only works in IE.

Is there some way to do this with javascript or HTML? I have seen URLs with values behind them and don't know how they work...
ex: w ww.some_site.com?archive_url=3&year_display=2005

If I could find the answer to this it would be huge. Thanks a lot.

Setting Variables To Load Different Content
I'm creating a menu for an archive. There are two important variables which determine what is being viewed. The archive_url, which specifies the folder from which to retrieve the external data, and the year_display variable which loads the appropriate year.

What I need is to be able to link to the page with the same swf and some how specify which archive and which year to load. I know Dreamweaver has a set variable option but this requires making multiple HTML pages with different values being set.... and it also only works in IE.

Is there some way to do this with javascript or HTML? I have seen URLs with values behind them and don't know how they work...
ex: w ww.some_site.com?archive_url=3&year_display=2005

If I could find the answer to this it would be huge. Thanks a lot.

[FL8 + PHP + MySQL] Adding/Deleting/Viewing Content From MySQL Db
So... Viewing isn't actually the issue here, I just added it to make it a full triangle . I'm doing that with a PHP that writes the contents of the dB in XML syntax.

But, to make it clear, I am trying to develop an application that communicates with a MySQL database, via PHP. And you have the option to add/delete fields, but also in the Flash application.

I found some source at the gotoAndLearn forums, but it simply would not work! I am uploading a zip of the files. The main problem with this is that when I am adding something, the dB gets filled with blanks. This boggles my mind. Not being a big PHP knower (not knowing anything, really), my suggestion is that the variables don't get sent properly. But then again...

Some help with this please? I'm in a kind of a tight spot here, so some help would be really in handy!

Cheers

Click On A Picture To Download The Picture.
Hello,
How do you set up something so that when they click on a "thumbnail", they download the file. I assume I would set it up as a button... But where do/how do I set up the download aspect after they click on it... anyhelp would be appreciated. Thank you.

Php,mysql And Flash- How To Display Picture In Flash From Mysql
How are you all?
I have a question for php,mysql and flash gurus.
Before I ask this question I will describe what I want briefly.
Using php, I retrieve a path to a picture from mysql and send it to flash movie as a variable.
Now what I would like to do is using this path to a picture how to display the picture as a part of a movie?

Cheers,

Where To Start - Setting Up A MySQL Database
Hi,

I want to create a guestbook using MySQL like the one in the tutorial on this site: http://flash-db.com/Tutorials/guestbook/ however Im a newbie to databases and need to know where to start.

I know Im signed up for MySQL and php etc with my host but Im lost as to where to go from here.. Do I need to download anything to get it started??

Any help would be appreciated!

Thanks

Setting Up Dynamic Map To Pull Directly From Mysql
I am in the process of redoing this map: http://www.meritagehomestexas.com/cg...troplex=austin (mainly some functionality changes).

It currently runs off of xml but I was wondering if there was a way to set it up to pull directly from a database. If so, could you point in the direction of some tutorials? Any help is appreciated.

Setting Quality Picture
hi...how to set the quality pixel in flash? everytime i export it, the pixel was so bad.... i'm currently using firework to create a picture, and then, i replace/import it into flash. does it bad by using fireworks? help..help..

and...one more thing...
why my wording wont appear even i've already place the frame above...why?why? someone...help..help...

Dynamic Content: Use A Text File Or MySQL?
I am planning out a site that will have dynamic content inside Flash. One of these dynamic elements is going to be a list of high scores from a flash game. The other dynamic element is going to be a news headline and link that can be updated from an admin.

So, knowing that the high score display will need to be MySQL, how should the headline/link and admin be handled? Should the admin PHP simply write to a text file, or should it write to a MySQL database?

Also, is there a rule for when to use a DB and when to use a text file? What variables need to be considered in making this decision?

jj

SWF2BLOB - Flash Content <==> MySQL BLOB
SWF2BLOB - Flash Content <==> MySQL BLOB
======================================

This project stores, retrieves and downloads Flash content (.fla and .swf files) as MySQL BLOB data.

A PHP server is required.

Demo can be seen at http://www.flashwebservices.co.uk/apps/swf2blob

All source code is in the attached zip file.

Instructions
=======
1. Use the 'swf2blob.sql' file to set up your database table structure
2. Open the 'open_db.inc' file and edit the variables to suit your database
3. Upload everything to your webserver - preferably into its own folder (swf2blob for example)
4. Visit the 'index.php' file to view - you'll obviously need to add some files first

Feel free to edit the source to suit your needs - it would be nice if you kept the copyright intact in the source, but it's not essential to keep it in the footer file.

Let us know of any bugs you come across, or indeed, any improvements you could make (I'm sure there's quite a few).

Cheers.

Log-in To Reveal Purchased Content Etc -php MySQL Flash
hi folks!

I'm relatively new to flash/php/mysql construction. I've done a few such projects sucessfully, having passed the initial learning curve.

heres the question:

How dificult would it be to build a flash website with optional user log-in. the purpose of logging-in would be to purchase songs, images etc, and grant 'access' to these purchased goods anytime the user logged back in to the site.

I understand the role of the .swf, php files, and MySQL database as it applies to the idea above. i think i have a good idea of how it would all work.....

before i agree to the project, and get to work.....
Is there anybody out there that has done something similar and might be able to give me an idea of how intense an undertaking it would be, and/or how much i should charge for such a site?

to give an idea of the scope of the project:
-meticulous graphic design... see image...

http://www.the-abstract-life.com/drop_box/full.jpg

-pretty straight forward information presentation....
-custom image gallery...
-rss feeds for image gallery and articles
-custom flash based PayPal shopping cart....
-custom mp3 player with podcast based playlist...
-newsletter
-possible live video feed (for e-concerts) through www.streamingMediahosting.com or the likes...
-the onsite user log-in and purchase tracking to enable/disable content according to user purchases
-custom flash based content management system for a client with little computer know-how (basically a way for him to maintain/edit/upload content without knowing the first thing about a website).

Blog Style Site.. Xml Or Mysql.. Lots Of Content.
so im working on this project.. it is a web site with quite a bit of content.. it is almost like a blog as far as content goes.. it is gonna all be done in flash.. what is my best option for storing and retrieving the info.. mysql or xml..

i personally was thinking for a lot of content xml would be slow.. especially if i had to search through more than 20 xml files.. wouldnt that get slower than just running a phptomysql script to get the content.???

but on the other hand i heard that running php to mysql scripts through flash isnt the most reliable...

or what about flash remoting???

someone school me.. thankx

Blog Style Site.. Xml Or Mysql.. Lots Of Content.
so im working on this project.. it is a web site with quite a bit of content.. it is almost like a blog as far as content goes.. it is gonna all be done in flash.. what is my best option for storing and retrieving the info.. mysql or xml..

i personally was thinking for a lot of content xml would be slow.. especially if i had to search through more than 20 xml files.. wouldnt that get slower than just running a phptomysql script to get the content.???

but on the other hand i heard that running php to mysql scripts through flash isnt the most reliable...

or what about flash remoting???

someone school me.. thankx

Scroll Picture Box And Tabbed Content
Hiya,

Im making my myspace page in Flash 8.. it's almost done.. I know most other programs involved in graphic design and websites, but I'm just starting flash. I used to only use flash for animations and splash pages, or buttons. Now I want to make my page in myspace.. its all done except I need 2 things done to it.

First off, I have my sections divided into 4 buttons. I have a small box I made in photoshop and in the center of the box, I display content. I have 4 buttons made with all the states done, and I want to have it similar to tabs, where when you click on it, it displays the down state of the button, and the new content for that specific section.

Another thing is, in one of my sections, I have images and names of my friends, and I want a scroll box so I can control the up and down of the contents, by either scroll, or clicking on the buttons.. I want the scrollbox to display more than what can fit in the box.

Anyone have time to help me? I have AIM, Yahoo and MSN messengers. Let me know Thanks.

Exporting Flash Content To Picture
It is possible to automaticaly convert the current content of flash to jpg or gif format file on the server? I need this to be done from the swf file playing within a browser?

People will use flash to put together some elements and text. I need some trick that will generate a picture from flash content for later use on forums and to easily print all contents on hardpaper.

I could do this using mysql for saving text and coordinates of elements via php, and then displaying content in a similar way in another flash. But picture would be much easier for storing and later graphics optimization and printing.


Aleksander

Paste Picture When You Click Down
when you click the mouse. how do you make a picture or symbol appear in the exact spot you click. like in a gun game when you click it makes a bullet hole where you click. i want to make a game but i cant without the code. please help....

mick
[Edited by mickyr on 08-17-2001 at 04:05 AM]

Picture Shows Every Other Click
Would anyone have an idea why my jpg, based on an XML file shows everyother click?

FLA File

XMF File

Thanks for any help...

Munkie!

Click On Number Get Picture
I want to have a list of people and when you click there picture shows. Where do I go to learn more?

Thanks for your time,
JT

Click To Enlarge Picture
I have a thumbnail that would like to have the viewer click to enlarge.
How do I accomplish this?
Thanks
Ecinele

Integrate Microsoft Content Management Server , Flash, And MySQL
Hi all...

I got a client , they want to make a full-flash web site using ASP as backend ,Content Management Server 2002 and mySQL as database. Anyone can tell me how to integrate (customize as well) CMS2002 to flash and database. At least the link abt it.


many thanks

I Have Posted A Very Sexy Picture Of Myself, Click Here To See It.
Ok, I lied. But the first person that helps me resolve this, I really will send a sexy picture of myself to them. hehe. Please read below to help me!!!!


Still having trouble importing EPS files.

My Illustrator eps files look all wacky when I import them into Flash. Any ideas why???

Please help. I posted 3 times on Friday and only recieved one reply but it was another question so I am still trying to find a solution.

Thanks so much!!!!

I Have Posted A Very Sexy Picture Of Myself, Click Here To See It.
Ok, I lied. But the first person that helps me resolve this, I really will send a sexy picture of myself to them. hehe. Please read below to help me!!!!


Still having trouble importing EPS files.

My Illustrator eps files look all wacky when I import them into Flash. Any ideas why???

Please help. I posted 3 times on Friday and only recieved one reply but it was another question so I am still trying to find a solution.

Thanks so much!!!!

Picture Change On Button Click
Hi there!
Im looking for some flash work like this
Want to change picture when i click on it. (without menus and links)
Any help will be greatly appreciated!

Sorry for bad english.

Using Functions Of A Laoded Swf
Hello,
I would like to know how to use functions or methods of an swf which i load into a new movieclip.

Preloader For Laoded MC
Hi, i am loading a exernal movie, closer.swf, into a empty movieclip, "emptymc". Closer.swf needs a preloader(its a 7mb video file). Should I put the preloader in the closer.swf or on the emptymc?

Right now a frame action on the main timeline calls closer.swf to load into emptymc. There is a stop action on frame 1 of closer.swf.

A later frame in the main timeline tells emptymc to go to and play frame 2, which starts the loaded movie clip to play.

It seems no matter where I put the preloader it doesn't advance to frame 2 and start playing. It hangs on frame 1

I've tried on the MAIN timeline, after closer.swf is in the emptymc...

if (_framesloaded._root.emptymc>100)
telltarget(_root.emptymc)
gotoAndPlay(2)

also I tried putting the preloader in the closer.swf

frame 1 action layer stop
frame 1 (there is a loading animation.swf )

with onClipEvent (enterframe){
ifFrameloaded>100{
gotoAndPlay(2) }}
frame2 starts animation

The second way works if I test the closer .swf alone but not when it is loaded into emptymc/

thanks in advance!!

Referenceing MC On Other Laoded MC
I have a loaded _mc which loaded another _mc.
From the child _mc how can I reference a clip on the parent or even the parent of that parent?

I thought _root.my_mc._alpha might work, but it does not seem to.


My program is loading individual swf into a main clip. I want to shut off certain symbols depending on which clip is loaded.

Any ideas?
Thanks
Rich

Complexing Scrollpane - Setting Content
ok, I have writting some lines which are not code but will become code. I want to know if the idea is correct and will work. I have no idea what I am doing so instead of wasting hours of time trying to get some code to work that wont even work i thought it better to ask.

Now what i want is this......

Main.swf - contains buttons and scrollpane. Buttons are 'button1' 'button2' 'button3'. scrollpane name is 'content'.

external movies - 'movie1' 'movie2' 'movie3'

inside each movie is 2 movieclips - '*movie1*loadin' and '*movie1*loadout'

Now when a users clicks on button1 - movie1 will load and play 'loadin' into 'content'.

user then clicks button2 - movie1 plays 'loadout' in 'content' once 'loadout' is finished movie2 loads into 'content' and plays 'loadin'.

now u get the idea. here is my ideas for the code.......


Variables to be use set in main.swf
PLAYIN
PLAYOUT

Code for Button clicking button1
ON RELEASE
play movieclip 'playout'
set var PLAYIN = 'movie1in'
content.setscrollpane.'movie1'

code inside external movie movie1
play movieclip 'playin'
set var PLAYOUT = 'movie1out'


Ok so as i said the code might not be written yet in AS, but the idea is there. Can anybody tell me if this will work, and will i run into any traps with this idea? if so what and how do i get around them?

Thank in Advanced

Trent

Setting Content Of ScrollPane To A Reference?
Hi,

How can I set content of the ScrollPane dynamically.
I have 2 ScrollPane-s on form frmForm2. Content of myScrollPane1 is frmForm1. I wanna
show in myScrollPane2 same thing as in myScrollPane1. I tried passing reference to content of myScrollPane1:

code:
_root.frmForm2.myScrollPane2.setScrollContent(_roo t.frmForm2.myScrollPane1.content);


But it doesn't do what I want.

Is there some other way to project on some place (another ScrollPane, Window, ...) content of a scrollPane (in this case MovieClip inside a mx.screens.Form) so that changes inside a first scrollPane are reflected on this other place. (Something like Document-View arhitecture in MFC).

Zvone

Setting Functions On Scrollpane Content
heres an odd one - i'm loading movieclips into a scrollpane, then setting a function on them for mousedown like so:

code:
paneShirts.content.attachMovie("mcLogo", "XenaWarriorPrincess", 51, {_x:0, _y:0});
paneShirts.content.attachMovie("mcLogo", "XenaWarriorPrincess2", 56, {_x:0, _y:500});

paneShirts.content.XenaWarriorPrincess.onMouseDown =function(){
trace("1");
}

paneShirts.content.XenaWarriorPrincess2.onMouseDow n=function(){
trace("2");
}


however, the onMouseDown is attaching to the scrollpane. as the idea is to set a variable in the _root depending upon which movieclip is clicked, this is buggering up my project!

any idea why this might be or what i can do to circumvent it?

thanks in advance

Setting The Length Of A Txt Box Dependant On Content?
Hi, im trying to create a button i can use over and over again, the problem i have is that i have to set the length of the dynamic text box inside the mc.

This means that if i have one button with a long title, and one with a short one the hit areas are the same length.

Is there a way for a txt box to expand as much as it needs?
Cheers
Neil

Setting The X And Y Pos Of Scroll Pane Content
ok I have a movie where I make a movieclip dynamically then I fill that clip with a bunch of other boxes all created on the fly. this is not my problem.

the problem is that once I set the scroll pane content to be that movieclip I cant for the life of me get the xpos and the y pos to be anythign other than at 0,0 of the scroll pane. I cant even get boxes drawn with teh drawing API to no bleed under the pane itself.

any tips or help?

Setting Box Color On Click
im trying to write some very simple for school and can not figure out one problem. i have two boxes named...

OriginalColor & SelectedColor

When the OriginalColor box is clicked it should set the SelectedColor box to the color of the OriginalColor box. Can someone please help me with the action script of this?

Setting A Dynamic Text Fields Content
I have am creating text fields dynamically using:

this.createEmptyMovieClip("shape", 2);
shape.createTextField("textField", 1, 0, 0, 100, 200);
with (shape.textField) {
selectable = true;
type = "input";
html = true;
border = true;
background = false;
multiline = true;
text = "enter lable here";
autoSize = true;
}

path to each of these is on a count as follows

_root.MC1.shape.textField.text
_root.MC2.shape.textField.text

What I want to do is have a path like:

"_root."+target+".shape.textField.text" = TextVar;

But for some reason it will not work - guess it is something to to with the path to text being text not a var called text?!?

Can anyone help?

Cheers in advance
Ol

Setting 'wmode' For Player/projector Content
Flash 10's introduced a few new ways to draw Flash content to the screen. One of my projects experiences a major performance boost when drawn with the new "direct" wmode. I can set this wmode in an HTML file, but how do I publish a SWF so that it draws in direct wmode when opened in the Flash Player application or in a projector?

Disable Right Click ... Setting Options
I have all the right click options gone but the settings option is still clickable. How do i get rid of the setting options???

THanks,

Photo Gallery With (Right Mouse Click - Save Picture As). Is It Posible?
Hi

I need to create a Photographers webpage

The funktionality something like this http://www.thres.com/

Now this is very simple to do BUT i have a big problem
The Photos must be posible to download (Right Mouse Click -Save Picture as). THIS IS VERY IMPORTANT!!!
I dont know how i can do this in Flash so i was thinking that a good solution will be if i have a XML Webpage where

The Menu & tumbs are flash
The Photos are a html page

A XML where later the photografer can add more photos to the portfolio
and new thumbs as he wish

BUT MOST IMPORTAND IS that the Photos must be posible to download (Right Mouse Click -Save Picture as), or trough a save button !

What do you think guys any better ideas and solutions?


Lambis

Left Click -setting Movie Loaded
how do i do this instead of left click -play -stop-rewind-forward yada yada

[F8] How To Highlight An Navigation Button After Laoded An External Swf
Hello guys,

I have a question after reading and successfully follow this tutorial

http://www.kirupa.com/developer/mx2004/transitions.htm

But i would like to make keep the last navigation button highlighted after clicked on it, that button will send an instruction to load an an external swf to the container.

How do i make an highlight button ,after load a particular page?
For example when loaded page section 2, the button will will highlight the "section 2" button on the navigation.


Any help and guide will be really appreciate.
Thanks

Video Scrubber Going Past The Point Of What Is Laoded
I am using the video class to create my own player. So far so good. I am getting the following error when you advance the scrubber too far to the right, or past where has loaded yet.

Quote:




Error #2044: Unhandled NetStatusEvent:. level=error, code=NetStream.Seek.InvalidTime
at progressiveFLV_controls_1_fla::MainTimeline/frame1()




how do i restrict the scrubber from going past the time that has loaded thus far?

ActionScript Code:
var scrubCont:Sprite = new Sprite();
addChild(scrubCont);
scrubCont.x = 200;
scrubCont.y = 500;

var track:Sprite = new Sprite();
track.graphics.beginFill(0x95CC11);
track.graphics.drawRect(0, -2.5, 100, 5);
track.graphics.endFill();
scrubCont.addChild(track);

var squareScrubber:Sprite = new Sprite();
squareScrubber.graphics.beginFill(0x666666);
squareScrubber.graphics.drawRect(-5, -5, 10, 10);
squareScrubber.graphics.endFill();
scrubCont.addChild(squareScrubber);
squareScrubber.addEventListener(MouseEvent.MOUSE_DOWN, onThumbDown);
squareScrubber.addEventListener(MouseEvent.MOUSE_UP, onThumbUp);
stage.addEventListener(MouseEvent.MOUSE_UP, onThumbUp);

var scrubbingOn:Boolean;
var stream:NetStream;

function onThumbDown(event:MouseEvent):void {
    scrubbingOn=true;
    var scrubberBounds:Rectangle =  new Rectangle(0, 0, track.width, 0);
    squareScrubber.startDrag(false, scrubberBounds);
}
function onThumbUp(event:MouseEvent):void {
    scrubbingOn=false;
    squareScrubber.stopDrag();
    //letGoOfClip.start();
}

How To Highlight An Navigation Button After Laoded An External Swf
Hello guys,

I have a question after reading and successfully follow this tutorial

http://www.kirupa.com/developer/mx2004/transitions.htm

But i would like to make additional animation for the navigation base on the tutorial.

How do i make an highlight button ,after load a particular page?
For example when loaded page section 2, the button will will highlight the "section 2" button on the navigation.

Actually i open a tread b4 at flash 8 section, here is the link
http://www.kirupa.com/forum/showthread.php?t=280609
but it seems not much reply

Any help and guide will be really appreciate.
Thanks

Can Anyone Figure Out How To Get Clip Of An Object Laoded With LoadClip()
Right now I really hate flash a lot... 3 days into a project I'm on the template organization which uses actionscript and loadclip to load stuff and determine where their position is thus determining where the next object should be placed... problem here... I "NEED" to use loadclip but when I use it the movieclip width or height doesn't seem to want to change to expand to the image that is inside it...


Code:
function home_F001() // FIRST TAB HEAD
{
username = "NOD Commando";
style=1;
var home_mcl:MovieClipLoader = new MovieClipLoader();
var home_mclListener:Object = new Object();

// setup initial array
columb = new Array();
columb[0] = new Array();
columb[0][0] = new Array();
columb[0][0][0] = new Array();

// next highest depth
c_count = 1;

// create blank movie
columb[0][0][0] = mc_body_bg.createEmptyMovieClip("container"+c_count, c_count);

// listener on complete
home_mclListener.onLoadComplete = function(target_mc:MovieClip, status:Number):Void
{
home_F002();
// ** START OF ERROR **
trace(mc_body_bg._width) // returns 0 WTF!!!!!
trace(columb[0][0][0]) // returns 0 WTF!!!
trace(mc_body_bg.container1._width) // returns 0 WTF!!!
// lol I Hate this stuff....
columb[0][0][0]._x = 100 // this actually places it at 100 though.. WTF
};

// attach to clip and add listener
//columb[0][0][0] = mc_body_bg.container1;
home_mcl.addListener(home_mclListener);
home_mcl.loadClip("../../styles/"+style+"/170.gif", columb[0][0][0]);
}
home_F001()

Sending Variables To PHP Then MySQL
I've successfully got a mySQL database up and running and a php script which can add rows of info, see below:

<html>
<body>
<?php
$db = mysql_connect("localhost", "mydatabase", "password");
mysql_select_db("mydatabase",$db);
$sql = "INSERT INTO mytable (name, email, comments, score) VALUES ('$name', '$email', '$comments', '$score')";
$result = mysql_query($sql);

?>
</body>
</html>

I would like to be able to submit the four variables (name, email, comments and score) to the php script which will add a new row to my database with the new entries. I cannot get this to work with either loadvariablesnum or get url. Can anyone help??

Cheers

Saving Variables Via PHP Or MySQL
Could someone please give me information on where I can find a PHP script that will allow me to save variables on my server and retrieve them at a later time.

Load Variables From MySql
Hi there,

i need to use this in my AS:


Code:
//*****************************
var v0 = new Vector2D(1, 1);
var v1 = new Vector2D(1, 50);
var v2 = new Vector2D(340, 20);
var v3 = new Vector2D(50, 80);
var v4 = new Vector2D(280, 60);
var v5 = new Vector2D(180, 100);
var v6 = new Vector2D(280, 10);
pt = [v0, v1, v2, v3, v4, v5, v6];
//******************************/
Due to Vector2D(1, 1); is pointed to Vector2D(X, Y); on my map. Basically, i load these variables form mysql:


PHP Code:



   require("connect.php");    
       
    $sql="SELECT * FROM test";  

    $result=mysql_query($sql) or die("Fehler: ".mysql_error());  
    $i = 1;  //Counter for Array
    $pta = '[';
    while ($row=mysql_fetch_array($result))  
    {  
        extract($row);  
        echo "&sx[$i]=".$sx."&";  //Variable X
        echo "&sy[$i]=".$sy."&";  //Variable Y
        echo "&v[$i]=".$i."&"; //Variable (Counter-)Number
        $pta .= 'v'.$i.', ';
        $i++; //Add 1 to counter
    }
        //Clearing $pt...
        $ptb = $pta; //looks like [v1, v2, v3,
        //minus two, because there is a whitespace at the end
        $ptb = substr($ptb, 0,strlen($ptb)-2);
        $pt = $ptb.']'; //looks like $pt = [v1, v2, v3];
        echo "&pt=".$pt."&";





No I need to load my variables. At first $i (e.g. $i = 5;), afterwards build:

Code:
var v[$i] = new Vector2D($x[i], $y[i]); //has to be: var v1 = new Vector2D(1, 1);
var v[$i] = new Vector2D($x[i], $y[i]); //has to be: var v2 = new Vector2D(1, 100);
//and so on...
pt = $pt; //has to be: pt = [v0, v1, v2, v3, v4, v5, v6];
How I can do that?

jan hendrik

Getting Variables From MySQL Database
I have a database with info about each of my movies (filename, size, length, credits, etc) How would I load the variables for a particular movie from the database into the flash?

I did a search on the forum, but I wasnt sure excatlly to search for so I didn't find anything.

PHP Variables From MySQL -> Flash
Hey all,
I'm relatively new to actionscript (only about 3 months or so) but it's a great language that I'm trying my best to learn. Anyways, on to my situation:

I'm attempting to create a PHP/MySQL news database with a Flash frontend for my friend's web site. I've been trying to follow this tutorial:

http://actionscript-toolbox.com/samplemx_loadvars.php

with a few modifications. I don't need visitors to click on a tab to load the news, I'd rather have the last 5 stories "pop-up" on the page when they arrive. I've gotten to the point where I've made a php page that outputs the data from MySQL into a string:

http://www.daysendmusic.com/preview2003/new/news.php

(don't ask how long that took... )

Here's the source for it:


Code:


<?php

mysql_connect("localhost", "daysendm_author", "******");
mysql_select_db("daysendm_news");

$qr = @mysql_query("select authorName, authorEmail, body from news limit 5");

$nrows = mysql_num_rows($qr);
$rString = "n=".$nrows;

for ($i=0; $i < $nrows; $i++) {
$row = mysql_fetch_array($qr);
$rString .= "&authorEmail".$i."=".$row['authorEmail'];
$rString .= "&authorName".$i."=".$row['authorName'];
$rString .= "&body".$i."=".$row['body'];
}
echo $rString;
?>




Now the part that I'm stuck on is how to get that data to be displayed in Flash. Every time I try to access the information provided from news.php, nothing happens. No news is loaded into the news.swf file. I've tried accessing the news.php file and it does display the correct variables but that's as far as I've gotten. As stated above, I would simply like the last 5 stories presented in a scroll box with the author, a link to the author's e-mail, and the body of the news (I would also like to try and get the date working but I'll attempt that later).

I've attached the .fla file so you can see how I've been working so far. All the action takes place inside the mc_main movie clip. Here's the code I'm trying to get working from the one of the action frames:


Code:


_root.main.newstextclip.newstext.htmlText = "Loading News";
temp = new LoadVars();
temp.onLoad = function() {
for (i=0; i < this.n; i++) {
_root.main.newstextclip.newstext.htmlText += "<b><ahref='mailto:" + this["authorEmail"+i] + "'>" + this["authorName"+i] + "</a></b><br>";
_root.main.newstextclip.newstext.htmlText += " " + this["body"+i] + "<br>";
}
}
temp.load("news.php");
stop()



You'll probably need to see the .fla file to make sense of everything. I would also like to note that this takes place on _level1 of a larger swf file that imports this news.swf to use.

I've spent several days and many headaches trying to get this to work so if anyone could help me I would really, really appreciate it.


Thanks!

Click To Activate Content In IE7...the Best Way Around?
Has anyone found the best way around this for a novice HTML person?

Click To Activate To Use This Content?
hi there,

i got another question for you flash guru that you might be able to help me :D

in IE there is this box around my flash and i have to click it before everything else work. how can i solve this problem??

cheers,

Setting What Items Show Up In The Right-Click Flash Context Menu?
Hi,

I don't want players to be able to rewind and forward my flash game, so right now I'm using:


Code:
stage.showDefaultContextMenu=false
But this only shows the Settings and About options. Is there a way for me to choose what goes in there? Because I'd like to expose the quality (low, med, high, best) settings as well in the context menu.

Thanks!!

Copyright © 2005-08 www.BigResource.com, All rights reserved