drupal 5, as2 node.save how to set uid and url alias

Events happening in the community are now at Drupal community events on www.drupal.org.
mhncsa-gdo's picture

Hi Everybody!
I'm new to drupal. I would like to make a website with a flash based interview appz. After user click send button I'd like to store the interview text as a node. I used the example "Accessing a service from Flash 8". It works fine.
I have made some changes in the flash code, because I don't want to load the node to the flash but I want to save the flash content to database as node:
var content = new Object();
content.type = "interview";
content.title = "some title";
content.body = "some body text";
var pc:PendingCall = node.save(content);
It works fine, but only when I'm logged in as administrator.

And I need two more things to set:

I need to set the user id (uid)
I tried with adding one more line:
content.uid = "2"; but it doesn't work.
every node that saved from flash has uid=0

the second thing to set is the url alias. I'd like to ganarate a url alias from the user submitted name, and after submitting I'd like to redirect to user to the host/interview/usernamepath page, which contains the interview text.

thanks for help

Comments

solution

attiks's picture

try setting content.uid and content.name, it should work, at least it's working here

url alias

attiks's picture

for the url alias you can try using path auto and get the generated path from the saved node

for some code have a look at

attiks's picture

for some code have a look at this page: http://groups.drupal.org/node/13781

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: